Personal tools
You are here: Home log log_05 (09-02-05) Compile Boost Library
Navigation
Log in


Forgot your password?
 
Document Actions

(09-02-05) Compile Boost Library

(09-02-05) Compile Boost Library

(09-02-05) Compile Boost Library

  1. download source from boost website
  2. change to the source code directory: cd boost_1_33_0
  3. export environmental variables, export PYTHON_VERSION=2.3, export PYTHON_ROOT=/usr
  4. build the bjam, cd tools/build/jam_src/; ./build.sh
  5. put bjam somewhere in the PATH and go back to the top source directory
  6. 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.)
  7. 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.
  8. 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.)
  9. 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.
  10. 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.
  11. (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.
  12. 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.
  13. (10-07-05) symlink the right library cd ~/lib/boost/lib;ln -s libboost_python-gcc.so libboost_python.so.1.33.0.
  14. export ld path export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib/boost/lib:

Yu Huang 2006-03-25
« November 2009 »
Su Mo Tu We Th Fr Sa
1234567
891011121314
15161718192021
22232425262728
2930
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: