boost.python and distutils
Hi, I need to distribute a python package that includes a boost.python extension. I've been working on Linux but I'd like the distribution to install easily on any platform with boost and python. I'm guessing distutils is the way to go. I'm not sure if the easiest way is to try to get distutils to call bjam or somehow to code all the compile and link options into the setup.py script (this seems like a headache). If I get distutils to call bjam how can the setup.py script know what the files are to install given different OSes and versions of boost? Perhaps just using a boost.build script would be easier than distutils. This is what the boost.graph python bindings do. Has anyone got any experience doing this? Thanks, John.
Hi John, On Tue, 26 Oct 2010 12:22:53 +0100, John Reid <j.reid@mail.cryst.bbk.ac.uk> wrote:
I need to distribute a python package that includes a boost.python extension. I've been working on Linux but I'd like the distribution to install easily on any platform with boost and python.
I'm guessing distutils is the way to go. I'm not sure if the easiest way is to try to get distutils to call bjam or somehow to code all the compile and link options into the setup.py script (this seems like a headache). If I get distutils to call bjam how can the setup.py script know what the files are to install given different OSes and versions of boost?
Perhaps just using a boost.build script would be easier than distutils. This is what the boost.graph python bindings do.
Has anyone got any experience doing this?
I've done distutils+Boost.Python for years now, without any issue. See here for code examples: - http://git.tiker.net/pyopencl.git - http://git.tiker.net/pyublas.git - http://git.tiker.net/pycuda.git No bjam whatsoever. Andreas
Hi Andreas, On 26/10/10 15:12, Andreas Kloeckner wrote:
Hi John,
I've done distutils+Boost.Python for years now, without any issue. See here for code examples:
- http://git.tiker.net/pyopencl.git - http://git.tiker.net/pyublas.git - http://git.tiker.net/pycuda.git
After following the getting started instructions http://www.boost.org/doc/libs/1_44_0/more/getting_started/unix-variants.html... I found I had to change the aksetup_helper.py module slightly as there was no 'gcc43-mt' in the boost library filenames: class BoostLibraries(Libraries): def __init__(self, lib_base_name): Libraries.__init__(self, "BOOST_%s" % lib_base_name.upper(), #["boost_%s-${BOOST_COMPILER}-mt" % lib_base_name], ["boost_%s" % lib_base_name], help="Library names for Boost C++ %s library (without lib or .so)" % humanize(lib_base_name)) Did you write aksetup or is it a third party thing? Do you know why the library names are different? Thanks for your help it is extremely useful, John.
On 26/10/10 15:12, Andreas Kloeckner wrote:
Hi John, I've done distutils+Boost.Python for years now, without any issue. See here for code examples:
- http://git.tiker.net/pyopencl.git - http://git.tiker.net/pyublas.git - http://git.tiker.net/pycuda.git
Also the instructions in README_SETUP.txt didn't seem to work for me. """ If you don't want to continue reading, just try the regular ./configure.py --help ./configure.py --some-options make sudo make install """ This didn't generate a makefile but the distutils method did work. Are these instructions out-of-date or did I miss something? Thanks, John.
participants (2)
-
Andreas Kloeckner -
John Reid