problem linking to a BLAS lib

Issues related to applications and software problems
Post Reply
johnny_canuck
Posts: 6
Joined: 2017/12/01 17:43:31

problem linking to a BLAS lib

Post by johnny_canuck » 2020/02/20 12:25:49

This may be too 'compiler-specific', but since I'm trying this on a CentOS 7 box, using packages pulled from the base CentOS repo(s), thought I'd give it a try...

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. Most of the purported solution to this sort of problem I've found are based on compiling LAPACK and BLAS from scratch. Fine, but...why would that/should that be necessary if I can pull both out of the base repo?

Suggestions? Pointers to the obvious?
Last edited by johnny_canuck on 2020/02/20 14:38:17, edited 1 time in total.

User avatar
TrevorH
Forum Moderator
Posts: 29456
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: problem lining to a BLAS lib

Post by TrevorH » 2020/02/20 13:53:25

For problems like this, use something like yum provides '*/librefblas.a' to find the package that provides the file you're looking for. For this particular case, that says "No matches found".
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

johnny_canuck
Posts: 6
Joined: 2017/12/01 17:43:31

Re: problem linking to a BLAS lib

Post by johnny_canuck » 2020/02/20 14:07:24

Thanks -- very helpful.

Alas, as you note, the procedure didn't find anything in the various repos I have 'active' that 'supports' (provides) librefblas.a

Which is odd, since it seems (from what I can find) that the only way to get it is to compile LAPACK from source, and then sudo make blaslib.

So, why the heck isn't that already part of the LAPACK.RPM?

User avatar
jlehtone
Posts: 3038
Joined: 2007/12/11 08:17:33
Location: Finland

Re: problem linking to a BLAS lib

Post by jlehtone » 2020/02/20 23:33:57

johnny_canuck wrote:
2020/02/20 14:07:24
then sudo make blaslib
No. No sudo. You don't want to compile as root. Anything. There is no need for it.

johnny_canuck
Posts: 6
Joined: 2017/12/01 17:43:31

Re: problem linking to a BLAS lib

Post by johnny_canuck » 2020/02/21 00:34:19

Not relevant to the question, but thanks for the scold. ;)

chemal
Posts: 692
Joined: 2013/12/08 19:44:49

Re: problem linking to a BLAS lib

Post by chemal » 2020/02/21 02:34:17

Just substitute librefblas.a with libblas.a in your Makefile (or whatever you fortran people use). Refblas is the name of a simple reference blas implementation that comes with the lapack sources and is not meant to be installed unless there is nothing better available.

User avatar
TrevorH
Forum Moderator
Posts: 29456
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: problem linking to a BLAS lib

Post by TrevorH » 2020/02/21 02:39:34

yum provides '*/libblas.a'
blas-static-3.4.2-8.el7.i686 : BLAS static libraries
blas-static-3.4.2-8.el7.x86_64 : BLAS static libraries
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - Software Support”