Page 1 of 1

Error in [Linking yambo] in 5.0.4

Posted: Wed Nov 03, 2021 2:25 pm
by yhypku
Dear developers,
I'm getting an error in the [Linking yambo] step. First I configure with command "./configure CC=icc FC=ifort CPP=cpp MPIFC=mpiifort". I copy the "liblapack.a" and "libblas.a" from compiled lapack-3.9.0 to /yambo-5.0.4/lib/external/intel/mpiifort/lib/. Then during "make all", errors appear as follows.

>>>[Linking yambo]<<<
make[2]: Entering directory `/gpfs/share/home/1500012896/software/yambo-5.0.4/driver'

/gpfs/share/home/1500012896/software/yambo-5.0.4/lib/external/intel/mpiifort/lib/liblapack.a(dtrtri.f.o): In function `dtrtri_':
dtrtri.f:(.text+0x13d): undefined reference to `_gfortran_concat_string'
/gpfs/share/home/1500012896/software/yambo-5.0.4/lib/external/intel/mpiifort/lib/liblapack.a(cgesvd.f.o): In function `cgesvd_':
cgesvd.f:(.text+0x36c): undefined reference to `_gfortran_concat_string'
cgesvd.f:(.text+0x5a8): undefined reference to `_gfortran_concat_string'
cgesvd.f:(.text+0xd21): undefined reference to `_gfortran_concat_string'
/gpfs/share/home/1500012896/software/yambo-5.0.4/lib/external/intel/mpiifort/lib/liblapack.a(chseqr.f.o): In function `chseqr_':
chseqr.f:(.text+0x3bf): undefined reference to `_gfortran_concat_string'
/gpfs/share/home/1500012896/software/yambo-5.0.4/lib/external/intel/mpiifort/lib/liblapack.a(ctrevc3.f.o):ctrevc3.f:(.text+0x1a7): more undefined references to `_gfortran_concat_string' follow
/gpfs/share/home/1500012896/software/yambo-5.0.4/lib/external/intel/mpiifort/lib/liblapack.a(ilaenv.f.o): In function `ilaenv_':
ilaenv.f:(.text+0x59): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0x276): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0x29f): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0x2d9): undefined reference to `_gfortran_compare_string'
ilaenv.f:(.text+0x2fa): undefined reference to `_gfortran_compare_string'
/gpfs/share/home/1500012896/software/yambo-5.0.4/lib/external/intel/mpiifort/lib/liblapack.a(ilaenv.f.o):ilaenv.f:(.text+0x319): more undefined references to `_gfortran_compare_string' follow
/gpfs/share/home/1500012896/software/yambo-5.0.4/lib/external/intel/mpiifort/lib/liblapack.a(xerbla.f.o): In function `xerbla_':
xerbla.f:(.text+0x49): undefined reference to `_gfortran_st_write'
xerbla.f:(.text+0x54): undefined reference to `_gfortran_string_len_trim'
xerbla.f:(.text+0x66): undefined reference to `_gfortran_transfer_character_write'
xerbla.f:(.text+0x76): undefined reference to `_gfortran_transfer_integer_write'
xerbla.f:(.text+0x7e): undefined reference to `_gfortran_st_write_done'
xerbla.f:(.text+0x87): undefined reference to `_gfortran_stop_string'
make[2]: *** [yambo] Error 1
make[2]: Leaving directory `/gpfs/share/home/1500012896/software/yambo-5.0.4/driver'
make[1]: *** [yambo] Error 2
make[1]: Leaving directory `/gpfs/share/home/1500012896/software/yambo-5.0.4'
yambo build failed

Can you tell me how to fix it?
Best,
Huaiyuan

Re: Error in [Linking yambo] in 5.0.4

Posted: Wed Nov 03, 2021 3:52 pm
by andrea.ferretti
Dear Huaiyuan,

it seems your bias and lapack libraries are compiled with gfortran, while you are using the intel compilers, which causes the problem.
I would avoid copying blas and lapack by hand, while I would specify the proper libraries when running configure, eg:

Code: Select all

MKLROOT=/opt/intel/compilers_and_libraries_2020.0.166/linux/mkl

./configure \
  FC=ifort \
  CC=icc \
  --with-fft-libs="-mkl" \
  --with-blas-libs="-L$MKLROOT -lmkl_intel_lp64  -lmkl_sequential -lmkl_core " \
  --with-lapack-libs="-L$MKLROOT -lmkl_intel_lp64  -lmkl_sequential -lmkl_core " \
  --with-scalapack-libs="-L$MKLROOT -lmkl_scalapack_lp64 " \
  --with-blacs-libs="-L$MKLROOT -lmkl_blacs_intelmpi_lp64 " \
[...]
hope it helps
Andrea

Re: Error in [Linking yambo] in 5.0.4

Posted: Mon Dec 02, 2024 8:37 am
by burkzdemir
Dear Yambo Community,

I also have a similar linking problem for Yambo-5.2.4 for blas and lapack. I attached my config.log. And below is the compile_yambo.log;

*************************
ar -r libbse.a K_observables.o
ar -r libbse.a K_multiply_by_V.o
ar -r libbse.a K_multiply_by_V_transpose.o
ar -r libbse.a K_dot_product.o
ar -r libbse.a K_components_folded_in_serial_arrays.o
ar -r libbse.a K_stored_in_a_big_matrix.o
ar -r libbse.a K_diago_kerr_residual.o
ar -r libbse.a K_diago_magnons_residual.o
ar -r libbse.a PL_diago_residual.o
ar -r libbse.a PL_via_perturbative_inversion.o
mv libbse.a /arf/home/mkamislioglu/burak/yambo-5.2.4/lib
gfortran -E -P -cpp -D_HDF5_LIB -D_HDF5_IO -D_PAR_IO -D_MPI -D_FFTW -D_TIMING -D_linux -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/headers/common -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/headers/parser -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/yambo/Ydriver/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/driver -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/version -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/include/ -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/v4/parallel/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/v4/parallel/include -I/arf/sw/lib/hdf5/1.14.3-openmpi-5.0.0/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/include/ -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/yambo/Ydriver/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/driver -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/version /arf/home/mkamislioglu/burak/yambo-5.2.4/driver/yambo.F >> yambo.tmp_source
mpifort -c -O3 -g -mtune=native -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/headers/common -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/headers/parser -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/yambo/Ydriver/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/driver -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/version -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/include/ -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/v4/parallel/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/v4/parallel/include -I/arf/sw/lib/hdf5/1.14.3-openmpi-5.0.0/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/include/ -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/yambo/Ydriver/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/driver -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/version yambo.f90
mpicc -I/arf/sw/lib/hdf5/szip-2.1.1-openmpi-5.0.0/include -I/arf/sw/lib/hdf5/zlib-1.3-openmpi-5.0.0/include -I/arf/sw/lib/hdf5/1.14.3-openmpi-5.0.0/include -D_C_US -D_FORTRAN_US -D_HDF5_LIB -D_HDF5_IO -D_PAR_IO -D_MPI -D_FFTW -D_TIMING -D_linux -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/headers/common -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/headers/parser -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/yambo/Ydriver/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/driver -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/version -L/arf/home/mkamislioglu/burak/yambo-5.2.4/lib -D_yambo -c /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/yambo/Ydriver/src/driver/driver.c
mpifort -O3 -g -mtune=native -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/headers/common -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/headers/parser -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/yambo/Ydriver/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/driver -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/version -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/include/ -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/v4/parallel/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/v4/parallel/include -I/arf/sw/lib/hdf5/1.14.3-openmpi-5.0.0/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/include/ -I/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/yambo/Ydriver/include -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/driver -I/arf/home/mkamislioglu/burak/yambo-5.2.4/include/version -o yambo driver.o yambo.o -L/arf/home/mkamislioglu/burak/yambo-5.2.4/lib -lbse -lacfdt -lqp -lpol_function -ldipoles -ltddft -lsetup -lqp_control -linterpolate -lcoulomb -lwf_and_fft -lstop_and_restart -linterface -lxc_functionals -lio_parallel -lio -lYio -ltiming -lcommon -loutput -lparser -lparallel -lbz_ops -llinear_algebra -lmatrices -lmodules -lcommunicate -lallocations -lmemory -ltools -lyambo_Ydriver_main -lyambo_Ydriver_interface -lyambo_Ydriver_options -ldriver -lqe_pseudo -lmath77 -lslatec -llocal /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/lib/liblapack.a /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/lib/libblas.a /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/lib/libiotk.a /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/v4/parallel/lib/libnetcdff.a /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/v4/parallel/lib/libnetcdf.a -L/arf/sw/lib/hdf5/1.14.3-openmpi-5.0.0/lib /arf/sw/lib/hdf5/1.14.3-openmpi-5.0.0/lib/libhdf5hl_fortran.a /arf/sw/lib/hdf5/1.14.3-openmpi-5.0.0/lib/libhdf5_hl.a /arf/sw/lib/hdf5/1.14.3-openmpi-5.0.0/lib/libhdf5_fortran.a /arf/sw/lib/hdf5/1.14.3-openmpi-5.0.0/lib/libhdf5.a -L/arf/sw/lib/hdf5/zlib-1.3-openmpi-5.0.0/lib -L/arf/sw/lib/hdf5/szip-2.1.1-openmpi-5.0.0/lib -L/arf/sw/lib/openmpi/5.0.0/lib -lsz -lz -ldl -lm -Wl,-rpath -Wl,/arf/sw/lib/hdf5/1.14.3-openmpi-5.0.0/lib /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/lib/libxcf90.a /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/lib/libxcf03.a /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/lib/libxc.a /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/lib/libfftw3.a -lm
/usr/bin/ld: cannot find /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/lib/liblapack.a: No such file or directory
/usr/bin/ld: cannot find /arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/lib/libblas.a: No such file or directory

Re: Error in [Linking yambo] in 5.0.4

Posted: Mon Dec 02, 2024 2:42 pm
by Daniele Varsano
Dear Burak,
it seems that lapack and blas libs are not present in the indicated directory.
/arf/home/mkamislioglu/burak/yambo-5.2.4/lib/external/gfortran/mpifort/lib/

So most probably either they have not be compiled or there was a previous error in the compilation.
I suggest you to recompile from scratch:

make distclean
./configure ...
make yambo

and check what happen when blas and lapack are compiled.

Best,

Daniele

Re: Error in [Linking yambo] in 5.0.4

Posted: Tue Dec 03, 2024 9:38 am
by burkzdemir
I checked and it seems they that they are installed. But, libblas.a and liblapack.a files are in /lib64 and not in /lib and the compilation is searching for these files in /lib. How can I solve this problem?

Re: Error in [Linking yambo] in 5.0.4

Posted: Wed Dec 04, 2024 9:21 am
by Daniele Varsano
Dear Burak,
you can redirect the path of the libraries with the configure command line:

Code: Select all

./configure 
--with-blas-libs="-L$PATH/lib64 -lblas" \
--with-lapack-libs="-L$PATH/lib64 -llapack" \
where you insert the full path where the libs are located.

Best,

Daniele

Re: Error in [Linking yambo] in 5.0.4

Posted: Tue Dec 10, 2024 4:01 pm
by burkzdemir
Dear Daniele,

I compiled successfully with your suggestion. But, now I can only run serially. If I run parallel, then I get the following error;

/yambo-5.2.4/bin/yambo: error while loading shared libraries: liblapack.so.3: cannot open shared object file: No such file or directory

Re: Error in [Linking yambo] in 5.0.4

Posted: Wed Dec 11, 2024 3:55 pm
by burkzdemir
I only get this error if I submit with job scheduler. If I directly submit from command line with mpirun then it runs successfully. I don't understand why I am getting this error when submit the job with sbatch.

Error: /yambo-5.2.4/bin/yambo: error while loading shared libraries: liblapack.so.3: cannot open shared object file: No such file or directory

Re: Error in [Linking yambo] in 5.0.4

Posted: Thu Dec 12, 2024 11:40 am
by Daniele Varsano
Dear Burak,

most probably, you need to set up the right environment inside the sbatch script, either loading the appropriate modules or setting the path by hand.
Something like:
EXPORT LD_LIBRARY_PATH=path_to_lapack_libs:$LD_LIBRARY_PATH

Best,
Daniele