When user-config.jam has more than one version of Python configured, e.g.
using python : 2.7 : C:/Python27 ;
using python : 3.9 : C:/Python39 ;
trying to build Python (with e.g. b2 --with-python python=2.7) fails, because Boost.NumPy is built against the (correct) 2.7 version of Python, but against the 3.9 headers of NumPy:
The reason for that is that the Python configuration in b2's python.jam stores the NumPy include path in a variable .numpy-include, which can only hold one value.
This can in principle be fixed by declaring a target for NumPy's include path, instead of a variable, and then linking to it instead of using <include>$(numpy-include) in build/Jamfile.
When user-config.jam has more than one version of Python configured, e.g.
trying to build Python (with e.g.
b2 --with-python python=2.7
) fails, because Boost.NumPy is built against the (correct) 2.7 version of Python, but against the 3.9 headers of NumPy:The reason for that is that the Python configuration in b2's
python.jam
stores the NumPy include path in a variable.numpy-include
, which can only hold one value.https://github.com/boostorg/build/blob/916afd3876bc0d5b706a63f9d09ba66ff69e7d66/src/tools/python.jam#L1087-L1090 https://github.com/boostorg/build/blob/916afd3876bc0d5b706a63f9d09ba66ff69e7d66/src/tools/python.jam#L858
This can in principle be fixed by declaring a target for NumPy's include path, instead of a variable, and then linking to it instead of using
<include>$(numpy-include)
in build/Jamfile.https://github.com/boostorg/python/blob/2a82afdf6d30c28eb1775f3b8041d988f6f04598/build/Jamfile#L120