Boost logo

Boost-Build :

From: sashan (sashang_at_[hidden])
Date: 2004-08-24 15:36:16


I'd like to build Boost.Python on FreeBSD4.9. Initially doing a pkg_add
for boost revealed that the python library (libboost_python) does not
come with the package. So I decided to build form sources. I've set my
PYTHON_ROOT and PYTHON_VERSION variables like this:

essendon# setenv PYTHON_VERSION 2.3
essendon# setenv PYTHON_ROOT /usr/local

I've upgraded my compiler from 2.95 by installing gcc3.2.3 using pkg_add:

pkg_add -v -p /usr gcc-3.2.3.tgz

This places executables gcc32 and g++32 into /usr/bin.

I've built bjam from sources like this:

./build.sh

Next I change directory to /usr/tmp/boost-1.30.2 where I've extracted
the boost code and run bjam.

essendon# ../boost-jam-3.1.10/bin.freebsd/bjam "-sTOOLS=gcc"
"-sGCC=gcc32" "-sGXX=g++32"

This doesn't work as expected and produces the following output:

...found 3380 targets...
...updating 496 targets...
gcc-C++-action
libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/numeric.o
In file included from
/usr/tmp/boost-1.30.2/boost/python/converter/arg_to_python.hpp:18,
from /usr/tmp/boost-1.30.2/boost/python/call.hpp:14,
from
/usr/tmp/boost-1.30.2/boost/python/object_core.hpp:14,
from /usr/tmp/boost-1.30.2/boost/python/object.hpp:9,
from /usr/tmp/boost-1.30.2/boost/python/tuple.hpp:9,
from /usr/tmp/boost-1.30.2/boost/python/numeric.hpp:9,
from libs/python/build/../src/numeric.cpp:7:
/usr/tmp/boost-1.30.2/boost/python/converter/builtin_converters.hpp:106:
syntax error before `&'
/usr/tmp/boost-1.30.2/boost/python/converter/builtin_converters.hpp:106:
syntax error before `const'
g++ -c -Wall -ftemplate-depth-100 -DBOOST_PYTHON_DYNAMIC_LIB
-DBOOST_PYTHON_SOURCE -g -O0 -fno-inline -fPIC -I"libs/python/build"
-I "/usr/local/include/python2.3" -I "/usr/tmp/boost-1.30.2" -o
"libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/numeric.o"
"libs/python/build/../src/numeric.cpp"

Basically where it says "g++ -c -Wall -ftemplate-depth-100... " I expect
it to be using g++32 as dictated by -sGXX=g++32. In this case the g++
refered to is version 2.95.4 which comes with FreeBSD 4.9 release.

So I follow the work around here
http://www.mail-archive.com/boost@lists.boost.org/msg11162.html and
comment the lines mentioned.

Then trying the same command:
essendon# ../boost-jam-3.1.10/bin.freebsd/bjam "-sTOOLS=gcc"
"-sGCC=gcc32" "-sGXX=g++32"

gives the following output:

gcc-C++-action
libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/numeric.o
In file included from
/usr/lib/gcc-lib/i386-portbld-freebsd4.9/3.2.3/include/g++-v3/bits/locale_facets.tcc:41,
from
/usr/lib/gcc-lib/i386-portbld-freebsd4.9/3.2.3/include/g++-v3/locale:46,
from
/usr/lib/gcc-lib/i386-portbld-freebsd4.9/3.2.3/include/g++-v3/bits/ostream.tcc:37,
from
/usr/lib/gcc-lib/i386-portbld-freebsd4.9/3.2.3/include/g++-v3/ostream:275,
from
/usr/lib/gcc-lib/i386-portbld-freebsd4.9/3.2.3/include/g++-v3/iterator:70,
from /usr/tmp/boost-1.30.2/boost/iterator.hpp:18,
from /usr/tmp/boost-1.30.2/boost/operators.hpp:80,
from /usr/tmp/boost-1.30.2/boost/python/type_id.hpp:12,
from
/usr/tmp/boost-1.30.2/boost/python/instance_holder.hpp:11,
from
/usr/tmp/boost-1.30.2/boost/python/object/pointer_holder.hpp:14,
from
/usr/tmp/boost-1.30.2/boost/python/to_python_indirect.hpp:10,
from
/usr/tmp/boost-1.30.2/boost/python/converter/arg_to_python.hpp:11,
from /usr/tmp/boost-1.30.2/boost/python/call.hpp:14,
from
/usr/tmp/boost-1.30.2/boost/python/object_core.hpp:14,
from /usr/tmp/boost-1.30.2/boost/python/object.hpp:9,
from /usr/tmp/boost-1.30.2/boost/python/tuple.hpp:9,
from /usr/tmp/boost-1.30.2/boost/python/numeric.hpp:9,
from libs/python/src/numeric.cpp:7:
/usr/lib/gcc-lib/i386-portbld-freebsd4.9/3.2.3/include/g++-v3/cmath: In
function `float std::acos(float)':
/usr/lib/gcc-lib/i386-portbld-freebsd4.9/3.2.3/include/g++-v3/cmath:99: `::
acosf' undeclared (first use here)
etc....................

For what it's worth I don't have any problems on Linux (Gentoo) building
Boost.Python from sources or using the version of Boost that you can
emerge from portage.

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk