简体   繁体   中英

Build and install Boost 1.60 in 32 bit on a 64 bit Mac OS X El Capitan

I have an application that use the 32 bit boost library( 1.48 ). The 1.48 version of boost was pre built on 32 bit platform and uses older C++ standards. For example file libboost_wserialization.dylib gives
libboost_wserialization.dylib: Mach-O universal binary with 2 architectures libboost_wserialization.dylib (for architecture i386): Mach-O dynamically linked shared library i386 libboost_wserialization.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64

The requirements have changed and i want to link/use the boost 1.60 with C++ 11 and 32 bit. I have downloaded the 1.60 boost and modified the bootstrap.sh to include application specific lib and include directories.

I am running the following command

./b2 cxxflags="-std=c++0x -stdlib=libc++" linkflags="-stdlib=libc++" address-model=32 architecture=x86 install

I get the following error error: unknown target CPU 'i686' for all the files. If i install the default then I don get the 32 bit version of the boost libraries and application fails to link.

How do i get rid of this error ?. The machine that i am building boost on is Mac OS X El capitan 64 bit.

The entire error is

 "clang++" -x c++ -std=c++0x -stdlib=libc++ -O3 -O3 -Wno-inline -Wall -march=i686 -DBOOST_ALL_NO_LIB=1 -DBOOST_MATH_TR1_DYN_LINK=1 -DNDEBUG -I"." -I"libs/math/src/tr1" -c -o "bin.v2/libs/math/build/clang-darwin-4.2.1/release/address-model-32/threading-multi/atanh.o" "libs/math/build/../src/tr1/atanh.cpp"

...failed clang-darwin.compile.c++ bin.v2/libs/math/build/clang-darwin-4.2.1/release/address-model-32/threading-multi/atanh.o... clang-darwin.compile.c++ bin.v2/libs/math/build/clang-darwin-4.2.1/release/address-model-32/threading-multi/cbrt.o error: unknown target CPU 'i686'

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