You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm trying to build for MacOS using homebrew to install swig. I get through the unit tests, but make install fails because a bunch of python symbols are not found:
[ 83%] Linking CXX shared module _Custom.so
cd /Users/scott/Documents/Code/git/KMCLib/c++/build/wrap && /usr/local/Cellar/cmake/3.6.2/bin/cmake -E cmake_link_script CMakeFiles/_Custom.dir/link.txt --verbose=1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -O3 -fPIC -Wall -Wextra -Werror -pedantic -stdlib=libc++ -std=c++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -bundle -Wl,-headerpad_max_install_names -o _Custom.so CMakeFiles/_Custom.dir/customPYTHON_wrap.cxx.o -framework python ../custom/libcustom.a ../src/libsrc.a
Undefined symbols for architecture x86_64:
"_PyInstanceMethod_New", referenced from:
SWIG_PyInstanceMethod_New(_object*, _object*) in customPYTHON_wrap.cxx.o
"_PyModule_Create2", referenced from:
_PyInit__Custom in customPYTHON_wrap.cxx.o
"_PyUnicode_Concat", referenced from:
SwigPyObject_repr(SwigPyObject*) in customPYTHON_wrap.cxx.o
"_PyUnicode_DecodeUTF8", referenced from:
SWIG_From_std_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in customPYTHON_wrap.cxx.o
"_PyUnicode_FromFormat", referenced from:
SwigPyObject_repr(SwigPyObject*) in customPYTHON_wrap.cxx.o
SwigPyPacked_repr(SwigPyPacked*) in customPYTHON_wrap.cxx.o
SwigPyPacked_str(SwigPyPacked*) in customPYTHON_wrap.cxx.o
"_PyUnicode_FromString", referenced from:
SWIG_Python_GetSwigThis(_object*) in customPYTHON_wrap.cxx.o
SWIG_Python_NewPointerObj(_object*, void*, swig_type_info*, int) in customPYTHON_wrap.cxx.o
SWIG_Python_DestroyModule(_object*) in customPYTHON_wrap.cxx.o
SwigPyPacked_str(SwigPyPacked*) in customPYTHON_wrap.cxx.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]: *** [wrap/_Custom.so] Error 1
make[1]: *** [wrap/CMakeFiles/_Custom.dir/all] Error 2
make: *** [all] Error 2
I installed swig using homebrew and not macports, and I wonder if something is missing?
The text was updated successfully, but these errors were encountered:
I resolved my own issue. The problem was the python library location, which was set to the system python library and I was using a homebrew-installed python library.
After running cmake, I used ccmake to set the library to the proper path before running make.
I built it successfully on ubuntu with Python.h(python3) included when building, so it may still be the problem of your python include or library path.
By the way, according to my knowledge about KMCLib, the python front end interfaces are written in Python2.x without compatibility with python 3, so it's better to use it with python2.7 only I think :)
Hi, I'm trying to build for MacOS using homebrew to install swig. I get through the unit tests, but make install fails because a bunch of python symbols are not found:
I installed swig using homebrew and not macports, and I wonder if something is missing?
The text was updated successfully, but these errors were encountered: