Boost logo

Boost Users :

Subject: [Boost-users] Cross-compile Boost, python include path problem
From: raoul (raoul.hecky_at_[hidden])
Date: 2008-10-03 08:22:29


Hi everyone,

I'm trying to cross compile boost 1.36, and having an issue regarding
boost.python compilation. In fact the cross compile is getting right. I'm
using this script to cross compile boost:

echo "using gcc : i686 : $CC ;" > tools/build/v2/user-config.jam
cd tools/jam/src
./build.sh
cp bin.*/bjam $BASE_DIR/toolchain/$TOOLCHAIN_VER/$TOOLCHAIN/bin/
cd ../../../

bjam -d2 --toolset=gcc-i686 --prefix=${ROOTFS_DIR}/usr --with-python install

Boost.python compiles right, but when I want to link to the created library
(libboost_python...) it failes with some strange errors:

libboost_python-gcc-mt-1_36.so: undefined reference to
`PyUnicodeUCS4_FromEncodedObject'
libboost_python-gcc-mt-1_36.so: undefined reference to
`PyUnicodeUCS4_AsWideChar'

I googled a bit, and it seems that this problem is because libboost_python was
not compiled with the same python version than the one I've corsscompiled
with.

And this is the problem. When reading the boost compilation log:
"i686-unknown-linux-gnu-gcc" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -fPIC -pthread -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DNDEBUG -I"." -I"/usr/include/python2.5" -c -o "bin.v2/libs/python/build/gcc-calaos/release/threading-multi/dict.o" "libs/python/src/dict.cpp"

bjam is using the host include path for python (the -I/usr/include/python2.5
option), and this is wrong. How can I force bjam to use
${ROOTFS_DIR}/usr/include/python2.5 for python include path, instead of the
one of my host system?

I don't know how boost is checking and detecting python cflags. Using
python-config? Is there a way to tell bjam to use
${ROOTFS_DIR}/usr/bin/python-config?

Thanks,

-- 
------------------------
Raoul Hecky

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net