Configure --with-libxc fails because it uses wrong mkl flag
I cannot manage to compile the code with --with-libxc, the configure script always complains that
checking for libxc... no (-I/gpfsdswork/projects/rech/yhk/commun/libxc-4.3.4-intel_2020.1/include -L/gpfsdswork/projects/rech/yhk/commun/libxc-4.3.4-intel_2020.1/lib -lxcf90 -lxc)
configure: error: Could not find required libxc library.
The link line provide works perfectly fine outside configure. I could trace the error to the actual compilation line used during the test:
mpiifort -o conftest -I/gpfsdswork/projects/rech/yhk/commun/libxc-4.3.4-intel_2020.1/include -g conftest.f90 -L/gpfsdswork/projects/rech/yhk/commun/libxc-4.3.4-intel_2020.1/lib -lxcf90 -lxc -lmkl_intel_lp64
The problem are not the libxc switches, but -lmkl_intel_lp64 which is not found. I configure without libxc, it works and compile without any issues. My configure line is:
./configure FC=ifort F90=ifort F77=ifort CC=icc MPIF90=mpiifort --with-scalapack=intel --with-libxc --with-libxc-prefix=/gpfsdswork/projects/rech/yhk/commun/libxc-4.3.4-intel_2020.1 --with-libxc-include=/gpfsdswork/projects/rech/yhk/commun/libxc-4.3.4-intel_2020.1/include
I have attached config.logconfig.log