I'm trying to speed up matrix operations using NumPy in Ubuntu 14.04 LTS (64-bit). Instead of using ATLAS (actually when I use ATLAS, there is only 1 thread which is fully running, with 7 other opened threads doing nothing, even if I specify OMP_NUM_THREADS=8
for instance. Don't know why.), I decided to give OpenBLAS a try.
I've spent hours by following several tutorials to build the source code of OpenBLAS and NumPy, e.g. [1], [2], [3], [4], and [5]. However, none of them can generate _dotblas.so
after compiling NumPy, which is a critical file to speed up dot
operation between matrices.
May I know if anyone has successfully built NumPy and OpenBLAS under Ubuntu 14.04? If so, may you please let me know how to do?
Thank you.
Update:
Below is basically what I summarized from the above five posts and tried in my machine:
# OpenBLAS
git clone git://github.com/xianyi/OpenBLAS
cd OpenBLAS
make FC=gfortran
sudo make PREFIX=/opt/OpenBLAS/ install
cd ..
# let the system know
sudo sh -c 'echo "/opt/OpenBLAS/lib" > /etc/ld.so.conf.d/openblas.conf'
sudo ldconfig
# Numpy
git clone https://github.com/numpy/numpy
cd numpy
vim site.cfg # and put the following content within #### in site.cfg
####
[default]
library_dirs = /opt/OpenBLAS/lib
[atlas]
atlas_libs = openblas
library_dirs = /opt/OpenBLAS/lib
[lapack]
lapack_libs = openblas
library_dirs = /opt/OpenBLAS/lib
####
export BLAS=/opt/OpenBLAS/lib/libopenblas.a
export LAPACK=/opt/OpenBLAS/lib/libopenblas.a
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/OpenBLAS/lib/
python setup.py build
sudo python setup.py install
UPDATE: The above script has been tested to work well on both Ubuntu 12.04 and 14.04 64-bit.