Build boost 1.38 with python 3.0 and ICU via VC++ 2008

Start “Visual Studio 2008 Command Prompt”,

go to boost source folder and run following command:

D:\src\boost\boost_1_38_0>..\bjam.exe –toolset=msvc stage –build-type=complete

After building the folder size is 6.53GB. Size of D:\src\boost\boost_1_38_0\bin.v2 is 3.25GB, can be deleted.

boost.python is not compatible with Python30. I following a post from Martin Walser to instruct bjam using python30 by adding something to  boost_1_38_0\tools\build\v2\user-config.jam

using python
    : 3.0                         # Version
    : C:\\Python30\\python.exe    # Python Path
    : C:\\Python30\\Include        # include path(s) -they may be not really needed here
      : C:\\Python30\\libs        # lib path(s) – they may be not really needed here
      : <python-debugging>on <define>BOOST_ALL_NO_LIB=1
    ;

But it turned out a lot of type is missing in python30, like PyString_Type.

There is someone working on python30 support: Some thoughts on py3k support.

build boost with python and ICU

ECHOE change code page to 1252
chcp 1252
rem chcp 1252 can’t remove the warning about code page problem
call "%VS90COMNTOOLS%\..\..\vc\bin\vcvars32.bat"
SET PYTHON_ROOT=C:\Python30
SET PYTHON_VERSION=3.0
SET ICU_PATH=D:\opensource\icu4c-3_8_1\icu
cd /d D:\opensource\boost\boost_1_38_0
D:\opensource\boost\bjam.exe  –toolset=msvc stage –build-type=complete
rem …updated 3022 targets…
rem build start at 17:52
rem build completed at 20:49
rem size of boost_1_38_0 is 6.59 (size) ~ 6.67 GB (size on disk)
rem size of boost_1_38_0\bin.v2 is 3.28 GB

rem build python sample
D:\opensource\boost\boost_1_38_0\libs\python\example\quickstart>d:\opensource\boost\bjam.exe "threading=multi"

rem run the python sample
D:\opensource\boost\boost_1_38_0\libs\python\example\quickstart\bin\msvc-9.0\debug\threading-multi\embedding.exe D:\opensource\boost\boost_1_38_0\libs\python\example\quickstart\script.py

This entry was posted in Open Source. Bookmark the permalink.

Leave a comment