# Check boost.python building with Python 3

XMLWordPrintable

#### Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Story Points:
0.5
• Team:
Architecture

#### Description

We may want to disable boost.python in the build. There are hints that there are problems with python3.5.

#### Activity

Hide
Tim Jenness added a comment -

Boost.python was failing to build because it could not find the python include files (Boost did not seem to understand the python3.5m scheme). For now on the branch boost.python has been disabled in the build.

Show
Tim Jenness added a comment - Boost.python was failing to build because it could not find the python include files (Boost did not seem to understand the python3.5m scheme). For now on the branch boost.python has been disabled in the build.
Hide
Tim Jenness added a comment -

Turns out that Galsim requires boost.python...

Show
Tim Jenness added a comment - Turns out that Galsim requires boost.python...
Hide
Tim Jenness added a comment -

I have looked further into this issue and it seems that boost configuration scripts do not understand PEP-3149 and builds the include path with:

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

This does not take into account architecture modifiers such as "m" indicating that Python was built with its internal malloc. The include path on Python 3 from Anaconda is include/python3.5m and this prevents the build of boost.python.

The fix is to modify the generated project-config.jam file to add the include path explicitly. The using python directive takes a 3rd argument of an explicit include path that is not included by default. I now modify the jam file in the eupspkg.cfg.sh file after the configuration step to add the include path that I obtain from python itself. The change only triggers for python 3.

Show
Tim Jenness added a comment - I have looked further into this issue and it seems that boost configuration scripts do not understand PEP-3149 and builds the include path with: includes ?= $(prefix)/include/python$(version) ; This does not take into account architecture modifiers such as "m" indicating that Python was built with its internal malloc. The include path on Python 3 from Anaconda is include/python3.5m and this prevents the build of boost.python. The fix is to modify the generated project-config.jam file to add the include path explicitly. The using python directive takes a 3rd argument of an explicit include path that is not included by default. I now modify the jam file in the eupspkg.cfg.sh file after the configuration step to add the include path that I obtain from python itself. The change only triggers for python 3.
Hide
Tim Jenness added a comment -

Please review. Currently I use perl to do the inplace fix up of the file. I don't do anything on python 2.

Show
Tim Jenness added a comment - Please review. Currently I use perl to do the inplace fix up of the file. I don't do anything on python 2.
Hide
Kian-Tat Lim added a comment -

One suggested change, otherwise OK.

Show
Kian-Tat Lim added a comment - One suggested change, otherwise OK.
Hide
Tim Jenness added a comment -

Suggested changes applied and now merged.

Show
Tim Jenness added a comment - Suggested changes applied and now merged.

#### People

Assignee:
Tim Jenness
Reporter:
Tim Jenness
Reviewers:
Kian-Tat Lim
Watchers:
J Matt Peterson [X] (Inactive), Kian-Tat Lim, Paul Price, Tim Jenness