Boost logo

Boost :

Subject: [boost] [boost-python, boost-build] building "hello" boost-python tutorial sample with python 3.2 on Archlinux
From: Roland Puntaier (roland.puntaier_at_[hidden])
Date: 2012-10-10 17:49:26


Hello!

Today I have tried boost-python tutorial with Arch Linux and Python3.2.
In case somebody else tries this, here are the problems that I've
encounter:

- I've created ~/user-config.jam with this line
    using python : 3.2 : /usr/bin/python ;

- the current boost-build of arch is 2.0_m12-3
   This still uses "print" without "(" in boost-build/tools/python.jam
   The nightly build of boost-build has it corrected:

         local full-cmd =
             $(python-cmd)" -c \"from sys import *;
print('"$(format:J=\\n)"' % ("$(exprs:J=,)"))\"" ;

- Arch has python3.2 includes in /usr/include/python3.2mu (I wonder why!)
   This is not detected by b2 / bjam.
   I worked around this by changing boost-build/tools/python.jam:

         includes ?= $(prefix)/include/python$(version)mu ;

- the sample jamroot file in the tutorial
http://www.boost.org/doc/libs/1_51_0/libs/python/example/tutorial/Jamroot
   assumes a boost root folder.
   Since boost include and lib are separate with the arch boost
installation,
   I've commented out "use-project".
   Then I had to give a direct reference to libboost_python3.so.

        diff -u Jamroot.org Jamroot
        ===========================
        --- Jamroot.org 2012-10-10 22:21:32.928426203 +0200
        +++ Jamroot 2012-10-10 22:23:15.318762363 +0200
        @@ -13,14 +13,13 @@

          # Specify the path to the Boost project. If you move this
        project,
          # adjust this path to refer to the Boost root directory.
        -use-project boost
        - : ../../../.. ;
        +#use-project boost : ../../../.. ;

          # Set up the project-wide requirements that everything uses the
          # boost_python library from the project whose global ID is
          # /boost/python.
          project
        - : requirements <library>/boost/python//boost_python ;
        + : requirements <library>/usr/lib/libboost_python3.so ;

          # Declare the three extension modules. You can specify multiple
          # source files after the colon separated by spaces.

   It would be great to have comments pointing to the right solution
   for python 3.2 and an installed boost directly in the tutorial's
sample jamroot file.

- Roland


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk