Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

boost: can Homebrew break out boost-python? #30845

Closed
tdsmith opened this issue Jul 13, 2014 · 7 comments
Closed

boost: can Homebrew break out boost-python? #30845

tdsmith opened this issue Jul 13, 2014 · 7 comments
Labels

Comments

@tdsmith
Copy link
Contributor

tdsmith commented Jul 13, 2014

I'm trying to test a homebrew-python formula that depends on Boost.Python and building boost --with-python today on my test VM took 3 hours and weakened my will to live. If I showed up with a boost-python formula that depended on (mercifully bottled) Boost and built only the Python parts, is it likely to be accepted into core?

@MikeMcQuaid
Copy link
Member

So the problem with bottling these is that some people want to use Homebrew Python and some people want to use system Python. As the community doesn't seem able to pick one we don't build Boost's Python bindings for now by default.

@tdsmith
Copy link
Contributor Author

tdsmith commented Jul 13, 2014

Yes, understood about leaving Python out of the bottles. 👍

The Boost.Python Build HOWTO says:
"If building binaries from source, you might want to supply the --with-python argument to bjam (or the --with-libraries=python argument to configure), so only the Boost.Python binary will be built, rather than all the Boost binaries."

This makes me think, maybe erroneously, that building Boost.Python can be accomplished less painfully than (and separably from) building all of Boost. Probably I should try it before continuing the discussion.

@adamv adamv added the python label Jul 13, 2014
@tdsmith
Copy link
Contributor Author

tdsmith commented Jul 14, 2014

It looks like this can work!

Boost has at least two contact points with Python:

  • Boost.Python is a C++ library that makes it easier to write Python extensions in C++. It is not a set of Python bindings to other Boost libraries.
  • Boost.MPI has some Python bindings.

Building Boost.Python separately from the rest of Boost is easy and takes only a couple minutes. Here is my proof of concept boost-python.rb, which is hacked down from boost.rb; here is a diff view.

My work-in-progress vpython formula, which uses Boost.Python and "normally" depends on boost --with-python, both builds and functions with the combination of bottled boost and this boost-python formula instead.

I'm not sure how to build the MPI bindings without building Boost.Python so that this doesn't conflict with boost --with-python (this could be as simple as just removing the four Boost.Python library files before linking, since they represent such a small fraction of Boost build time) but I think this is an encouraging start.

@MikeMcQuaid
Copy link
Member

If you can make a slimmed down, working version of both formulae we'd review a PR. I think this is an interesting approach, certainly.

@NikolausDemmel
Copy link
Contributor

As a user of Boost.Python I would very much welcome being able to use most of Boost from bottle and only have to build a separate Boost Python formula. 👍

@tdsmith
Copy link
Contributor Author

tdsmith commented Jul 17, 2014

Some notes:

  • Boost.Python is reasonably popular. 5 formulas in homebrew-science, 6 in main homebrew, and 1 in homebrew-python can depend_on boost --with-python.
  • Boost.MPI Python bindings are not popular and are not an obvious choice for new development. No formulas in homebrew-science, -python, or main mention boost, python, and MPI together. The MPI bindings depend on Boost.Python.
  • Building boost --with-mpi --with-python --without-single doesn't currently install the Python MPI bindings. Nobody's complained.
  • I think --with-python3 is wrong in the current boost formula; if specified, Boost.Python is always built only against python3. The flag was added two weeks ago in Option for boost::python to use python 3 #30590. I think there haven't been complaints because nothing depends on it yet. The approach we'll need to use is discussed at boost - provide option to pour from bottle? #21824 (comment).

I'll try and have a PR together and tested this weekend.

@tdsmith tdsmith mentioned this issue Jul 19, 2014
4 tasks
@jacknagel
Copy link
Contributor

Closing in favor of the pull request.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants