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

CMake for Mac OSX using Homebrew #24

Open
wants to merge 15 commits into
base: devel
Choose a base branch
from
Open

CMake for Mac OSX using Homebrew #24

wants to merge 15 commits into from

Conversation

smcgill3
Copy link

@smcgill3 smcgill3 commented Apr 9, 2013

This commit fixes OctoVis linking errors on a Mac OSX system using Homebrew for package management. Previously, the QGLViewer framework was not used, but an invalid -lQGLViewer flag.

@ahornung
Copy link
Member

ahornung commented Apr 9, 2013

I need some feedback from other Mac users before merging this in. Will this still work with QGLViewer compiled from source, or installed through Macports (if that's relevant at all)?

@smcgill3
Copy link
Author

I checked out this website:
http://www.libqglviewer.com/installUnix.html
which indicates the default behavior on OSX is:
"A Framework is created by default. Uncomment a line in QGLViewer.pro if you want to create a .dylib instead."

This framework must be linked appropriately, and I believe Homebrew gives an idea in "brew info libqglviewer":
To avoid issues with runtime linking and facilitate usage of the library:
sudo ln -s "/usr/local/Cellar/libqglviewer/2.3.17/QGLViewer.framework" "/Library/Frameworks/QGLViewer.framework"

Thus, having a libQGLViewer installed from source, without Homebrew, should work. I have not tested, however, but I may this week, if needed.

@ahornung
Copy link
Member

Yes, it would be good if you (or anyone else on OSX) could test of it still works with a source installation, particularly the source version of QGLViewer supplied in src/extern.

@balzer82
Copy link

I wanna use Octomaps under MacOSX and have the same issue (Test 14/14 test_color_tree is failing) with actual git clone, but I used

sudo port install

for the process. What exactly should I test? (no deep understanding from my side, sorry)

@ahornung
Copy link
Member

@balzer82: Following your tutorial on YouTube, it seems like compiling the latest release of OctoMap works nice using MacPorts. Could you test if the osx branch by @smcgill3 also works with MacPorts?
https://github.com/smcgill3/octomap/tree/osx

git clone git://github.com/smcgill3/octomap.git
cd octomap
git checkout osx
mkdir build
... compile...

For the unit test failing, please use Issue #25

@balzer82
Copy link

Checkout, cmake .. and make works until:

[ 58%] Building CXX object octovis/CMakeFiles/octovis-shared.dir/src/ColorOcTreeDrawer.cpp.o
Linking CXX shared library ../../lib/liboctovis.dylib
ld: framework not found QGLViewer
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../lib/liboctovis.dylib] Error 1
make[1]: *** [octovis/CMakeFiles/octovis-shared.dir/all] Error 2
make: *** [all] Error 2

@isherman
Copy link

I'm on OS X 10.8.4, building QGLViewer from the source provided in octovis/src/extern.
This fork didn't compile for me without manual intervention.

The QGLViewer packaged with octovis installs by default in ~/Library/Frameworks.

OS X will only look for frameworks in /Library/Frameworks and /System/Library/Frameworks unless you provide a path at link time.

In order to compile successfully from this fork I had to sudo ln -s ~/Library/Frameworks/QGLViewer.framework /Library/Frameworks/QGLViewer.framework.

Assuming the right way to solve this is to modify CMakeLists.txt to provide an explicit path to ~/Library/Frameworks to the linker? Alternatively we could fork QGLViewer to install to /Library/Frameworks.

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

Successfully merging this pull request may close these issues.

None yet

4 participants