Skip to content

Instantly share code, notes, and snippets.

@AzothAmmo
Last active August 29, 2015 14:00
Show Gist options
  • Save AzothAmmo/5d2300a9a65bc1267c84 to your computer and use it in GitHub Desktop.
Save AzothAmmo/5d2300a9a65bc1267c84 to your computer and use it in GitHub Desktop.
Boost compilation under various compilers
Notes on compiling boost for other architectures
32 bit gcc
./b2 --with-serialization --with-test address-model=32 cflags=-m32 cxxflags="-m32 -std=c++11" architecture=x86 instruction-set=i686 -a
64 bit gcc
./b2 --with-serialization --with-test -a cxxflags="-std=c++11"
32 bit clang
./b2 --with-serialization --with-test address-model=32 architecture=x86 instruction-set=i686 toolset=clang cxxflags="-std=c++11 -stdlib=libc++ -m32" -a
64 bit clang
./b2 toolset=clang cxxflags="-stdlib=libc++ -std=c++11" linkflags="-stdlib=libc++" --with-serialization --with-test -a
@AzothAmmo
Copy link
Author

To then link against these, use the rpath compiler argument.

@AzothAmmo
Copy link
Author

e.g.:

CXX=clang++ CXXFLAGS="-stdlib=libc++" LDFLAGS="-L/home/shane/workspace/boost/clang_64 -Wl,-rpath=/home/shane/workspace/boost/clang_64" cmake ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment