List Info

Thread: Installing python extensions




Installing python extensions
country flaguser name
United States
2007-08-23 22:07:11
Hi all,

boost.mpi and boost.graph both build Python extension
modules, but neither 
have good build system support right now. I care most about
the boost.mpi 
issue, so I'll focus on that one.

mpi.so, the Python extension module for boost.mpi gets built
correctly, but it 
gets installed in the wrong location, namely $prefix/lib. I
assume that is 
because it internally simply is a shared library. It really
should be in 
$prefix/lib/pythonN.N/site-packages/boost/, with directories
along that path 
created if necessary. Also, there's a file __init__.py under
libs/mpi/build 
that needs to go under that same path.

How do I make that happen? I just spent more time than I
care to admit trying 
to figure this out, to no avail.

Thanks
Andreas

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Installing python extensions
country flaguser name
United States
2007-08-28 13:14:00
Hi Andreas,

On Aug 23, 2007, at 11:07 PM, Andreas Klöckner wrote:
> boost.mpi and boost.graph both build Python extension
modules, but  
> neither
> have good build system support right now. I care most
about the  
> boost.mpi
> issue, so I'll focus on that one.
>
> mpi.so, the Python extension module for boost.mpi gets
built  
> correctly, but it
> gets installed in the wrong location, namely
$prefix/lib. I assume  
> that is
> because it internally simply is a shared library. It
really should  
> be in
> $prefix/lib/pythonN.N/site-packages/boost/, with
directories along  
> that path
> created if necessary. Also, there's a file __init__.py
under libs/ 
> mpi/build
> that needs to go under that same path.

Right. Back before BBv2, both of these libraries had
BBv1-based build  
systems that probed Python to find the right installation
location  
and placed all of the necessary files into the right
site-packages.  
However, I wasn't able to get this BBv1 ported to BBv2,
because I got  
lost (again) in the BBv2 system.

> How do I make that happen? I just spent more time than
I care to  
> admit trying
> to figure this out, to no avail.

Ideally, the python-extension rule from python.jam would
provide  
installation directly into the appropriate site-packages,
aided by  
two Python extension-specific features, e.g.,

	<python-sources>filename    # files to be installed
along with the  
Python module in site-packages
        <python-module-root>root     # subdirectory of
site-packages  
where this module lives (e.g., boost/ or boost/mpi)

The BBv1 installation logic I had also dealt with home
directory  
installations, where everything went into ~/lib/python. I
found that  
useful on machines I don't administer.

We'll need help from a BBv2 expert to make this happen. I've
hacked  
quite a bit of BBv2 before, but for some reason this one
stumped me.  
It's pretty important for building Python modules with
Boost.Python,  
and as more Boost libraries get Python bindings it will
become even  
more important.

	- Doug
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Installing python extensions
country flaguser name
Russian Federation
2007-09-01 15:43:43
On Tuesday 28 August 2007 22:14:00 Doug Gregor wrote:

> > mpi.so, the Python extension module for boost.mpi
gets built  
> > correctly, but it
> > gets installed in the wrong location, namely
$prefix/lib. I assume  
> > that is
> > because it internally simply is a shared library.
It really should  
> > be in
> > $prefix/lib/pythonN.N/site-packages/boost/, with
directories along  
> > that path
> > created if necessary. Also, there's a file
__init__.py under libs/ 
> > mpi/build
> > that needs to go under that same path.
> 
> Right. Back before BBv2, both of these libraries had
BBv1-based build  
> systems that probed Python to find the right
installation location  
> and placed all of the necessary files into the right
site-packages.  
> However, I wasn't able to get this BBv1 ported to BBv2,
because I got  
> lost (again) in the BBv2 system.
> 
> > How do I make that happen? I just spent more time
than I care to  
> > admit trying
> > to figure this out, to no avail.
> 
> Ideally, the python-extension rule from python.jam
would provide  
> installation directly into the appropriate
site-packages, aided by  
> two Python extension-specific features, e.g.,
> 
> 	<python-sources>filename    # files to be
installed along with the  
> Python module in site-packages
>         <python-module-root>root     #
subdirectory of site-packages  
> where this module lives (e.g., boost/ or boost/mpi)
> 
> The BBv1 installation logic I had also dealt with home
directory  
> installations, where everything went into ~/lib/python.
I found that  
> useful on machines I don't administer.
> 
> We'll need help from a BBv2 expert to make this happen.
I've hacked  
> quite a bit of BBv2 before, but for some reason this
one stumped me.  
> It's pretty important for building Python modules with
Boost.Python,  
> and as more Boost libraries get Python bindings it will
become even  
> more important.

[personal CC for convenience, reply to list]

Doug, can you tell in more detail what install logic you
want? Then,
I should be able to propose something.

- Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

Re: Installing python extensions
country flaguser name
United States
2007-09-01 18:34:34
on Sat Sep 01 2007, Vladimir Prus <ghost-AT-cs.msu.su>
wrote:

> Doug, can you tell in more detail what install logic
you want? Then,
> I should be able to propose something.

The correct logic for installation of python modules is
described in
http://www.python.org/d
oc/current/inst/standard-install.html#SECTION000240000000000
000000
and following pages.  You should use python's distutils
module to
programmatically find the name of the packages directory.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-cons
ulting.com

The Astoria Seminar ==> http://www.astoriasemin
ar.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )