[Numpy-discussion] numpy build: automatic fortran detection

Ralf Gommers ralf.gommers@googlemail....
Sun Jun 12 03:48:49 CDT 2011


On Thu, Jun 9, 2011 at 11:46 PM, Russell E. Owen <rowen@uw.edu> wrote:

> What would it take to automatically detect which flavor of fortran to
> use to build numpy on linux?
>

You want to figure out which compiler was used to build BLAS/LAPACK/ATLAS
and check that the numpy build uses the same, right? Assuming you only care
about g77/gfortran, you can try this (from
http://docs.scipy.org/doc/numpy/user/install.html):
"""
How to check the ABI of blas/lapack/atlas
-----------------------------------------
One relatively simple and reliable way to check for the compiler used to
build a library is to use ldd on the library. If libg2c.so is a dependency,
this means that g77 has been used. If libgfortran.so is a a dependency,
gfortran has been used. If both are dependencies, this means both have been
used, which is almost always a very bad idea.
"""

You could do something similar for other compilers if needed. It would help
to know exactly what problem you are trying to solve.


> The unit tests are clever enough to detect a mis-build (though
> surprisingly that is not done as part of the build process), so surely
> it can be done.
>

The test suite takes some time to run. It would be very annoying if it ran
by default on every rebuild. It's easy to write a build script that builds
numpy, then runs the tests, if that's what you need.

Cheers,
Ralf


> Even if there is no interest in putting this into numpy's setup.py, we
> have a need for it for our own system. Any suggestions on how to do this
> robustly would be much appreciated.
>
> -- Russell
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110612/85ded15d/attachment.html 


More information about the NumPy-Discussion mailing list