Trying to compile some Fortran code using gfortran 9.x.x on my CentOS 7.xx machine. Have a particular version of the code that requires linking to LAPACK and BLAS (specifcially, liblapack.a, and librefblas.a). Have LAPACK (and all the -devel libs), and BLAS (same about -devel libs) installed (both available in the CentOS base repo).
While I (and therefore the linker) can find liblapack.a (its in /usr/lib64), no trace of librefblas.a (which causes the linker to complain bitterly, and the compilation to crash and burn).
In fact, I tried installing both BLAS and OpenBLAS on the same machine, but that didn’t help — librefblas.a still nowhere to be found.
3
Answers
The CentOS 7 lapack-3.4.2-8.el7 package build doesn’t create or install the file librefblas.a .
I.e. no available package providing /usr/lib64/librefblas.a .
The package blas-static provides one file only : /usr/lib64/libblas.a
Build librefblas.a :
… And librefblas.a will be created.
The first thing to try is to use the regular
libblas
. Either change your Makefile to to uselibblas
instead oflibrefblas
or make a symlink. Then check if you have any unresolved reference. Or do the same for OpenBLAS and point your makefile tolibopenblas
. Note that OpenBLAS also includes LAPACK.Background: BLAS and LAPACK are publicly available interfaces. There is a reference implementation available, but also many alternative optimized or machine-specific ones. It should not matter which one you use so it seems unnecessary to specifically require the reference one. Normally, your Linux distribution
libblas
is the reference one anyway. It is probably just a quirk of your Makefile.do this in the package folder:
solved