.. -*- rest -*- .. vim:syntax=rest .. NB! Keep this document a valid restructured document. Building and installing NumPy +++++++++++++++++++++++++++++ :Authors: Numpy Developers :Discussions to: numpy-discussion@scipy.org .. Contents:: PREREQUISITES ============= Building NumPy requires the following software installed: 1) Python__ 2.4.x or newer On Debian and derivative (Ubuntu): python python-dev On Windows: the official python installer on Python__ is enough Make sure that the Python package distutils is installed before continuing. For example, in Debian GNU/Linux, distutils is included in the python-dev package. Python must also be compiled with the zlib module enabled. __ http://www.python.org Fortran ABI mismatch ==================== 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 a dependency, gfortran has been used. If both are dependencies, this means both have been used, which is almost always a very bad idea. Building with ATLAS support =========================== Ubuntu 8.10 (Intrepid) ---------------------- You can install the necessary packages for optimized ATLAS with this command: sudo apt-get install libatlas-base-dev If you have a recent CPU with SIMD suppport (SSE, SSE2, etc...), you should also install the corresponding package for optimal performances. For example, for SSE2: sudo apt-get install libatlas3gf-sse2 *NOTE*: if you build your own atlas, Intrepid changed its default fortran compiler to gfortran. So you should rebuild everything from scratch, including lapack, to use it on Intrepid. Ubuntu 8.04 and lower --------------------- You can install the necessary packages for optimized ATLAS with this command: sudo apt-get install atlas3-base-dev If you have a recent CPU with SIMD suppport (SSE, SSE2, etc...), you should also install the corresponding package for optimal performances. For example, for SSE2: sudo apt-get install atlas3-sse2