Numpy build – second try

I examined the lof and error files created yesterday and has done some editing on site.cfg, because I have created static libraries of LAPACK and BLAS. Given the comment on the SciPy site on building numpy, where it stated:

export BLAS=/path/to/libblas.so
export LAPACK=/path/to/liblapack.so
export ATLAS=/path/to/libatlas.so
python setup.py …………

If you don’t want to any LAPACK, just do “export LAPACK=”.

what I have to do is exporting these libraries as value to the according packages, or nothing if I don’t
need them:
$ export ATLAS=
$ export LAPACK=/home/wgrooters/ETW/lib/liblapack.a
$ export BLAS=/home/wgrooters/ETW/lib/librefblas.a

and run the config command again.
Had to export one more:
$ export OPENBLAS=
and no matter what, ATLAS error keeps showing up:
Running from numpy source directory.
setup.py:390: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
run_build = parse_setuppy_commands()
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
/home/wgrooters/ETW/numpy-1.16.3/numpy/distutils/system_info.py:638: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
self.calc_info()
/tmp/tmpMujJ2q/source.c:1:19: fatal error: cblas.h: No such file or directory
#include
^
compilation terminated.

left that alone for now, just started building:
$ python setup.py build > bld.log 2>bld.err
The result is a lot of warnings on variables that are defined but not used, conflicting types for built-in functions, statements wit no effect, just a few real compilation errors: two about include files (cblas.h, endian.h) not found (first is also mentioned in config command), and one undefined reference to ‘exp’, and an exit status 1 on collect2. In the end things go wrong in linking the shared object – need to recompile with -fPIC parameter. But the build log shows most sources have been compiled using that parameter; or does that have to with LAPACK and BLAS code?

According the numpy documentation, LAPACK and BLAS (and ATLAS) are not a requirement, so iy can be built without them: just disable them (following the doc):
$ export LAPACK=None
$ export BLAS=None
$ export ATLAS=None

and execute the build function as before. Again, it takes a while, the number of errors is far lower – the same as in the first config, the error on ‘exp’ as before, and a few warnings on an unused variable. The log – far smaller as well – shows no further issues – but need to check on the commands given: Does gcc do just the compilation, or does it create shareable objects as well? It seems so (man pages agree)

Now find out what libraries (static or not) have been created in either method, then start with Scipy. Here the same method must be used: define where the libraries are located and see if that builds.
Since there are building procedures for LAPACK/BLAS and Numpy already, this is the last hurdle: Find out what build commands are used to build Scipy. That is what this Linux exercise is all about….