[solved] Compile Error: Failed to link pygranoo.so

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[solved] Compile Error: Failed to link pygranoo.so

tstucky
This post was updated on .
I am building GranOO 2.0 (revision: 1904) on macOS High Sierra 10.13.6. I get the following message when the Makefile attempts linking pygranoo.so:

[ 84%] Linking CXX shared library pygranoo.so
ld: warning: text-based stub file /System/Library/Frameworks//OpenGL.framework/OpenGL.tbd and library file /System/Library/Frameworks//OpenGL.framework/OpenGL are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//OpenGL.framework/OpenGL.tbd and library file /System/Library/Frameworks//OpenGL.framework/OpenGL are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.tbd and library file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.tbd and library file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib are out of sync. Falling back to library file for linking.
Undefined symbols for architecture x86_64:
  "boost::python::detail::init_module(PyModuleDef&, void (*)())", referenced from:
      _PyInit_pygranoo in All.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Binding/Python/pygranoo.so] Error 1
make[1]: *** [Binding/Python/CMakeFiles/pygranoo.dir/all] Error 2
make: *** [all] Error 2

I should mention that I only have sudo on this machine for MacPorts, and not Homebrew, so I attempted to install the dependencies using MacPorts and that may be the cause of this problem. If it is a dependency causing the problem, does anybody have a guess which one it might be?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Compile Error: Failed to link pygranoo.so

Cédric Hubert
Administrator
I’m not sure, but could you make sure you are actually linking against Python 2, and not Python 3 ?

You may have to force CMake to find version 2 instead of 3.
You can review the paths found by CMake by issuing ccmake instead of just cmake, then hit the T key to show advanced parameters.
Reply | Threaded
Open this post in threaded view
|

Re: Compile Error: Failed to link pygranoo.so

tstucky
That was indeed the problem. I changed PYTHON_EXECUTABLE, PYTHON_INCLUDE_DIR, PYTHON_LIBRARY to the proper 2.7 version in the CMakeCache.txt file, reran cmake, then make && make install, and the error was gone. Thank you!