Boost logo

Boost-Build :

Subject: [Boost-build] Using python.jam with multiple Python versions
From: Anthony Foglia (AFoglia_at_[hidden])
Date: 2009-12-10 09:51:14


        Is there a way to using python.jam to configure multiple versions of
Python? We are slowly upgrading our computers from Python 2.5 to Python
2.6. It's a full OS upgrade so a computer only has one version installed.

        Our current 2.5-only configuration is:

--- Jamroot

# sysdefs.jam is a file in the same directory as Jamroot with
# configuration settings

import ./sysdefs ;

using python
    : 2.5
    ;

--- sysdefs.jam

    python-include-dir = /usr/include/python2.5/ ;
    numpy-include-dir =
/usr/lib/python2.5/site-packages/numpy/core/include/numpy/ ;

alias python-include-base : : :
    : <include>$(python-include-dir) ;

# Numpy headers
alias numpy #FOR: Numpy
    : # no sources
    : # no build requirements
    : # no default build
    : <include>$(numpy-include-dir)
    ;

--- Jamfile (for the python extension)

python-extension compiledstats
    : compiledstats.cpp
      /sysdefs//numpy
      /sysdefs//boost-python
      /proj-libs/utilities
    ;

----
	For 2.6, I need to not only change the version number, but the location 
of the numpy headers (now in dist-packages, not site-packages).
	Can python.jam handle multiple versions?  Is there a more 
boost-build-esque way of doing this than a bunch of "ifs" and testing 
for file existence?
-- 
Anthony Foglia
Princeton Consultants
(609) 987-8787 x233

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