LibXC not working (abinit-9.6.2)

Hi all,

I am trying to compile abinit-9.6.2 on a new computer and am having some problems with the configuration. I will try to give as much info about the compilation:

  • compilers: Intel 2021.2, with MPI and MKL
  • libxc-4.2.3
  • xmlf90-1.5.4
  • libpsml-1.1.8
  • fallbacks: hdf5, netcdf, netcdf_fortran, libxc

I am compiling abinit with PSML support. I have just compiled siesta using the same libraries, and it works fine. Abinit seems to be happy with everything, but no matter what I do, it always says LibXC is not working. I tried building the fallback version but still get the same result.

Running with

…/configure --with-config-file=“make.ac9” FC=mpifort CC=mpicc

I have attached my .ac9 file and a log of the configuration below.

I think I have found the problem: From the config.out file you can see that it is not checking if LibXC has fortran support:

checking whether to enable LibXC… yes
checking how LibXC parameters have been set… env
checking for LibXC C preprocessing flags… -I/n/kaxiras_lab/dbennett/psml-libs/include
checking for LibXC C flags… none
checking for LibXC linker flags… none
checking for LibXC library flags… -L/n/kaxiras_lab/dbennett/psml-libs/lib -lxcf90 -lxc
checking whether the LibXC library works… no
checking whether the LibXC library has an old API… no

whereas with e.g. libpsml:

checking whether to enable LibPSML… yes
checking how LibPSML parameters have been set… env
checking for LibPSML C preprocessing flags… none
checking for LibPSML Fortran flags… -I/n/kaxiras_lab/dbennett/psml-libs/include
checking for LibPSML linker flags… none
checking for LibPSML library flags… -L/n/kaxiras_lab/dbennett/psml-libs/lib -lpsml -lxmlf90
checking whether the LibPSML Fortran interface works… yes

it is checking. I compiled it with fortran support, and have both libxc.a and libxcf90.a $ROOT_PSML/lib, but it doesn’t seem to look for the FC Flags.

Any help/advice greatly appreciated!

Daniel Bennett

make.ac9 (1.3 KB)

config.txt (39.7 KB)

config.log (223.7 KB)

Dear Daniel,

Can you include the config.log file that was also generated?

Yes, I have attached the config.log file in the original post.

Checking all the mentions of libxc, I found:

sd_libxc_cflags=‘’
sd_libxc_cppflags=‘-I/n/kaxiras_lab/dbennett/psml-libs/include’
sd_libxc_enable=‘yes’
sd_libxc_enable_def=‘yes’
sd_libxc_enable_fc=‘no’
sd_libxc_fcflags=‘’
sd_libxc_init=‘env’
sd_libxc_ldflags=‘’
sd_libxc_libs=‘-L/n/kaxiras_lab/dbennett/psml-libs/lib -lxcf90 -lxc’
sd_libxc_ok=‘no’
sd_libxc_options=‘required no-fortran warn’
sd_libxc_policy=‘warn’
sd_libxc_status=‘required’

Fortran support is definitely not enabled for libxc. Is there any way to tell configure to enable fortran support? I thought setting LIBXC_FCFLAGS would do that.

For reference, here is the result of ls in $ROOT_PSML/lib:

libpsml.a libpsml.so libpsml.so.0.0.0 libxcf03.a libxcf90.a libxc.la libxmlf90.la libxmlf90.so.0 pkgconfig libpsml.la libpsml.so.0 libxc.a libxcf03.la libxcf90.la libxmlf90.a libxmlf90.so libxmlf90.so.0.0.0

So I am pretty sure my libxc has fortran support. I also attach the config.log file for libxc here:

libxc-config.log (56.8 KB)

The error happens in the config.log at line 2443:

