Undefined reference error when compiling ABINIT 8.10.2  [SOLVED]

option, parallelism,...

Moderators: jbeuken, Jordan, pouillon

Forum rules
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit builds.
For a video explanation on how to build Abinit for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
Post Reply
Tom Schoonjans
Posts: 2
Joined: Fri Feb 15, 2019 5:45 pm

Undefined reference error when compiling ABINIT 8.10.2  [SOLVED]

Post by Tom Schoonjans » Tue Feb 19, 2019 11:16 am

Hi,

I am compiling ABINIT 8.10.2 on our HPC cluster but got stuck with an undefined reference linking error:

Code: Select all

Making all in 98_main
make[3]: Entering directory `/home/vol03/scarf783/software/abinit-8.10.2/src/98_main'
mpif90 -free -module /home/vol03/scarf783/software/abinit-8.10.2/src/mods   -O3 -g -extend-source -noaltparam -nofpscomp  -qopenmp  -g -extend-source -noaltparam -nofpscomp  -qopenmp -static-intel -static-libgcc  -static-intel -static-libgcc  -o anaddb anaddb-anaddb.o -static-intel -static-libgcc  ../../src/77_ddb/lib77_ddb.a ../../src/72_response/lib72_response.a ../../src/69_wfdesc/lib69_wfdesc.a ../../src/68_rsprc/lib68_rsprc.a ../../src/67_common/lib67_common.a ../../src/66_vdwxc/lib66_vdwxc.a ../../src/66_wfs/lib66_wfs.a ../../src/66_nonlocal/lib66_nonlocal.a ../../src/65_paw/lib65_paw.a ../../src/64_psp/lib64_psp.a ../../src/62_wvl_wfs/lib62_wvl_wfs.a ../../src/62_poisson/lib62_poisson.a ../../src/62_iowfdenpot/lib62_iowfdenpot.a ../../src/62_cg_noabirule/lib62_cg_noabirule.a ../../src/62_ctqmc/lib62_ctqmc.a ../../src/62_cg_noabirule/lib62_cg_noabirule.a ../../src/61_occeig/lib61_occeig.a ../../src/59_ionetcdf/lib59_ionetcdf.a ../../src/57_iovars/lib57_iovars.a ../../src/57_iopsp_parser/lib57_iopsp_parser.a ../../src/56_recipspace/lib56_recipspace.a ../../src/56_xc/lib56_xc.a ../../src/56_mixing/lib56_mixing.a ../../src/56_io_mpi/lib56_io_mpi.a ../../src/55_abiutil/lib55_abiutil.a ../../src/54_spacepar/lib54_spacepar.a ../../src/53_ffts/lib53_ffts.a ../../src/52_fft_mpi_noabirule/lib52_fft_mpi_noabirule.a ../../src/51_manage_mpi/lib51_manage_mpi.a ../../src/49_gw_toolbox_oop/lib49_gw_toolbox_oop.a ../../src/45_geomoptim/lib45_geomoptim.a ../../src/44_abitypes_defs/lib44_abitypes_defs.a ../../src/44_abitools/lib44_abitools.a ../../src/43_wvl_wrappers/lib43_wvl_wrappers.a ../../src/43_ptgroups/lib43_ptgroups.a ../../src/42_parser/lib42_parser.a ../../src/42_nlstrain/lib42_nlstrain.a ../../src/42_libpaw/lib42_libpaw.a ../../src/41_xc_lowlevel/lib41_xc_lowlevel.a ../../src/41_geometry/lib41_geometry.a ../../src/32_util/lib32_util.a ../../src/29_kpoints/lib29_kpoints.a ../../src/28_numeric_noabirule/lib28_numeric_noabirule.a ../../src/27_toolbox_oop/lib27_toolbox_oop.a ../../src/21_hashfuncs/lib21_hashfuncs.a ../../src/18_timing/lib18_timing.a ../../src/17_libtetra_ext/lib17_libtetra_ext.a ../../src/16_hideleave/lib16_hideleave.a  ../../src/14_hidewrite/lib14_hidewrite.a ../../src/12_hide_mpi/lib12_hide_mpi.a ../../src/11_memory_mpi/lib11_memory_mpi.a ../../src/10_dumpinfo/lib10_dumpinfo.a ../../src/10_defs/lib10_defs.a ../../src/02_clib/lib02_clib.a -L/apps/contrib/dls-spectroscopy/netcdf/4.6.2-intel2018/lib -lnetcdff -lnetcdf -L/apps/contrib/dls-spectroscopy/libxc/4.2.3-intel2018/lib -lxcf90 -lxc -lfftw3 -L/apps/contrib/dls-spectroscopy/scalapack/2.0.2-intel-2018/lib -lscalapack -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lrt -L/opt/ibm/platform_mpi/lib/linux_amd64 -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin -L/apps/intel/2018/clck/2018.3/lib/intel64 -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/ipp/lib/intel64 -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7 -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/daal/lib/intel64_lin -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64_lin/gcc4.4 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/ -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/ -L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 -L/usr/lib/../lib64/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin/ -L/apps/intel/2018/clck/2018.3/lib/intel64/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/ipp/lib/intel64/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/daal/lib/intel64_lin/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64_lin/gcc4.4/ -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../ -L/lib64 -L/lib/ -L/usr/lib64 -L/usr/lib -lpcmpio -lpcmpi -ldl -lifport -lifcoremt -limf -lsvml -lm -lipgo -lirc -lpthread -lirc_s -L/opt/ibm/platform_mpi/lib/linux_amd64 -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin -L/apps/intel/2018/clck/2018.3/lib/intel64 -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/ipp/lib/intel64 -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7 -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/daal/lib/intel64_lin -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64_lin/gcc4.4 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/ -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/ -L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 -L/usr/lib/../lib64/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/mkl/lib/intel64_lin/ -L/apps/intel/2018/clck/2018.3/lib/intel64/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/ipp/lib/intel64/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/compiler/lib/intel64_lin/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64/gcc4.7/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/daal/lib/intel64_lin/ -L/apps/intel/2018/compilers_and_libraries_2018.3.222/linux/tbb/lib/intel64_lin/gcc4.4/ -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../ -L/lib64 -L/lib/ -L/usr/lib64 -L/usr/lib -lpcmpio -lpcmpi -ldl -lifport -lifcoremt -limf -lsvml -lm -lipgo -lirc -lpthread -lirc_s
../../src/32_util/lib32_util.a(m_special_funcs.o): In function `m_special_funcs_mp_gamma_function_':
/home/vol03/scarf783/software/abinit-8.10.2/src/32_util/m_special_funcs.F90:1050: undefined reference to `gsl_f90_sf_gamma_'
make[3]: *** [anaddb] Error 1


I invoked configure as:

Code: Select all

./configure --prefix=/apps/contrib/dls-spectroscopy/abinit/8.10.2-intel2018 CC=mpicc CXX=mpiCC FC=mpif90 F77=mpif77 --enable-mpi=yes --enable-openmp=yes --with-linalg-flavor=mkl+scalapack --with-linalg-libs="-L/apps/contrib/dls-spectroscopy/scalapack/2.0.2-intel-2018/lib -lscalapack -L$MKL_LIBS -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core" --with-math-flavor=gsl --with-dft-flavor=libxc --with-libxc-incs=-I/apps/contrib/dls-spectroscopy/libxc/4.2.3-intel2018/include --with-libxc-libs="-L/apps/contrib/dls-spectroscopy/libxc/4.2.3-intel2018/lib -lxcf90 -lxc" --with-fft-flavor=fftw3-mkl --with-trio-flavor=netcdf  --with-etsf-io-incs=-I/apps/contrib/dls-spectroscopy/etsf_io/1.0.4-intel2018/include --with-etsf-io-libs="-L/apps/contrib/dls-spectroscopy/etsf_io/1.0.4-intel2018/lib -letsf_io_low_level -letsf_io_utils -letsf_io" --with-netcdf-incs=-I/apps/contrib/dls-spectroscopy/netcdf/4.6.2-intel2018/include --with-netcdf-libs="-L/apps/contrib/dls-spectroscopy/netcdf/4.6.2-intel2018/lib -lnetcdff -lnetcdf"


Going through the code shows that gsl_f90_sf_gamma_ is implemented in src/01_gsl_ext/gsl_f90_sf_gamma.c and ends up getting compiled into src/01_gsl_ext/lib01_gsl_ext.a which does not get linked in thereby triggering the linker error...

Can you explain me how I can add explicit linking against lib01_gsl_ext.a? I am usually quite confident hacking autotools projects but ABINIT's buildsystem is quite scary :-)

User avatar
jbeuken
Posts: 312
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

Re: Undefined reference error when compiling ABINIT 8.10.2

Post by jbeuken » Tue Feb 19, 2019 3:00 pm

Hi,

it's a bug...

I reproduced the problem with abinit 8.11.5 under ubuntu 18.10.2 with packages gnu 7.3 / libgsl-dev
------
Jean-Michel Beuken
Computer Scientist

Tom Schoonjans
Posts: 2
Joined: Fri Feb 15, 2019 5:45 pm

Re: Undefined reference error when compiling ABINIT 8.10.2

Post by Tom Schoonjans » Tue Feb 19, 2019 4:52 pm

Thanks for confirming the issue quickly.

Is there a way for me to fix this quickly?

Thanks,

Tom

User avatar
jbeuken
Posts: 312
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

Re: Undefined reference error when compiling ABINIT 8.10.2

Post by jbeuken » Tue Feb 19, 2019 10:41 pm

Tom,

I made a patch for the next release ( 8.10.3 )

the problem affects not only anaddb, but 11 other binaries

here is a "simple" workaround made for anaddb but you must repeat these steps for all other binaries :roll: :
    1) in src/98_main, edit the Makefile
    2) search : anaddb_LDADD
    3) after "$(LIB_02_CLIB) \" add "$(LIB_01_GSL_EXT) \"
    4) after "-L/usr/lib/x86_64-linux-gnu/ -lnetcdf -lnetcdff \" add "-L/usr/lib/x86_64-linux-gnu -lgsl -lgslcblas -lm \"
caution :
- Makefile doesn't like spaces at the beginning of the line: use tab
- the PATH of gsl libs and the names of libs are for ubuntu packages ( 18.04 )


repeat for theses binaries if you need it
    conducti
    cut3d
    ioprof
    fold2Bloch
    mrgddb
    mrgdv
    mrggkk
    mrgscr
    optic
    tdep
    ujdet

good luck ;)
------
Jean-Michel Beuken
Computer Scientist

User avatar
jbeuken
Posts: 312
Joined: Tue Aug 18, 2009 9:24 pm
Contact:

Re: Undefined reference error when compiling ABINIT 8.10.2

Post by jbeuken » Wed Feb 20, 2019 4:38 pm

------
Jean-Michel Beuken
Computer Scientist

User avatar
pouillon
Posts: 646
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

Re: Undefined reference error when compiling ABINIT 8.10.2

Post by pouillon » Tue Mar 05, 2019 4:56 pm

Please note that GSL support is about to be removed because it is highly marginal and unmaintained. The only call to it occurs in src/32_util/m_special_funcs.F90.

You can safely leave it disabled.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

Post Reply