Skip to content

Fixes to allow Boost to build with Python 3#3293

Merged
adamjstewart merged 2 commits intospack:developfrom
adamjstewart:fixes/boost-python3
Mar 3, 2017
Merged

Fixes to allow Boost to build with Python 3#3293
adamjstewart merged 2 commits intospack:developfrom
adamjstewart:fixes/boost-python3

Conversation

@adamjstewart
Copy link
Copy Markdown
Member

@adamjstewart adamjstewart commented Mar 1, 2017

Fixes #3274.

Needs to be tested with Python 2.
Tested with:

Both builds succeed now!

patch('boost_11856.patch', when='@1.60.0%[email protected]')

# Patch fix from https://svn.boost.org/trac/boost/ticket/11120
patch('python_jam.patch')
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally I would have specified an exact version range for which this patch works. However, either the Boost tarball is very large or my internet connection is slow today, so it took too long to download every version.

}
}
+ # Try to get python abiflags
+ full-cmd = $(python-cmd)" -c \"from sys import abiflags; print(abiflags, end='')\"" ;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this print syntax will work in Python 2.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't work. But the following will:

        full-cmd = $(python-cmd)" -c \"from __future__ import print_function; from sys import abiflags; print(abiflags, end='')\"" ;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that the patch doesn't work for Python 2. I decided it would be easier/safer to only apply the patch when we are building with Python 3. Now both the Python 2 and 3 builds of Boost work for me!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking that python2 build still works.

if '+python' in spec:
options.append('--with-python=%s' %
join_path(spec['python'].prefix.bin, 'python'))
options.append('--with-python=%s' % python_exe)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The executable in Python 3 is python3, not python. Better to let the python package handle this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be like the way MPI packages export stuff?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. I need to use the same functionality in #3210 too, so it's a common need.

@adamjstewart adamjstewart changed the title [WIP] Fixes to allow Boost to build with Python 3 Fixes to allow Boost to build with Python 3 Mar 1, 2017
@adamjstewart adamjstewart merged commit 7fcd414 into spack:develop Mar 3, 2017
@adamjstewart adamjstewart deleted the fixes/boost-python3 branch March 24, 2017 22:09
diaena pushed a commit to diaena/spack that referenced this pull request May 26, 2017
* Fixes to allow Boost to build with Python 3

* Restrict patch to Python 3 only
xavierandrade pushed a commit to xavierandrade/spack that referenced this pull request Jun 16, 2017
* Fixes to allow Boost to build with Python 3

* Restrict patch to Python 3 only
EmreAtes pushed a commit to EmreAtes/spack that referenced this pull request Jul 10, 2017
* Fixes to allow Boost to build with Python 3

* Restrict patch to Python 3 only
amklinv pushed a commit that referenced this pull request Jul 17, 2017
* Fixes to allow Boost to build with Python 3

* Restrict patch to Python 3 only
healther pushed a commit to electronicvisions/spack that referenced this pull request Jul 26, 2017
* Fixes to allow Boost to build with Python 3

* Restrict patch to Python 3 only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants