NumPy is mandatory for the Gildas-Python binding. Building and installing it requires some specific options and setting a correct environment. You can follow these steps:
cd <compilation-directory> tar xvzf numpy-1.3.0.tar.gz cd numpy-1.3.0 python setup.py build --fcompiler=<compiler> |
The two most popular open source fortran compilers are g77 and gfortran. Unfortunately, they are not ABI compatible, which means that concretely you should avoid mixing libraries built with one with another. In particular, if your blas/lapack/atlas is built with g77, you *must* use g77 when building numpy and scipy; on the contrary, if your atlas is built with gfortran, you *must* build numpy/scipy with gfortran. * Choosing the fortran compiler - To build with g77: python setup.py build --fcompiler=gnu - To build with gfortran: python setup.py build --fcompiler=gnu95 * 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 dependency, gfortran has been used. If both are dependencies, this means both have been used, which is almost always a very bad idea.In other words, for standard users, NumPy has a linear algebra module (linalg) which is linked with the system's blas/lapack/atlas libraries. This implies that the Fortran sources of NumPy must be compiled with the same compiler which was used for the libraries. Check e.g. with ldd /usr/lib(64)/lapack.so which compiler you will have to use.
python setup.py install [--prefix=/some/custom/installation/prefix] |
import numpy numpy numpy.__version__ |