<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi there!<br/>
<br/>
I've been trying to get numpy to compile with ACML on and off for over a year now. When I first attempted this, I contacted this mailing list, however noone was able to help me and I lost interested without ever filing a bug report [1]. I'm assuming ACML is broken since then.<br/>
<br/>
Today I had a bit of spare time and wanted to try again. And this time I finally managed to get numpy to compile with ACML.<br/>
<br/>
The problem is that when using ACML, numpy does not build _dotblas.so because NO_ATLAS_INFO is set to 1. I manually disabled this check manually, but I'm guessing a more complete solution would be to add ACML support directly, as was done with OpenBLAS recently.<br/>
<br/>
On my machine (AMD FX 8150) I see a speedup when going from OpenBLAS to ACML. Doing dot-product, determinant and matrix-inverse on a 1000x1000 matrix (I'm reporting the mean of 5 runs plus standard deviation):<br/>
<br/>
With OpenBLAS<br/>
            test_dot :   298.7ms (sd: 9.0ms)<br/>
            test_det :    92.9ms (sd: 1.1ms)<br/>
            test_inv :   163.3ms (sd: 1.0ms)<br/>
<br/>
ACML:<br/>
            test_dot :   261.8ms (sd: 8.0ms)<br/>
            test_det :    68.0ms (sd: 8.0ms)<br/>
            test_inv :   145.2ms (sd: 0.2ms)<br/>
<br/>
<br/>
<br/>
For completeness' sake here are my installation notes (this was done on Ubuntu 13.04 and numpy 1.7.1). It would probably be a good idea to add this to <a class="moz-txt-link-freetext" href="http://www.scipy.org/scipylib/building/linux.html">http://www.scipy.org/scipylib/building/linux.html</a> as well:<br/>
<br/>
<br/>
1. ACML needs CBLAS<br/>
Grab from <a class="moz-txt-link-freetext" href="http://www.netlib.org/blas/blast-forum/cblas.tgz">http://www.netlib.org/blas/blast-forum/cblas.tgz</a>, modify the Makefile.LINUX to contain the following lines, and rename it to Makefile.in<br/>
<br/>
BLLIB = /opt/acml5.3.1/gfortran64_fma4/lib/libacml.a  # whatever your ACML path is<br/>
CFLAGS = -O3 -DADD_ -march=native -fPIC    #-fPIC is needed, -march is optional<br/>
FFLAGS = -O3  -march=native -fPIC<br/>
<br/>
<br/>
2. move CBLAS files to ACML files (optional)<br/>
sudo mv lib/cblas_LINUX.a /opt/acml5.3.1/gfortran64_fma4/lib/libcblas.a<br/>
sudo cp include/* <i class="moz-txt-slash"><span class="moz-txt-tag">/</span>opt/acml5.3.1/gfortran64_fma4/include<span class="moz-txt-tag">/</span></i><br/>
<br/>
<br/>
3. Edit site.cfg.example in the numpy folder and rename it to site.cfg:<br/>
[blas]<br/>
blas_libs = cblas, acml<br/>
library_dirs = /opt/acml5.3.1/gfortran64_fma4/lib<br/>
include_dirs = /opt/acml5.3.1/gfortran64_fma4/include<br/>
<br/>
[lapack]<br/>
language = f77<br/>
lapack_libs = acml<br/>
library_dirs = /opt/acml5.3.1/gfortran64_fma4/lib<br/>
include_dirs = /opt/acml5.3.1/gfortran64_fma4/include<br/>
<br/>
4. (this is where numpy is broken):<br/>
<br/>
edit numpy/core/setup.py, towards the end of the file you will find a check that disables BLAS support if NO_ATLAS_INFO is set. Comment out this check so it reads:<br/>
<br/>
    def get_dotblas_sources(ext, build_dir):<br/>
        if blas_info:<br/>
            #if ('NO_ATLAS_INFO',1) in blas_info.get('define_macros',[]):<br/>
            #    return None # dotblas needs ATLAS, Fortran compiled blas will not be sufficient.<br/>
            return ext.depends[:1]<br/>
        return None<br/>
   # ....<br/>
<br/>
<br/>
All the best<br/>
<br/>
<br/>
Thomas<br/>
<br/>
<br/>
<br/>
[1] <a class="moz-txt-link-freetext" href="http://numpy-discussion.10968.n7.nabble.com/Problems-when-using-ACML-with-numpy-td18135.html">http://numpy-discussion.10968.n7.nabble.com/Problems-when-using-ACML-with-numpy-td18135.html</a></div></div></body></html>