-
Notifications
You must be signed in to change notification settings - Fork 17
Build build accelerated numpy using ATLAS on Mac OSX
Mac OSX comes with its own "Accelerate.Framework" (Accelerate and vecLib). Numpy is linked against those libraries to perform linear algebra operations in parallel, although it does not depend on them. Unfortunately the native OSX Accelerate.Framework breaks the python multiprocessing in combination with numpy. The child processes will segfault almost every time if a method from the numpy.linalg package is used.
To overcome this problem one can use a different parallelization library. This guide describes how to install ATLAS and link numpy against it. This guide works also with openBlas.
- The user has appropriate knowledge in compiling software. For details we refer to the original websites.
- Numpy installation guide
- Atlas intallation guide
Download the source code from ATLAS, lapack and numpy
http://math-atlas.sourceforge.net/
http://www.netlib.org/lapack/
https://github.com/numpy/numpy/
- Unpack the atlas-3.10.0.tar.gz file. Lapack needs not to be installed separately.
cd ATLAS
mkdir build
../configure -b 64 --prefix=<atlas/prefix> --with-netlib-lapack-tarfile=<path/to/lapack-XXX.tgz>
make
then as root (or use sudo
):
make install
- Go to the numpy directory, open the file
site.cfg.example
and uncomment and edit the lines accordingly
[atlas]
library_dirs = <atlas/prefix>/lib
include_dirs = <atlas/prefix>/include
- Build the package
python setup.py build
- Save the file as
site.cfg
finally as root (or usesudo
):
python setup.py install