2443 configure:41074: mpicc -o conftest -g -O2 -I/n/kaxiras_lab/abinit-9.6.2/intel-21.2.0-fasrc01/fallbacks/install_fb/intel/2021.2/hdf5/1.10.6/include -I/n/kaxiras_lab/abinit-9.6.2/intel-21.2.0-fas rc01/fallbacks/install_fb/intel/2021.2/netcdf4/4.6.3/include -I/n/kaxiras_lab/abinit-9.6.2/intel-21.2.0-fasrc01/fallbacks/install_fb/intel/2021.2/netcdf4_fortran/4.5.2/include -I/n/kaxiras_lab/dbennett/ps ml-libs/include -static-intel -static-libgcc conftest.c -L/n/kaxiras_lab/dbennett/psml-libs/lib -lxcf90 -lxc -L/n/kaxiras_lab/dbennett/psml-libs/lib -lpsml -lxmlf90 -L/n/kaxiras_lab/dbennett/psml- libs/lib -lxmlf90 -L/n/kaxiras_lab/abinit-9.6.2/intel-21.2.0-fasrc01/fallbacks/install_fb/intel/2021.2/netcdf4_fortran/4.5.2/lib -lnetcdff -L/n/kaxiras_lab/abinit-9.6.2/intel-21.2.0-fasrc01/fallbacks/inst all_fb/intel/2021.2/netcdf4/4.6.3/lib -lnetcdf -L/n/kaxiras_lab/abinit-9.6.2/intel-21.2.0-fasrc01/fallbacks/install_fb/intel/2021.2/hdf5/1.10.6/lib -lhdf5_hl -L/n/kaxiras_lab/abinit-9.6.2/intel-21.2.0-fa src01/fallbacks/install_fb/intel/2021.2/hdf5/1.10.6/lib -lhdf5 -lz -ldl -lm -L/usr/lib64 -L/n/helmod/apps/centos7/Comp/intel/21.2.0-fasrc01/openmpi/4.1.1-fasrc01/lib64 -L/n/sw/intel-oneapi-2021/mkl/ 2021.2.0/lib/intel64 -L/n/sw/intel-oneapi-2021/tbb/2021.2.0/lib/intel64 -L/n/sw/intel-oneapi-2021/compiler/2021.2.0/linux/compiler/lib/intel64 -L/n/sw/intel-oneapi-2021/compiler/2021.2.0/linux/lib -L/n/sw/ intel-oneapi-2021/compiler/2021.2.0/linux/bin/intel64/…/…/compiler/lib/intel64_lin -L/n/helmod/apps/centos7/Comp/intel/21.2.0-fasrc01/openmpi/4.1.1-fasrc01/lib64/…/lib64 -L/n/helmod/apps/centos7/Comp/in tel/21.2.0-fasrc01/openmpi/4.1.1-fasrc01/lib64/…/lib64/ -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/n/sw/intel-oneapi-2021/mkl/2021.2.0/lib/intel64/ -L/n/helmod/apps/centos7/Comp/intel/21.2.0-fasrc01/openmpi/4.1.1-f asrc01/lib64/ -L/n/sw/intel-oneapi-2021/tbb/2021.2.0/lib/intel64/ -L/n/sw/intel-oneapi-2021/compiler/2021.2.0/linux/compiler/lib/intel64/ -L/n/sw/intel-oneapi-2021/compiler/2021.2.0/linux/lib/ -L/usr/lib/g cc/x86_64-redhat-linux/4.8.5/…/…/…/ -L/lib64 -L/lib/ -L/usr/lib -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lifport -lifcoremt -limf -lsvml -lm -lipgo -lirc -lpthread -lirc_s -ldl -lmpi > &5
2444 icc: warning #10237: -lcilkrts linked in dynamically, static library not available
2445 /n/kaxiras_lab/dbennett/psml-libs/lib/libpsml.so: undefined reference to `psml_die_’

A similar error was raised in a past issue. It seems the psml library might be interfering somehow. Maybe try to seperate the libs and incs of psml from libxc? I’m not familiar with psml. @beuken any idea?

Thanks for catching this! I don’t think I would have found it myself.

I recompiled libxc and libpsml in separate directories but that did not work. Following the issue reported in gitlab, I removed the *.so files from the libpsml library, and then it worked! I guess that prevented dynamic linking between libxc and libpsml?

Strange that this issue doesn’t occur when compiling siesta…

Thanks again,

Daniel

1 Like

To clarify things a little bit:

  • LibPSML does not depend on LibXC.
  • ABINIT only requires the C library of LibXC, since it has its own internal C to Fortran interface.

Everything should work fine when using the --with-libxc=/path/to/libxc/install/prefix option, which will take care of the linking details with LibXC.

1 Like

Yes, I thought it was strange since libpsml does not depend on libxc. I did try using the --with-libxc flag and was having the same problem, although I won’t reproduce the problem now since I finally have abinit compiled and working.

The reason I compiled libxc with fortran support is because it is required for siesta (at least I think it is). In future I will compile separate libraries for both codes.