Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 631590

Summary: dev-libs/boost-1.65.0: library boost_numpy is not built
Product: Gentoo Linux Reporter: Quentin Minster <quentin>
Component: Current packagesAssignee: David Seifert <soap>
Status: RESOLVED OBSOLETE    
Severity: normal CC: cpp+disabled, jstein, polynomial-c, tb
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 630252    
Attachments: boost-1.65.0-fix-python-numpy.patch
boost-1.65.0.ebuild.patch

Description Quentin Minster 2017-09-20 22:05:39 UTC
Created attachment 495704 [details, diff]
boost-1.65.0-fix-python-numpy.patch

In the Boost library, Boost::Python can be built with support for Numpy (in boost::python::numpy), which produces the libboost_numpy library.
However in Gentoo this is not the case, as the building of boost_numpy is removed by patch boost-1.65.0-fix-python.patch (or boost-1.63.0-fix-python.patch).

Since Boost in version 1.65.0 dropped boost::python::numeric in favor of boost::python::numpy, it would be nice if Gentoo's Boost ebuild could build the boost_numpy library.

Attached is a first patch for =dev-libs/boost-1.65.0 that works towards this, but does not get there quite yet: it produces two boost_numpy libraries, one for Python2 and one for Python3.
It should be modified to generate one version per Python target before it makes it into the tree.

The second patch is to the ebuild itself, to add a 'numpy' USE flag with a dependency on dev-python/numpy and conditional application of the first patch.
Comment 1 Quentin Minster 2017-09-20 22:06:16 UTC
Created attachment 495708 [details, diff]
boost-1.65.0.ebuild.patch
Comment 2 Mark J. Olah 2018-01-20 20:56:09 UTC
This remains a problem.  Any programs using boost::python::numpy cannot link correctly.  And the dev-libs/boost-numpy project is dormant now that it has merged with the boost mainline.

I can confirm the patches provided do indeed allow libboost_mpi-2.so and libboost_mpi-3.so to be built.  It appears that libboost_mpi-3.so will be built against the current eselect python version (python-3.5 on my system).

It is also not clear without further expertise in the gentoo boost ebuild system to see how to fix the deficiencies in the supplied patch.  It seems the boost-*-fix-python.patch just removes the numpy configuration wholesale, which is not really an acceptable solution.
Comment 3 David Seifert gentoo-dev 2018-01-20 21:03:08 UTC
(In reply to Quentin Minster from comment #0)
> Created attachment 495704 [details, diff] [details, diff]
> boost-1.65.0-fix-python-numpy.patch
> 
> In the Boost library, Boost::Python can be built with support for Numpy (in
> boost::python::numpy), which produces the libboost_numpy library.
> However in Gentoo this is not the case, as the building of boost_numpy is
> removed by patch boost-1.65.0-fix-python.patch (or
> boost-1.63.0-fix-python.patch).
> 
> Since Boost in version 1.65.0 dropped boost::python::numeric in favor of
> boost::python::numpy, it would be nice if Gentoo's Boost ebuild could build
> the boost_numpy library.
> 
> Attached is a first patch for =dev-libs/boost-1.65.0 that works towards
> this, but does not get there quite yet: it produces two boost_numpy
> libraries, one for Python2 and one for Python3.
> It should be modified to generate one version per Python target before it
> makes it into the tree.
> 
> The second patch is to the ebuild itself, to add a 'numpy' USE flag with a
> dependency on dev-python/numpy and conditional application of the first
> patch.

I've been this far as well - unfortunately, this solution is pretty much useless, as it will cause an explosion in revdeps downstream. I have tried for 12 hours without succeeding. I have spoken to upstream boost, with no success really, given that they don't even get why we would be building against multiple impls ("lolz, one py2 and py3 surely should suffice").
Comment 4 rnddim 2018-09-26 22:47:35 UTC
This problem is affecting me as well, and I need it in order to compile luxcore (not in the tree). Without knowing anything about it yet, would it not be possible to just delete the part of the "fix" python patch that junks numpy?
Comment 5 Larry the Git Cow gentoo-dev 2019-04-14 23:41:11 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0c52eca5a522be8bf5c43d2f4da043553dbf36ce

commit 0c52eca5a522be8bf5c43d2f4da043553dbf36ce
Author:     David Seifert <soap@gentoo.org>
AuthorDate: 2019-04-14 23:40:42 +0000
Commit:     David Seifert <soap@gentoo.org>
CommitDate: 2019-04-14 23:40:42 +0000

    dev-libs/boost: Version bump to 1.70.0
    
    * bzip2/lzma/zlib/zstd support can now be
      disabled via USE flags explicitly.
    * Upstream has fixed Boost.Python to finally
      support building against multiple Python 3
      implementations concurrently:
    
        https://github.com/boostorg/python/commit/d4d41d94aecc
    
      Going forward, Gentoo will stop modifying
      the upstream build system for its multiple
      implementations. This will lead to some
      short-term pain, as the library pattern changes
      from
    
        libboost_python-3.6.so
    
      to
    
        libboost_python36.so
    
      which is the canonical name used by upstream.
      Changing this name should be avoided, as the
      filename is also encoded as a macro in various
      boost headers.
    
    Bug: https://bugs.gentoo.org/631590
    Closes: https://bugs.gentoo.org/653878
    Closes: https://github.com/gentoo/gentoo/pull/11659
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: David Seifert <soap@gentoo.org>

 dev-libs/boost/Manifest                            |   1 +
 dev-libs/boost/boost-1.70.0.ebuild                 | 327 +++++++++++++++++++++
 .../boost/files/boost-1.69.0-context-x32.patch     |  38 +++
 ...-1.70.0-fix-python-cmake-duplicate-target.patch |  33 +++
 dev-libs/boost/metadata.xml                        |   2 +
 dev-util/boost-build/Manifest                      |   1 +
 dev-util/boost-build/boost-build-1.70.0.ebuild     | 142 +++++++++
 profiles/arch/amd64-fbsd/package.use.mask          |   4 +
 profiles/package.mask                              |   5 +
 9 files changed, 553 insertions(+)
Comment 6 David Seifert gentoo-dev 2019-04-19 09:47:55 UTC
Boost 1.70 as full, native support for the Numpy extensions to Boost::Python. Please try this instead (don't forget to enable USE="python numpy" on it).