简体   繁体   中英

Command “/usr/bin/clang++ -bundle -undefined…” failed with exit status 1

I'm trying to build a library "cmappertools" referencing to c++ "boost" in os x maverick, and hit the error below. I'm very new to both python and c++ boost, and can't even tell where to start looking: the "Missing compiler_cxx fix for UnixCCompiler" error didn't seem pointing me to anywhere. Any idea, please?

checking for exit in -lboost_thread-mt... yes
checking whether the Boost::Chrono library is available... yes
checking for exit in -lboost_chrono-mt... yes
checking whether C++ compiler accepts -fvisibility=hidden... yes
checking whether C++ compiler accepts -fno-common... yes
checking whether C++ compiler accepts -fvisibility-inlines-hidden... yes

...

building extension "cmappertools" sources
build_src: building npy-pkg config files
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize UnixCCompiler
**#### ['/usr/bin/clang', '-fno-strict-aliasing', '-fno-common', '-dynamic', '-arch', 'i386', '-arch', 'x86_64', '-g', '-DNDEBUG', '-g', '-fwrapv', '-O3', '-Wall', '-Wstrict-prototypes'] #######
Missing compiler_cxx fix for UnixCCompiler**
customize UnixCCompiler using build_ext
building 'cmappertools' extension
compiling C++ sources
C compiler: /usr/bin/clang++ -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -    DNDEBUG -g -fwrapv -O3 -Wall

compile options: '-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-    packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
extra options: '-pthread -I/usr/local/include -fvisibility=hidden -fno-common -fvisibility-inlines-    hidden -ffunction-sections -fdata-sections'
clang++: cmappertools.cpp
/usr/bin/clang++ -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/cmappertools.o -o build/lib.macosx-10.6-intel-2.7/cmappertools.so -L/usr/local/lib -    lboost_thread-mt -lboost_chrono-mt -Wl,-s
ld: warning: option -s is obsolete and being ignored
ld: warning: ignoring file /usr/local/lib/libboost_thread-mt.dylib, file was built for x86_64 which         is not the architecture being linked (i386): /usr/local/lib/libboost_thread-mt.dylib
ld: warning: ignoring file /usr/local/lib/libboost_chrono-mt.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libboost_chrono-mt.dylib
ld: internal error: atom not found in     symbolIndex(__ZN5boost16exception_detail20copy_boost_exceptionEPNS_9exceptionEPKS1_) for architecture     i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: warning: option -s is obsolete and being ignored
ld: warning: ignoring file /usr/local/lib/libboost_thread-mt.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libboost_thread-mt.dylib
ld: warning: ignoring file /usr/local/lib/libboost_chrono-mt.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libboost_chrono-mt.dylib
ld: internal error: atom not found in     symbolIndex(__ZN5boost16exception_detail20copy_boost_exceptionEPNS_9exceptionEPKS1_) for architecture     i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Command "/usr/bin/clang++ -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g     build/temp.macosx-10.6-intel-2.7/cmappertools.o -o build/lib.macosx-10.6-intel-2.7/cmappertools.so -L/usr/local/lib -lboost_thread-mt -lboost_chrono-mt -Wl,-s" failed with exit status 1

You need to compile boost in combined 32/64 bit - it's only compiled for 64bit mode.

If you installed boost via brew , you should have added the --universal option to the install command.

If you were manually building boost, you should have added the options:

address-model=32_64 architecture=x86

to the b2 compile line. This will cause it to be built in 32 & 64 bit, which should support your python build.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM