(09-02-05) Compile Boost Library
(09-02-05) Compile Boost Library
(09-02-05) Compile Boost Library
- download source from boost website
- change to the source code directory:
cd boost_1_33_0 - export environmental variables,
export PYTHON_VERSION=2.3,export PYTHON_ROOT=/usr - build the bjam,
cd tools/build/jam_src/; ./build.sh - put bjam somewhere in the PATH and go back to the top source directory
- build bjam -sTOOLS=gcc -sBUILD=release -prefix=/home/yh/lib/boost -with-python-root=/usr/ -layout=system stage (10-07-05, on app2 add -without-wave before stage because wave library encounters compiling problem. Actually, it's being compiled forever.)
- IMPORTANT: -layout controls the naming of the resulting libraries. Default is versioned, which could cause dynamic linking problem.
~can't be replaced by /home/yh/ here. - install bjam -sTOOLS=gcc -sBUILD=release -prefix=/home/yh/lib/boost -with-python-root=/usr/ -layout=system install (10-07-05, likewise above, -without-wave is needed in some case.)
- install bgl, python binding of the graph library cd libs/graph/build/python/ (you are already in the top directory of the boost source code.
- 1st way to build bgl. bjam -sTOOLS=gcc -sBUILD=release -prefix=/home/yh/lib/boost -with-python-root=/usr/ -layout=system The resulting bgl.so has a link to libboost_python.so.1.33.0, which causes problem in parallel program.
- (10-08-05) 2nd way to build bgl. Two steps. Step 1. bjam -sTOOLS=gcc -sBUILD=release -prefix=/home/yh/lib/boost -with-python-root=/usr/ -layout=system (same as above) Step 2. g++ -shared -fPIC ../../../../bin/boost/libs/graph/build/python/bgl.so/gcc/release/shared-linkable-true/*.o ../../../../bin/boost/libs/python/build/libboost_python.a/gcc/release/libboost_python.a ../../../../bin/boost/libs/graph/build/libbgl-viz.a/gcc/release/shared-linkable-true/libbgl-viz.a -o bgl.so In this way, bgl.so contains the static boost_python and bgl-viz. No gimmicks anymore.
- go back to the boost souce top directory and copy bgl.so to somewhere you want. cp bin/boost/libs/graph/build/python/bgl.so/gcc/release/shared-linkable-true/bgl.so* /lib/boost/lib. In the 2nd way to buidl bgl. Just copy bgl.so.
- (10-07-05) symlink the right library
cd ~/lib/boost/lib;ln -s libboost_python-gcc.so libboost_python.so.1.33.0. - export ld path
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib/boost/lib: