Building numpy with ATLAS/LAPACK support : <p>I am trying to compile <code>numpy</code> v1.12 in order to get support for ATLAS/LAPACK routines. </p>

<p><strong>The problem</strong></p>

<p>The settings I am using for compilation do not appear to work in bringing ATLAS/LAPACK libraries into <code>numpy</code>.</p>

<p><strong>The setup</strong></p>

<p>I do not have admin privileges on the host(s) I am working on (a computational cluster). </p>

<p>However, the nodes offer access to <code>gcc</code> 4.7.2 and 5.3.0, <code>glibc</code> 2.17 and 2.22, and ATLAS/LAPACK libraries and headers v3.10.2 via GNU modules.</p>

<p>For compatibility reasons, I am working with a virtual environment that contains Python 2.7.16. Likewise, I am installing an older version of <code>numpy</code> for the same reason. If things work, I may explore newer versions of <code>numpy</code> but at this time, that is what I am working with. </p>

<p>My source directory for <code>numpy</code> has a configuration file called <code>site.cfg</code>, which includes these directives:</p>

<pre><code>[ALL]
library_dirs = /usr/local/lib:/net/module/sw/glibc/2.22/lib64:/net/module/sw/atlas-lapack/3.10.2/lib
include_dirs = /usr/local/include:/net/module/sw/glibc/2.22/include:/net/module/sw/atlas-lapack/3.10.2/include

[atlas]
libraries = lapack,f77blas,cblas,atlas
library_dirs = /net/module/sw/atlas-lapack/3.10.2/lib
include_dirs = /net/module/sw/atlas-lapack/3.10.2/include
</code></pre>

<p>I am compiling <code>numpy</code> via the following command:</p>

<pre><code>$ CFLAGS="${CFLAGS} -std=c99 -fPIC" LDFLAGS="-L/home/areynolds/.conda/envs/genotyping_environment/lib -Wl,-rpath=/home/areynolds/.conda/envs/genotyping_environment/lib -Wl,--no-as-needed -Wl,--sysroot=/,-L/net/module/sw/glibc/2.22/lib64" python setup.py build --fcompiler=gnu95
</code></pre>

<p>I am using <code>--fcompiler=gnu95</code> as the ATLAS/LAPACK libraries were compiled with GNU Fortran. I am overriding <code>CFLAGS</code> and <code>LDFLAGS</code> variables in order for the GCC toolkit to be able to compile and link properly.</p>

<p><strong>The question</strong></p>

<p>After compilation, I test the <code>numpy</code> library to see what is installed via one method:</p>

<pre><code>$ python
...
&gt;&gt;&gt; import numpy.distutils.system_info as sysinfo
&gt;&gt;&gt; sysinfo.get_info('atlas')
ATLAS version 3.10.2 built by root on Wed Jun  1 15:39:08 PDT 2016:
    UNAME    : Linux module0.altiusinstitute.org 3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
    INSTFLG  : -1 0 -a 1 -l 1
    ARCHDEFS : -DATL_OS_Linux -DATL_ARCH_UNKNOWNx86 -DATL_CPUMHZ=2876 -DATL_AVXMAC -DATL_AVX -DATL_SSE3 -DATL_SSE2 -DATL_SSE1 -DATL_USE64BITS -DATL_GAS_x8664
    F2CDEFS  : -DAdd_ -DF77_INTEGER=int -DStringSunStyle
    CACHEEDGE: 229376
    F77      : /net/module/sw/gcc/5.3.0/bin/gfortran, version GNU Fortran (GCC) 5.3.0
    F77FLAGS : -O -mavx2 -mfma -m64 -fPIC
    SMC      : /usr/bin/x86_64-redhat-linux-gcc, version x86_64-redhat-linux-gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
    SMCFLAGS : -O -fomit-frame-pointer -mavx2 -mfma -m64 -fPIC
    SKC      : /usr/bin/x86_64-redhat-linux-gcc, version x86_64-redhat-linux-gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4)
    SKCFLAGS : -O -fomit-frame-pointer -mavx2 -mfma -m64 -fPIC                                                                                                                                                    
    {'libraries': ['lapack', 'f77blas', 'cblas', 'atlas', 'f77blas', 'cblas'], 'library_dirs': ['/net/module/sw/atlas-lapack/3.10.2/lib'], 'define_macros': [('ATLAS_INFO', '"\\"3.10.2\\""')], 'language': 'f77', 'include_dirs': ['/net/module/sw/atlas-lapack/3.10.2/include']}
</code></pre>

<p>This looks okay, maybe?</p>

<p>But when I check via another method, I get a different answer:</p>

<pre><code>&gt;&gt;&gt; np.show_config()
lapack_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
blas_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
openblas_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
blis_info:
  NOT AVAILABLE
openblas_lapack_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/local/lib']
    define_macros = [('HAVE_CBLAS', None)]
    language = c
lapack_mkl_info:
  NOT AVAILABLE
blas_mkl_info:
  NOT AVAILABLE
</code></pre>

<p>Despite the manual setup described in <code>site.cfg</code>, there are no mentions of ATLAS, nor is LAPACK apparently pointed to the correct module directory (<code>/net/module/sw/atlas-lapack/3.10.2</code>).</p>

<p>How do I correctly compile support for ATLAS/LAPACK into <code>numpy</code>, or truly test that I have a working ATLAS/LAPACK setup integrated into <code>numpy</code>, which gives me a consistent (and reliable) answer?</p>
