Missing only two linear algebra symbols during final linking: `zgemm3m_' and `zaxpby_'

Hi everyone,

Thanks first of all for enriching these forums with your questions & answers!

I’ve managed to compile ABINIT completely with MPI, fftw3, scalapack, and a few other useful libraries. However, it fails only upon linking, with what looks like two missing symbols from lapack or scalapack. I would appreciate anyone’s advice on how to get past this very last step.

I built almost all libraries from source, and specifically built scalapack against the same netlib BLAS and LAPACK libraries used in compilation. One thing which helped tremendously for those looking - putting ‘-lscalapack’ BEFORE ‘-llapack -lblas’ made ABINIT recognize it, despite my thinking before that order didn’t matter!

Only two files in ABINIT request what seem like undefined symbols with trailing underscores, though a peek into the two F90 files shows no trailing underscores in the code itself when these functions are called.

Any help would be greatly appreciated, thanks! -Mike

The full text of the error is as follows, followed by a snippet from my config file, and finally a snippet from my config.log:

/usr/bin/ld: ../../src/44_abitools/lib44_abitools.a(m_cgtools.o): in function `__m_cgtools_MOD_cg_zaxpby':
/apps/local/abinit/abinit-9.6.2/src/44_abitools/m_cgtools.F90:786: undefined reference to `zaxpby_'
/usr/bin/ld: ../../src/28_numeric_noabirule/lib28_numeric_noabirule.a(m_abi_linalg.o): in function `__m_abi_linalg_MOD_abi_d2zgemm':
/apps/local/abinit/abinit-9.6.2/shared/common/src/28_numeric_noabirule/abi_xgemm.f90:210: undefined reference to `zgemm3m_'
/usr/bin/ld: ../../src/28_numeric_noabirule/lib28_numeric_noabirule.a(m_abi_linalg.o): in function `__m_abi_linalg_MOD_abi_zgemm_2r':
/apps/local/abinit/abinit-9.6.2/shared/common/src/28_numeric_noabirule/abi_xgemm.f90:136: undefined reference to `zgemm3m_'
/usr/bin/ld: ../../src/28_numeric_noabirule/lib28_numeric_noabirule.a(m_abi_linalg.o): in function `__m_abi_linalg_MOD_abi_zgemm_2d':
/apps/local/abinit/abinit-9.6.2/shared/common/src/28_numeric_noabirule/abi_xgemm.f90:75: undefined reference to `zgemm3m_'
/usr/bin/ld: ../../src/28_numeric_noabirule/lib28_numeric_noabirule.a(m_cplxtools.o): in function `__m_cplxtools_MOD_cplx_zaxpby':
/apps/local/abinit/abinit-9.6.2/shared/common/src/28_numeric_noabirule/m_cplxtools.F90:260: undefined reference to `zaxpby_'

I’m a new user, so the forum won’t yet let me upload config files, though the relevant snippet is as follows:

# Install prefix for linear algebra
#
#with_linalg="yes"

# Flavor of linear algebra libraries to use (default is netlib)
#
with_linalg_flavor="netlib+openblas"

# C preprocessing flags for linear algebra (default is unset)
#
#LINALG_CPPFLAGS="-I/usr/local/include"

# C flags for linear algebra (default is unset)
#
#LINALG_CFLAGS="-m64"

# C++ flags for linear algebra (default is unset)
#
#LINALG_CXXFLAGS="-m64"

# Fortran flags for linear algebra (default is unset)
#
#LINALG_FCFLAGS="-I/usr/local/include"

# Link flags for linear algebra (default is unset)
#
#LINALG_LDFLAGS=""

# Library flags for linear algebra (default is unset)
#
LINALG_LIBS="-lscalapack -llapack -lblas"

Finally, here’s the relevant snippet from my config.log file:

 ==============================================================================
 === Linear algebra support                                                 ===
 ==============================================================================

checking for the requested linear algebra flavor... netlib+openblas
checking for the serial linear algebra detection sequence... openblas netlib
checking for the MPI linear algebra detection sequence... netlib
checking for the MPI acceleration linear algebra detection sequence... none
checking how to detect linear algebra libraries... verify
checking for BLAS support in the specified libraries... yes
checking for AXPBY support in the BLAS libraries... yes
checking for GEMM3M in the BLAS libraries... yes
checking for GEMMT in the BLAS libraries... no
checking for mkl_imatcopy in the specified libraries... no
checking for mkl_omatcopy in the specified libraries... no
checking for mkl_omatadd in the specified libraries... no
checking for mkl_set/get_threads in the specified libraries... no
checking for LAPACK support in the specified libraries... yes
checking for LAPACKE C API support in the specified libraries... no
checking for PLASMA support in the specified libraries... no
checking for BLACS support in the specified libraries... yes
checking for ScaLAPACK support in the specified libraries... yes
checking for ELPA support in the specified libraries... no
checking how linear algebra parameters have been set... env (flavor: kwd)
checking for the actual linear algebra flavor... netlib+openblas
checking for linear algebra C preprocessing flags... none
checking for linear algebra C flags... none
checking for linear algebra C++ flags... none
checking for linear algebra Fortran flags... none
checking for linear algebra linker flags... none
checking for linear algebra library flags... -lscalapack -llapack -lblas

...

Core build parameters
---------------------

  * C compiler        : gnu version 9.4
  * Fortran compiler  : gnu version 9.4
  * architecture      : amd opteron (64 bits)
  * debugging         : basic
  * optimizations     : standard

  * OpenMP enabled    : yes (collapse: yes)
  * MPI    enabled    : yes (flavor: auto)
  * MPI    in-place   : yes
  * MPI-IO enabled    : yes
  * GPU    enabled    : no (flavor: none)

  * LibXML2 enabled   : no
  * LibPSML enabled   : yes
  * XMLF90  enabled   : yes
  * HDF5 enabled      : yes (MPI support: yes)
  * NetCDF enabled    : yes (MPI support: yes)
  * NetCDF-F enabled  : yes (MPI support: yes)

  * FFT flavor        : fftw3-threads (libs: auto-detected)
  * LINALG flavor     : netlib+openblas (libs: user-defined)
  * SCALAPACK enabled : yes
  * ELPA enabled      : no

  * FCFLAGS           : -g -ffree-line-length-none  -fopenmp   -I/usr/local/include  -I/usr/local/include -I/usr/local/include -I/usr/local/include 
  * CPATH             : 

  * Build workflow    : monolith

Hi Mike,

try with this syntax like this ( my config… ) :

with_linalg_flavor="openblas"
LINALG_LIBS="-L/usr/local/OpenBLAS-0.3.10_gcc93/lib -lopenblas -lpthread"

note the “-L” + path of libs…

jmb