Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RViz (indigo-devel) catkin unable to find Ogre 1.9 libs (MacOSX10.9.3) #782

Open
kpykc opened this issue Jun 13, 2014 · 115 comments
Open

RViz (indigo-devel) catkin unable to find Ogre 1.9 libs (MacOSX10.9.3) #782

kpykc opened this issue Jun 13, 2014 · 115 comments

Comments

@kpykc
Copy link

kpykc commented Jun 13, 2014

Hello,

i used this gist as a start https://gist.github.com/mikepurvis/9837958 to build ROS.

# https://gist.github.com/mikepurvis/9837958

brew tap ros/hydro
brew tap osrf/simulation
brew tap homebrew/versions
brew tap homebrew/science

brew install cmake python libyaml
sudo pip install -U rosdep rosinstall_generator wstool rosinstall
sudo pip install -U pillow
brew install wxpython

rosinstall_generator ros ros_comm robot_model robot_state_publisher diagnostic_msgs octomap rviz \
    --rosdistro indigo --deps --wet-only --tar > indigo.rosinstall
wstool init -j8 src indigo.rosinstall
rosdep install --from-paths src --ignore-src --rosdistro indigo -ry

pushd src
wstool remove orocos_kinematics_dynamics/*
wstool set orocos_kinematics_dynamics --git https://github.com/orocos/orocos_kinematics_dynamics
wstool update orocos_kinematics_dynamics
popd


# http://answers.ros.org/question/94771/building-ros-on-osx-109-solution/
cd <ROS WORKSPACE DIR>

cd src/robot_state_publisher
curl https://github.com/ros/robot_state_publisher/pull/5.patch | patch -p1
cd ..
rm -r build_isolated /robot_state_publisher

cd src/robot_model
curl https://github.com/ros/robot_model/pull/43.patch | patch -p1
cd ..
rm -r build_isolated/kdl_parser

I also added to src/geometry/tf/CMakeLists.txt:

 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_USE_OWN_TR1_TUPLE=1")

Then built workspace:

 ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

In my case, i also installed manually:

brew install opencv --with-qt --with-eigen --with-tbb
brew install lz4

Brew has Ogre 1.7 by default, rviz compiles, but failing to start, as it requires Ogre>= 1.8:

[ INFO] [1402607169.441462000]: rviz version 1.11.2
[ INFO] [1402607169.441525000]: compiled against OGRE version 1.7.4 (Cthugha)
[ INFO] [1402607169.454891000]: Forcing Stereo OFF
2014-06-12 23:06:09.612 rviz[87898:d0b] invalid drawable
[ INFO] [1402607169.641570000]: Stereo is NOT SUPPORTED
[ INFO] [1402607169.641677000]: OpenGl version: 2.1 (GLSL 1.2).
2014-06-12 23:06:09.751 rviz[87898:d0b] invalid drawable
[ WARN] [1402607169.933062000]: OGRE EXCEPTION(7:InternalErrorException): Cannot find serializer implementation for current version [MeshSerializer_v1.8] in MeshSerializer::importMesh at /tmp/ogre-9kTl/ogre_src_v1-7-4/OgreMain/src/OgreMeshSerializer.cpp (line 118)
libc++abi.dylib: terminating with uncaught exception of type Ogre::InternalErrorException: OGRE EXCEPTION(7:InternalErrorException): Cannot find serializer implementation for current version [MeshSerializer_v1.8] in MeshSerializer::importMesh at /tmp/ogre-9kTl/ogre_src_v1-7-4/OgreMain/src/OgreMeshSerializer.cpp (line 118)
Abort trap: 6

I installed Ogre from HEAD:

brew install ogre --HEAD

But,

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OGRE_OV_RVIZ_LIB_OgreMain
    linked by target "executable" in directory /Users/kp/dev/ros/src/rviz/src/rviz
    linked by target "rviz" in directory /Users/kp/dev/ros/src/rviz/src/rviz
    linked by target "default_plugin" in directory /Users/kp/dev/ros/src/rviz/src/rviz/default_plugin
    linked by target "rviz_image_view" in directory /Users/kp/dev/ros/src/rviz/src/image_view
OGRE_OV_RVIZ_LIB_OgreOverlay
    linked by target "executable" in directory /Users/kp/dev/ros/src/rviz/src/rviz
    linked by target "rviz" in directory /Users/kp/dev/ros/src/rviz/src/rviz
    linked by target "default_plugin" in directory /Users/kp/dev/ros/src/rviz/src/rviz/default_plugin
    linked by target "rviz_image_view" in directory /Users/kp/dev/ros/src/rviz/src/image_view

-- Configuring incomplete, errors occurred!

Despite that, as i understood from discussions in rviz issues and source of CMakeLists.txt files, support for new Ogre>=1.9 already integrated in indigo-devel branch.

> sw_vers
ProductName:    Mac OS X
ProductVersion: 10.9.3
BuildVersion:   13D65

> brew info ogre
ogre: stable 1.7.4, HEAD
http://www.ogre3d.org/
/usr/local/Cellar/ogre/1.7.4 (487 files, 17M)
  Built from source
/usr/local/Cellar/ogre/HEAD (2070 files, 150M) *
  Built from source
From: https://github.com/osrf/homebrew-simulation/commits/master/ogre.rb
==> Dependencies
Build: cmake ✔
Required: boost ✔, doxygen ✔, freeimage ✔, freetype ✔, libzzip ✔, tbb ✔

The same both for rviz-release-release-indigo-rviz-1.11.2-1 retrieved by rosinstall and for current indigo-devel branch from git.

@kpykc
Copy link
Author

kpykc commented Jun 13, 2014

This is output of
./src/catkin/bin/catkin_make_isolated --pkg rviz --install -DCMAKE_BUILD_TYPE=Release

==> Processing catkin package: 'rviz'
==> Creating build directory: 'build_isolated/rviz'
==> Building with env: '/Users/kp/dev/ros/install_isolated/env.sh'
==> cmake /Users/kp/dev/ros/src/rviz -DCATKIN_DEVEL_PREFIX=/Users/kp/dev/ros/devel_isolated/rviz -DCMAKE_INSTALL_PREFIX=/Users/kp/dev/ros/install_isolated -DCMAKE_BUILD_TYPE=Release in '/Users/kp/dev/ros/build_isolated/rviz'
-- The C compiler identification is Clang 5.1.0
-- The CXX compiler identification is Clang 5.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   signals
--   system
--   thread
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.28") 
-- checking for modules 'OGRE;OGRE-Overlay'
--   found OGRE, version 1.9.0
--   found OGRE-Overlay, version 1.9.0
-- OGRE_PLUGIN_PATH=/usr/local/Cellar/ogre/HEAD/lib/OGRE
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework  
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version "2.7.5") 
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - not found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - found
-- Looking for QT_MAC_USE_COCOA
-- Looking for QT_MAC_USE_COCOA - found
-- Found Qt4: /usr/local/bin/qmake (found version "4.8.6") 
-- Using CATKIN_DEVEL_PREFIX: /Users/kp/dev/ros/devel_isolated/rviz
-- Using CMAKE_PREFIX_PATH: /Users/kp/dev/ros/install_isolated
-- This workspace overlays: /Users/kp/dev/ros/install_isolated
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.7") 
-- Using PYTHON_EXECUTABLE: /usr/local/bin/python
-- Using default Python package layout
-- Found PY_em: /usr/local/lib/python2.7/site-packages/em.pyc  
-- Using empy: /usr/local/lib/python2.7/site-packages/em.pyc
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /Users/kp/dev/ros/build_isolated/rviz/test_results
-- Found gtest: gtests will be built
-- Using Python nosetests: /usr/local/bin/nosetests-2.7
-- catkin 0.6.6
-- Using these message generators: gencpp;genlisp;genpy
-- checking for module 'eigen3'
--   found eigen3, version 3.2.1
-- Found Eigen: /usr/local/Cellar/eigen/3.2.1/include/eigen3  
-- Eigen found (include: /usr/local/Cellar/eigen/3.2.1/include/eigen3)
making version 1.11.2.
-- Assimp version has unified headers
-- checking for module 'yaml-cpp>=0.5'
--   package 'yaml-cpp>=0.5' not found
TODO: convert rviz tests to catkin.
-- libshiboken built for Release
Using SHIBOKEN_LIBRARY: /usr/local/Cellar/shiboken/1.2.2/lib/libshiboken-python2.7.dylib
-- Using default python: -python2.7
Using PYSIDE_LIBRARY: /usr/local/Cellar/pyside/1.2.2/lib/libpyside-python2.7.dylib
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found suitable version "2.7.5", minimum required is "2.7") 
-- Shiboken binding generator available.
CMake Warning at src/python_bindings/shiboken/CMakeLists.txt:14 (message):
  Shiboken version 1.2.2 would segfault when trying to process rviz (see
  https://bugreports.qt-project.org/browse/PYSIDE-218).  Therefore shiboken
  bindings are being skipped.


-- SIP binding generator available.
Python binding generators: sip
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OGRE_OV_RVIZ_LIB_OgreMain
    linked by target "executable" in directory /Users/kp/dev/ros/src/rviz/src/rviz
    linked by target "rviz" in directory /Users/kp/dev/ros/src/rviz/src/rviz
    linked by target "default_plugin" in directory /Users/kp/dev/ros/src/rviz/src/rviz/default_plugin
    linked by target "rviz_image_view" in directory /Users/kp/dev/ros/src/rviz/src/image_view
OGRE_OV_RVIZ_LIB_OgreOverlay
    linked by target "executable" in directory /Users/kp/dev/ros/src/rviz/src/rviz
    linked by target "rviz" in directory /Users/kp/dev/ros/src/rviz/src/rviz
    linked by target "default_plugin" in directory /Users/kp/dev/ros/src/rviz/src/rviz/default_plugin
    linked by target "rviz_image_view" in directory /Users/kp/dev/ros/src/rviz/src/image_view

-- Configuring incomplete, errors occurred!
See also "/Users/kp/dev/ros/build_isolated/rviz/CMakeFiles/CMakeOutput.log".
See also "/Users/kp/dev/ros/build_isolated/rviz/CMakeFiles/CMakeError.log".
<== Failed to process package 'rviz': 
  Command '/Users/kp/dev/ros/install_isolated/env.sh cmake /Users/kp/dev/ros/src/rviz -DCATKIN_DEVEL_PREFIX=/Users/kp/dev/ros/devel_isolated/rviz -DCMAKE_INSTALL_PREFIX=/Users/kp/dev/ros/install_isolated -DCMAKE_BUILD_TYPE=Release' returned non-zero exit status 1

Reproduce this error by running:
==> cd /Users/kp/dev/ros/build_isolated/rviz && /Users/kp/dev/ros/install_isolated/env.sh cmake /Users/kp/dev/ros/src/rviz -DCATKIN_DEVEL_PREFIX=/Users/kp/dev/ros/devel_isolated/rviz -DCMAKE_INSTALL_PREFIX=/Users/kp/dev/ros/install_isolated -DCMAKE_BUILD_TYPE=Release

Command failed, exiting.

@wjwwood
Copy link
Member

wjwwood commented Jun 13, 2014

Yeah, so rviz in Indigo needs Ogre 1.8+ because of the mesh file versions.

I ran into this exact problem on OS X, and I'm not sure how I fixed it. I'll try to reproduce the problem and come up with a proper fix.

If I remember correctly it is because the Ogre 1.9 installation puts their CMake files in weird locations.

@kpykc
Copy link
Author

kpykc commented Jun 14, 2014

For now, i added to src/rviz/CMakeLists.txt next lines (exactly after endif(NOT DEFINED OGRE_OV_LIBRARIES_ABS)), seems it helps to build rviz. But i'm not good enough in CMake syntax and ROS guidelines to solve this problem gracefully.

set(OGRE_OV_RVIZ_LIB_OgreMain "/usr/local/lib/macosx/Release/Ogre.framework/Versions/1.9.0/Ogre")
set(OGRE_OV_RVIZ_LIB_OgreOverlay "/usr/local/lib/macosx/Release/OgreOverlay.framework/Versions/1.9.0/OgreOverlay")
set(OGRE_OV_LIBRARIES_ABS "${OGRE_OV_RVIZ_LIB_OgreMain};${OGRE_OV_RVIZ_LIB_OgreOverlay}")

@kpykc
Copy link
Author

kpykc commented Jun 14, 2014

This is not complete solution though :(

> rosrun rviz rviz 
dyld: Library not loaded: @executable_path/../Frameworks/Ogre.framework/Versions/1.9.0/Ogre
  Referenced from: /usr/local/lib/macosx/Release/OgreOverlay.framework/Versions/1.9.0/OgreOverlay
  Reason: image not found
Trace/BPT trap: 5

@wjwwood
Copy link
Member

wjwwood commented Jun 14, 2014

The solution will be, I believe, to fix how Ogre is installing its framework, i.e. /usr/local/lib/macosx/Release/Ogre.... should be /usr/local/lib/Frameworks/Ogre..... I haven't figured out the best way to do that yet.

@wjwwood wjwwood added the bug label Jun 16, 2014
@jmtatsch
Copy link

Is https://ogre3d.atlassian.net/browse/OGRE-265 related? Does the fix mentioned towards the end help?

@wjwwood
Copy link
Member

wjwwood commented Jul 15, 2014

@MrTatsch I believe that would address the issue, but I haven't tried it.

@NikolausDemmel
Copy link
Contributor

Nope this patch does not help. There is quite some non-standard stuff going on with the way ogre is built. I just had a look at how debian packages it, and they do a bit of shifting around, also.

One problem is that the rviz uses the pkg-config files and those known nothing about frameworks, so even if we install the frameworks in /usr/local/Frameworks, they are still not being picked up by the rviz configuration.

I wounder if we should try to patch up ogre to achieve a layout similar to the one on debian/ubuntu (no frameworks etc)?


OGRE.pc:

prefix=/usr/local/Cellar/ogre/1.9.0
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
plugindir=${libdir}/OGRE

Name: OGRE
Description: Object-Oriented Graphics Rendering Engine
Version: 1.9.0
URL: http://www.ogre3d.org
Libs: -L${libdir} -lOgreMain  -lpthread
Cflags: -I${includedir} -I${includedir}/OGRE -pthread

@NikolausDemmel
Copy link
Contributor

So here is a ogre 1.9 formula (note the comments): osrf/homebrew-simulation#24

Rviz hydro builds against it, but crashes immediately after start with a segfault in Ogre::OSXCocoaWindow::windowMovedOrResized(), see http://pastebin.com/US2vHB3z

There is also some effort to make gazebo2 work with ogre 1.9: https://bitbucket.org/osrf/gazebo/pull-request/1098/fix-gzclient-startup-crash-with-ogre-19/diff#comment-2444888

Edit: rviz indigo has the same crash in windowMovedOrResized() as rviz hydro.

Edit2: verbose log of rviz before crashing: http://pastebin.com/KXshtnU9

@wjwwood
Copy link
Member

wjwwood commented Jul 21, 2014

I didn't get to this on the weekend, I'll try to do it in the background today.

@NikolausDemmel
Copy link
Contributor

Best try brew install ogre1.9 --devel, which pulls in the latest v1_9 branch instead of the latest 1.9 release. With that, gazebo2 is running (it isn't with the 1.9 release).

@wjwwood
Copy link
Member

wjwwood commented Jul 22, 2014

@NikolausDemmel where are you getting ogre1.9 from?

@NikolausDemmel
Copy link
Contributor

How do you mean? Which Ogre source do I download, or which formula am I using?

I updated (and renamed) the ogre formula from the osrf/simulation tap, see my pull request osrf/homebrew-simulation#24, which has some comments for whats going on (this is also linked above).

@wjwwood
Copy link
Member

wjwwood commented Jul 22, 2014

Sorry, I meant the formula, I see the pull request now. Thanks.

@NikolausDemmel
Copy link
Contributor

I pushed that formula to master of my fork. You should be able to:

brew tap nikolausdemmel/simulation
brew install ogre1.9

or just manually check out the ogre-fixes branch from my fork in your osrf/simulation tap.

(brew install nikolausdemmel/simulation/ogre1.9 does not work strangely, see Homebrew/legacy-homebrew#31052)

@wjwwood
Copy link
Member

wjwwood commented Jul 22, 2014

Weird, I did this in the mean time:

brew install https://raw.githubusercontent.com/NikolausDemmel/homebrew-simulation/ogre-fixes/ogre1.9.rb --devel

@wjwwood
Copy link
Member

wjwwood commented Jul 30, 2014

Ok, so I am currently building indigo from source with your formulae for ogre1.9 and gazebo2.

I also noticed that for some stupid reason gtk+'s bottle brings in Homebrew's version of python... So frustrating.

@NikolausDemmel
Copy link
Contributor

If had success so far with my custom cmake formula and brewed python. I think this combination is the way to go. But you'd need to reinstall all formulae with python bindings and all pip packages.

gtk+ does not in general depend on brewed python, but you have to manually specify --build-from-source to make it accept system python. This is due to the change that all formulae with python bindings are bottled against brewed python, therefore all bottles with python stuff depend on brewed python.

@wjwwood
Copy link
Member

wjwwood commented Jul 30, 2014

Unless, like boost, they do not build it with Python support, so if boost --with-python comes before something that uses Python in its bottle...

@wjwwood
Copy link
Member

wjwwood commented Jul 30, 2014

Ok, I can now reproduce the segfault in rviz, I'll start looking into it.

@NikolausDemmel
Copy link
Contributor

Yeah, that sucks. They'd argue that is simply a user error, but the whole python situation is a real bummer. rosdep/xylem could implement dealing with that by detecting the used python version and making sure to supply --build-from-source for anything with deps on :python

@wjwwood
Copy link
Member

wjwwood commented Jul 30, 2014

That's the tricky part, gtk+ does not depend on python, brew uses python does not list gtk+:

% brew uses python | grep gtk+

@NikolausDemmel
Copy link
Contributor

There is a difference between a dependency on python (formula) and a dependency on :python (requirement). The requirement can resolve to system or brewed python. Unfortunately brew uses :python does not work, but you can see python in brew deps gtk+ (although it is not obvious that it is really :python) and brew deps gtk+ --tree shows you that the dependency comes in through gobject-introspection and is indeed :python.

@wjwwood
Copy link
Member

wjwwood commented Jul 30, 2014

I see, that's changed from how it was just recently. I can hardly keep up with Homebrew at this point. Either way I am starting to drill into the segfault, I'll hopefully have a fix soon.

@NikolausDemmel
Copy link
Contributor

I just noticed that brew uses python includes the formula that depends_on :python. There are only a handful that actually have a hard dependency on the python formula. brew uses python --recursive includes gtk+.
(sorry this is way off topic)

Great stuff about the segfault.

@wjwwood
Copy link
Member

wjwwood commented Jul 31, 2014

Man, Ogre's lib/framework stuff along side its pkg-config and CMake stuff it installs is Soooooo broken. I'm still working on getting a debug version of Ogre installed with sources available to dig into the Ogre functions (the problem appears to be in Obj-C).

@NikolausDemmel
Copy link
Contributor

Yeah indeed that is broken :-/. Are you building the debug version with homebrew or manually? In any case I believe including the patch that makes it not build as frameworks is the way to go.

@wjwwood
Copy link
Member

wjwwood commented Aug 6, 2014

I am still not able to track down the segfault, it is clear that for some reason the Qt window which is passed around as a win_id is getting destroyed and then the Ogre system is trying to use it. It is not null, so it might be a memory corruption issue. I'll keep looking into it as I have time, but it is proving to be very time consuming.

@mikepurvis
Copy link
Member

Did anything come of this? I'm currently revamping my install instructions, and wondering if I should be continuing to recommend building Jade and Indigo with Ogre 1.7 and the Hydro meshes?

@wjwwood
Copy link
Member

wjwwood commented Jul 17, 2015

I haven't had time to resolve this. There is a related ticket here now:

ros/rosdistro#8912

@grafoteka
Copy link

Hi! i'm trying to update ogre from 1.74 to 1.9 to use it with ros indigo on OS X 10.10.

I'm following the steps on this post, but i'm having some problems.
I tried the next:

MacBook-Pro-de-Jorge:Cellar jdeleon$ brew install https://raw.githubusercontent.com/hgaiser/homebrew-simulation/master/ogre1.9.rb
######################################################################## 100,0%
==> Downloading https://bitbucket.org/sinbad/ogre/get/v1-9-0.tar.gz
Already downloaded: /Library/Caches/Homebrew/ogre1.9-1.9.0.tar.gz
==> Downloading https://gist.githubusercontent.com/NikolausDemmel/2b11d1b49b35cd27a102/raw/3af6b118
Already downloaded: /Library/Caches/Homebrew/ogre1.9--patch-9ad217fc33690f76fd857ba49c3840715d4f3527.diff
==> Downloading https://gist.githubusercontent.com/hgaiser/9ed14de3d776cd34100e/raw/38c7a88cab9067e
Already downloaded: /Library/Caches/Homebrew/ogre1.9--patch-c520d0641183bb275a0b29ef6188353bc2ba6217.patch
==> Patching
patching file CMake/Utils/OgreConfigTargets.cmake
patching file CMakeLists.txt
patching file OgreMain/CMakeLists.txt
patching file RenderSystems/GL/src/OSX/OgreOSXCocoaWindow.mm
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 290 with fuzz 1.
==> cmake -DCMAKE_OSX_ARCHITECTURES='x86_64' -DOGRE_BUILD_LIBS_AS_FRAMEWORKS=OFF -DOGRE_FULL_RPATH:
==> make install
^
3 errors generated.
make[2]: *** [OgreMain/CMakeFiles/OgreMain.dir/src/OSX/OgreConfigDialog.mm.o] Error 1
make[1]: *** [OgreMain/CMakeFiles/OgreMain.dir/all] Error 2
make: *** [all] Error 2

READ THIS: https://git.io/brew-troubleshooting

Also I tried this:
MacBook-Pro-de-Jorge:Cellar jdeleon$ brew install https://raw.githubusercontent.com/NikolausDemmel/homebrew-simulation/ogre-fixes/ogre1.9.rb --devel
######################################################################## 100,0%
==> Downloading https://bitbucket.org/sinbad/ogre/get/v1-9.tar.bz2
######################################################################## 100,0%
Error: SHA1 mismatch
Expected: aa9b0c6d371802e0535515758e88c4893045cd5f
Actual: 545f954b7869f3093f9d7d9ec63638a6aaa8eb4e
Archive: /Library/Caches/Homebrew/ogre1.9-1.9.1-devel.tar.bz2
To retry an incomplete download, remove the file above.

But I have a mismatch error.

Has anyone solve this problem?

@hamp
Copy link

hamp commented Aug 17, 2015

@grafoteka : had ran into the second problem myself. The SHA1 has to be changed from the "expected" to the "actual" one in the /usr/local/Library/Taps/nikolausdemmel/homebrew-simulation/ogre1.9.rb .

@wjwwood
Copy link
Member

wjwwood commented Aug 17, 2015

@grafoteka This requires a change in @hgaiser's homebrew repo: https://github.com/hgaiser/homebrew-simulation

@mikepurvis
Copy link
Member

FWIW, I don't believe it's possible to build a usable Gazebo 5 from Ogre 1.9 yet on OS X— as of a month or two ago, gzclient segfaults on startup.

What's the motivation for jumping off of Ogre 1.7 (short of the mesh issue, which you can easily hack around)?

@hgaiser
Copy link
Contributor

hgaiser commented Aug 18, 2015

@mikepurvis, based on what I remember and on the first post it had something to do with the MeshSerializer in Ogre. Based on the first post it seems it requires the serializer from 1.8 or higher. But its been almost a year ago so my memory isn't that clear.

@grafoteka Could you compile ogre1.9 with the -v flag and post the output here? What OSX are you running?

brew install -v https://raw.githubusercontent.com/hgaiser/homebrew-simulation/master/ogre1.9.rb

EDIT:

@grafoteka Ah, it seems Nikolaus already updated his ogre formula, you can use his or mine, I updated mine now too.

brew install https://raw.githubusercontent.com/hgaiser/homebrew-simulation/master/ogre1.9.rb -v --devel

Worked for me.

@aleksandaratanasov
Copy link

Just so you know this issue is also present on Debian Jessie where both 1.8 and 1.9 dev libs for Ogre are present in the repos and none is detected as installed when building ROS.

@wjwwood
Copy link
Member

wjwwood commented Aug 31, 2015

@aleksandaratanasov this issue is for OS X, where the packing is pretty different. If it is not working on Debian, then you should open a new issue. If Debian can install both at the same time, then I'm not surprised that rviz cannot find it correctly since that would have required the Debian packagers to change how the CMake/pkg-config infrastructure is setup in Ogre.

@aleksandaratanasov
Copy link

I know it's for MacOS. I just added it as a proof that it's actually more wide-spread then one would think reading this issue here.

@wjwwood
Copy link
Member

wjwwood commented Aug 31, 2015

@aleksandaratanasov I figured that you knew that, but I was just trying to point out that the packaging is very different between the two systems (in particular OS X's is sort of hacked together), so it's likely to be a different root cause, hence my suggestion to open a new issue.

Thanks.

@aleksandaratanasov
Copy link

Ah, okay. Yeah, I was going to do that but for some reason it doesn't complain anymore. Go figure...

@Cescante
Copy link

Cescante commented Oct 6, 2015

Hi,
I ran

brew install https://raw.githubusercontent.com/hgaiser/homebrew-simulation/master/ogre1.9.rb -v --devel

And keep on getting:

void std::__1::vector<boost::shared_ptr<boost::detail::shared_state_base>, std::__1::allocator<boost::shared_ptr<boost::detail::shared_state_base> > >::__push_back_slow_path<boost::shared_ptr<boost::detail::shared_state_base> const&>(boost::shared_ptr<boost::detail::shared_state_base> const&&&) in libboost_thread-mt.a(thread.o)
      void std::__1::vector<std::__1::pair<boost::condition_variable*, boost::mutex*>, std::__1::allocator<std::__1::pair<boost::condition_variable*, boost::mutex*> > >::__push_back_slow_path<std::__1::pair<boost::condition_variable*, boost::mutex*> >(std::__1::pair<boost::condition_variable*, boost::mutex*>&&) in libboost_thread-mt.a(thread.o)
  "std::runtime_error::runtime_error(char const*)", referenced from:
      boost::(anonymous namespace)::thread_proxy(void*) in libboost_thread-mt.a(thread.o)
      boost::thread::join_noexcept() in libboost_thread-mt.a(thread.o)
      boost::thread::do_try_join_until_noexcept(timespec const&, bool&) in libboost_thread-mt.a(thread.o)
      boost::thread::detach() in libboost_thread-mt.a(thread.o)
      boost::thread::interrupt() in libboost_thread-mt.a(thread.o)
      boost::thread::interruption_requested() const in libboost_thread-mt.a(thread.o)
      boost::thread::native_handle() in libboost_thread-mt.a(thread.o)
      ...
  "std::runtime_error::runtime_error(std::runtime_error const&)", referenced from:
      void boost::throw_exception<boost::condition_error>(boost::condition_error const&) in libboost_thread-mt.a(thread.o)
      void boost::throw_exception<boost::lock_error>(boost::lock_error const&) in libboost_thread-mt.a(thread.o)
      boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >::clone_impl(boost::exception_detail::error_info_injector<boost::lock_error> const&) in libboost_thread-mt.a(thread.o)
      ...

at the step

[ 44%] Linking CXX shared library ../lib/macosx/libOgreMain.dylib
cd /tmp/ogre1.920151005-42586-yljmwj/sinbad-ogre-55e89ae88219/build/OgreMain && /usr/local/Cellar/cmake/3.3.2/bin/cmake -E cmake_link_script CMakeFiles/OgreMain.dir/link.txt --verbose=1
/usr/local/Library/ENV/4.3/clang++   -msse -Wall -Winit-self -Wno-overloaded-virtual -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wshadow -Wno-missing-field-initializers -Wno-long-long -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.7 -dynamiclib -Wl,-headerpad_max_install_names -framework IOKit -framework Cocoa -framework Carbon -framework OpenGL -framework CoreVideo -compatibility_version 1.9.0 -current_version 1.9.0 -o ../lib/macosx/libOgreMain.1.9.0.dylib -install_name /tmp/ogre1.920151005-42586-yljmwj/sinbad-ogre-55e89ae88219/build/lib/macosx/libOgreMain.1.9.0.dylib CMakeFiles/OgreMain.dir/src/OgreAlignedAllocator.cpp.o CMakeFiles/OgreMain.dir/src/OgreAnimable.cpp.o CMakeFiles/OgreMain.dir/src/OgreAnimation.cpp.o CMakeFiles/OgreMain.dir/src/OgreAnimationState.cpp.o CMakeFiles/OgreMain.dir/src/OgreAnimationTrack.cpp.o
...

I've tried compiling boost 1.58 from source both with and without the --c++11 option with the same result. Looking at various forums it seems that most people who ran into these symbol issues with boost uses a -lc++ compiler flag. Is there some obvious I can do about this? If not I'll go ahead and try to clone and see if the flag fixes my issue.

Thanks.

@Cescante
Copy link

Cescante commented Oct 7, 2015

I ended up modifying the latest ogre's cmake to use libc++ and c++11. Ugly hack but finally have it built and installed:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v -stdlib=libc++ -std=c++11 ${OGRE_WARNING_FLAGS}")

@jmtatsch
Copy link

@Cescante so your formula brew install https://raw.githubusercontent.com/Cescante/homebrew-simulation/master/ogre1.9.rb --devel worked? Or did you additionally alter the cmakefile?

@Cescante
Copy link

@jmtatsch The ogre web page says to use CMAKE_CXX_FLAGS = "${CMAKE_CXX_FLAGS} -v -stdlib=libc++ -std=c++11"as part of the cmd args when running cmake. Since we want to do this through homebrew, I couldn't find the right combinations of escaped quotes for the formula to work.

But my machine cached the packages. So I untared it, explicitly altered the set CMAKE_CXX_FLAGS line to what I mentioned above, repackaged and put back into homebrew's cache directory, updated the checksum in the formula to match the new package, and re-ran brew install.

But then brew install https://raw.githubusercontent.com/NikolausDemmel/homebrew-simulation/ogre-fixes/gazebo2.rb also failed, without any error messages in the log besides one line saying that there were 2 errors. I didn't have any more time to spend on it.

@mgrrx
Copy link

mgrrx commented Oct 13, 2015

@Cescante did you install boost with C++11 or without?

@Cescante
Copy link

@mgrrx With.

@jmtatsch
Copy link

@Cescante @ffurrer seems to have succeeded in building gazebo6 recently. Maybe he can give us a hint?

@jmtatsch
Copy link

@Cescante Did you compile Ogre on OS X El Capitan? I managed to get around the libc++ and c++11 issues as you proposed, but I'm stuck after building OgreRTShaderSystem without any meaningful errors https://gist.github.com/jmtatsch/fb8efb7e96e475424697

@wjwwood
Copy link
Member

wjwwood commented Oct 16, 2015

@jmtatsch The error from your gist is this:

/tmp/ogre1.920151016-16023-xyln3j/sinbad-ogre-55e89ae88219/RenderSystems/GL/src/OSX/OgreOSXWindow.cpp:326:19: error: assigning to 'CGError' from incompatible type 'CGLError' (aka '_CGLError')
            cgErr = CGLSetParameter(mCGLContextObj, kCGLCPSwapInterval, &swapInterval);
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/src/OSX/OgreOSXWindow.cpp.o] Error 1
make[1]: *** [RenderSystems/GL/CMakeFiles/RenderSystem_GL.dir/all] Error 2

I'd recommend asking about it on the Ogre issue tracker.

@ffurrer
Copy link

ffurrer commented Oct 19, 2015

I didn't dare to upgrade to El Capitan, yet ;)

@jmtatsch
Copy link

Seems I was a little too brave then :(
I opened a ticket upstream for my issue
https://ogre3d.atlassian.net/browse/OGRE-506

@ilidar
Copy link

ilidar commented Oct 26, 2015

@jmtatsch @wjwwood Well, what I did is simply casted return value of CGLSetParameter function to CGError at OgreOSXWindow.cpp:326, which helped me to overcome this kind of error.

cgErr = (CGError)CGLSetParameter(mCGLContextObj, kCGLCPSwapInterval, &swapInterval);

Yeap, pity, but I have built ogre1.9 now 💃

P. S.. I've used this formula https://raw.githubusercontent.com/jmtatsch/homebrew-simulation/master/ogre1.9.rb, thanks.

@pgorczak
Copy link

The CGLError issue is fixed. However, on El Capitan (10.11.2), the libc++ issue remains. Changing CMAKE_OSX_DEPLOYMENT_TARGET as suggested in another ogre issue did not work for me. The reason might be that I'm not using Xcode. As mentioned before, I had to explicitly add the -stdlib=libc++ flag.

Try as a Patch

I put the one-line patch that fixed it for me into a gist. You can brew edit ogre and add the lines

  patch do
    url "https://gist.githubusercontent.com/pgorczak/e7a23fb799623703282a/raw/340aeaec5d21f2e056405590c226d0318ebc026b/ogre_1.9_libc++.diff"
  end if build.head?

Rebuild Rviz After Patching

Still working on this. Will fill in later.

As of now, it brings back the issue with

Make Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OGRE_OV_RVIZ_LIB_OgreMain
[...]
OGRE_OV_RVIZ_LIB_OgreOverlay
[...]

Error Message for Reference (libc++/libstdc++ Issue)

Last 15 lines from /Users/philipp/Library/Logs/Homebrew/ogre/02.make:
      boost::(anonymous namespace)::thread_proxy(void*) in libboost_thread-mt.a(thread.o)
      boost::thread::join_noexcept() in libboost_thread-mt.a(thread.o)
      boost::thread::do_try_join_until_noexcept(timespec const&, bool&) in libboost_thread-mt.a(thread.o)
      boost::thread::detach() in libboost_thread-mt.a(thread.o)
      boost::thread::interrupt() in libboost_thread-mt.a(thread.o)
      boost::thread::interruption_requested() const in libboost_thread-mt.a(thread.o)
      boost::thread::native_handle() in libboost_thread-mt.a(thread.o)
      ...
  "std::bad_alloc::bad_alloc()", referenced from:
      boost::exception_ptr boost::exception_detail::get_static_exception_object<boost::exception_detail::bad_alloc_>() in libboost_thread-mt.a(thread.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests