[SciPy-dev] distutils, mtrand, Monte Carlo
pearu at scipy.org
Tue Apr 18 14:35:34 CDT 2006
On Tue, 18 Apr 2006, Ed Schofield wrote:
> Hi all,
> I've now modified the Monte Carlo package (still in the sandbox) to use
> the RNG from RandomKit that comes with numpy. It builds and works fine
> for me, but only with two directories hard-coded into the setup.py
> file. I have some questions (e.g. for Pearu) on how to use numpy
> distutils to do this portably.
> 1. Currently the add_headers method of distutils.misc_util.Configuration
> installs headers to $PREFIX/include/python2.4/numpy. This doesn't
> bother me, but do we want this? All other header files are installed
> into $PREFIX/lib/python2.4/site-packages/numpy or scipy/.
add_headers method behaves in a way python installs header files.
The reasons for not using add_headers in numpy/scipy cases have been
discussed earlier in this list (we need a FAQ item, see numpy ticket #69).
numpy uses add_data_files for installing numpy header files.
> 2. The add_library method creates a static library under
> build/temp.linux-etc/. Is it possible to use distutils to install this
> (e.g. librandomkit.a) to a system-wide location? (This is necessary to
> prevent scipy having a build dependency on the numpy source files.)
That would be a desirable feature. For example, when scipy would ship
blas/lapack source codes then it would be desirable to install blas/lapack
libraries so that various scipy subpackages could use them.
I have started implementing the support for this feature about half a year
ago but I haven't finished it yet, mostly because of I haven't had time
to figure out what would be good (portable,etc) locations of such
libraries and how would subpackages access them in different situations
(building whole scipy, building a subpackage without building scipy,
> 3. Does distutils support dynamic libraries? But randomkit is a small
> library, so I suppose static linking is fine here.
numpy.distutils has support for using dynamic libraries when static
libraries are not available, but no support for creating ones. This would
be also related to your question 2.
More information about the Scipy-dev