Compile c++ project that uses blas and lapack

I compile and link with g++ with flags -lblas and -llapack. I get error messages

/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas

I would greatly appreciate help with it.

I work in an interactive session where I have loaded the following modules:

Currently Loaded Modules:
  1) usc   
  2) gcc/8.3.0   
  3) openmpi/4.0.2   
  4) pmix/3.1.3  
  5) netlib-lapack/3.8.0 
  6) vim/8.1.2141

Depending on what build system you are using you’ll have to point the linker to the location of the blas and lapack libraries. If you’re manually supplying g++ commands you can do something like:

g+++ -L${NETLIB_LAPACK_ROOT}/lib64 -llapack -lblas ....
1 Like