Professional Documents
Culture Documents
+++++++++++++++++++++++++++++
**IMPORTANT**: the below notes are about building Numpy, which for most users
is *not* the recommended way to install Numpy. Instead, use either a complete
scientific Python distribution (recommended) or a binary installer - see
http://scipy.org/install.html.
.. Contents::
Prerequisites
=============
2) Cython >= 0.19 (for development versions of numpy, not for released
versions)
3) nose__ (optional) 1.0 or later
This is required for testing numpy, but not for using it.
Python__ http://www.python.org
nose__ http://somethingaboutorange.com/mrl/projects/nose/
.. note::
.. note::
Basic Installation
==================
This will compile numpy on 4 CPUs and install it into the specified prefix.
To perform an inplace build that can be run from the source folder run::
The number of build jobs can also be specified via the environment variable
NPY_NUM_BUILD_JOBS.
Choosing compilers
==================
Numpy needs a C compiler, and for development versions also Cython. A Fortran
compiler isn't needed to build Numpy itself; the ``numpy.f2py`` tests will be
skipped when running the test suite if no Fortran compiler is available. For
building Scipy a Fortran compiler is needed though, so we include some details
on Fortran compilers in the rest of this section.
On OS X and Linux, all common compilers will work. Note that for Fortran,
``gfortran`` is strongly preferred over ``g77``, but if you happen to have both
installed then ``g77`` will be detected and used first. To explicitly select
``gfortran`` in that case, do::
Windows
-------
On Windows, building from source can be difficult. Currently the most robust
option is to use the Intel compilers, or alternatively MSVC (the same version
as used to build Python itself) with Intel ifort. Intel itself maintains a
good `application note <https://software.intel.com/en-us/articles/numpyscipy-with-
intel-mkl>`_
on this.
MingwPy__ http://mingwpy.github.io
Windows
-------
The Intel compilers work with Intel MKL, see the application note linked above.
MingwPy__ works with OpenBLAS.
For an overview of the state of BLAS/LAPACK libraries on Windows, see
`here <http://mingwpy.github.io/blas_lapack.html>`_.
OS X
----
OS X ships the Accelerate framework, which Numpy can build against without any
manual configuration. Other BLAS/LAPACK implementations (OpenBLAS, Intel MKL,
ATLAS) will also work.
Ubuntu/Debian
-------------
For best performance a development package providing BLAS and CBLAS should be
installed. Some of the options available are:
The package linked to when numpy is loaded can be chosen after installation via
the alternatives mechanism::
Build issues
============
If you run into build issues and need help, the Numpy
`mailing list <http://scipy.org/scipylib/mailing-lists.html>`_ is the best
place to ask. If the issue is clearly a bug in Numpy, please file an issue (or
even better, a pull request) at https://github.com/numpy/numpy.