skip to Main Content

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


  1. no trace of librefblas.a

    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 :

    tar xvf lapack-3.4.2-clean.tgz
    https://src.fedoraproject.org/repo/p....4.2-clean.tgz
    cd lapack-3.4.2/
    cp make.inc.example make.inc
    make blaslib
    

    … And librefblas.a will be created.

    Login or Signup to reply.
  2. The first thing to try is to use the regular libblas. Either change your Makefile to to use libblas instead of librefblas or make a symlink. Then check if you have any unresolved reference. Or do the same for OpenBLAS and point your makefile to libopenblas. 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.

    Login or Signup to reply.
  3. do this in the package folder:

    sudo ln -s $HOME/lapack-3.9.0/librefblas.a /usr/local/lib/librefblas.a
    

    solved

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search