Linking error to MKL when building yambo-4.0.0-rev78

Having trouble compiling the Yambo source? Using an unusual architecture? Problems with the "configure" script? Problems in GPU architectures? This is the place to look.

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano, Conor Hogan, Nicola Spallanzani

Forum rules
If you have trouble compiling Yambo, please make sure to list:
(1) the compiler (vendor and release: e.g. intel 10.1)
(2) the architecture (e.g. 64-bit IBM SP5)
(3) if the problems occur compiling in serial/in parallel
(4) the version of Yambo (revision number/major release version)
(5) the relevant compiler error message
Post Reply
yunhailiseu
Posts: 21
Joined: Fri Nov 29, 2013 1:30 pm

Linking error to MKL when building yambo-4.0.0-rev78

Post by yunhailiseu » Thu May 14, 2015 9:11 am

Dear Yambo Team,

I tried to build yambo-4.0.0-rev78 TH-1A super computer linking to MKL static libraries. Unfortunately, I ran into linking errors like this.


>>>[Linking yambo]<<<
make[1]: Entering directory `/vol-th/home/jlwang/workspace/yhli/yambo-4.0.0-rev78/driver'
yambo_driver.F
/vol-th/home/jlwang/workspace/yhli/yambo-4.0.0-rev78/lib/libslatec.a(r1mach.o): In function `r1mach_':
r1mach.f:(.text+0x64): undefined reference to `slamch_'
r1mach.f:(.text+0x7d): undefined reference to `slamch_'
r1mach.f:(.text+0x96): undefined reference to `slamch_'
r1mach.f:(.text+0xaf): undefined reference to `slamch_'
r1mach.f:(.text+0xc8): undefined reference to `slamch_'
make[1]: *** [yambo] Error 1
make[1]: Leaving directory `/vol-th/home/jlwang/workspace/yhli/yambo-4.0.0-rev78/driver'
make: *** [yambo] Error 2


Below are my configurations for the static version

Code: Select all

export CC=icc
export FC=ifort
export F77=ifort
export PFC=mpif90
export MPICC=mpicc

export CFLAGS=-O2
export FCFLAGS=-O2
export FFLAGS=-O2

export mkldir=/opt/intel/composer_xe_2013.0.079/mkl/lib/intel64
export fftwdir=$HOME/lib/fftw-3.3.4
export iotkdir=$HOME/workspace/yhli/code/espresso-5.1.1/S3DE/iotk
export netcdfdir=$HOME/lib/netcdf-4.3.2
export libxcdir=$HOME/lib/libxc-2.1.1

./configure \
\
  --disable-debug --enable-time-profile \
  --disable-open-mp --enable-3d-fft --enable-iotk --enable-netcdf \
\
  --with-blas-libs="-Wl,--start-group $mkldir/libmkl_intel_lp64.a $mkldir/libmkl_sequential.a $mkldir/libmkl_core.a -Wl,--end-group" \
  --with-lapack-libs="-Wl,--start-group $mkldir/libmkl_intel_lp64.a $mkldir/libmkl_sequential.a $mkldir/libmkl_core.a -Wl,--end-group" \
  --with-blacs-libs="$mkldir/libmkl_blacs_intelmpi_lp64.a" \
  --with-scalapack-libs="$mkldir/libmkl_scalapack_lp64.a" \
\
  --with-fft-libs="-L$fftwdir/lib -lfftw3" \
  --with-fft-path=$fftwdir \
\
  --with-p2y-version=5.0 \
  --with-iotk-libs=$iotkdir/tools/iotk \
  --with-iotk-path=$iotkdir \
\
  --with-netcdf-libs="-L$netcdfdir/lib -lnetcdff -lnetcdf" \
  --with-netcdf-path=$netcdfdir \
\
  --with-libxc-libs="-L$libxcdir/lib -lxc" \
  --with-libxc-path=$libxcdir

It is very strange that similar configuration works for yambo 3.x. Also, the compilation is successful if I use MKL dynamic libraries with the follow configuration

Code: Select all

export CC=icc
export FC=ifort
export F77=ifort
export PFC=mpif90
export MPICC=mpicc

export CFLAGS=-O2
export FCFLAGS=-O2
export FFLAGS=-O2

export mkldir=/opt/intel/composer_xe_2013.0.079/mkl/lib/intel64
export fftwdir=$HOME/lib/fftw-3.3.4
export iotkdir=$HOME/workspace/yhli/code/espresso-5.1.1/S3DE/iotk
export netcdfdir=$HOME/lib/netcdf-4.3.2
export libxcdir=$HOME/lib/libxc-2.1.1

./configure \
\
  --disable-debug --enable-time-profile \
  --disable-open-mp --enable-3d-fft --enable-iotk --enable-netcdf \
\
  --with-blas-libs="-L$mkldir -lmkl_intel_lp64 -lmkl_sequential -lmkl_core" \
  --with-lapack-libs="-L$mkldir -lmkl_intel_lp64 -lmkl_sequential -lmkl_core" \
  --with-blacs-libs="-L$mkldir -lmkl_blacs_intelmpi_lp64" \
  --with-scalapack-libs="-L$mkldir -lmkl_scalapack_lp64" \
\
  --with-fft-libs="-L$fftwdir/lib -lfftw3" \
  --with-fft-path=$fftwdir \
\
  --with-p2y-version=5.0 \
  --with-iotk-libs=$iotkdir/tools/iotk \
  --with-iotk-path=$iotkdir \
\
  --with-netcdf-libs="-L$netcdfdir/lib -lnetcdff -lnetcdf" \
  --with-netcdf-path=$netcdfdir \
\
  --with-libxc-libs="-L$libxcdir/lib -lxc" \
  --with-libxc-path=$libxcdir
Due to potential conflicts with other programs, I cannot modify the LD_LIBRARY_PATH variable. Linking to static MKL libraries seems to be the only solution.

Any suggestions are appreciated.

Best,
Yunhai
Yunhai Li
Department of Physics, Southeast University
Nanjing, Jiangsu, PRC

User avatar
Daniele Varsano
Posts: 4198
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: Linking error to MKL when building yambo-4.0.0-rev78

Post by Daniele Varsano » Thu May 14, 2015 12:16 pm

Dear Yunhai,
in order to spot the problem,
can you please post the config.log and the ./config/report files.

Best
Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

yunhailiseu
Posts: 21
Joined: Fri Nov 29, 2013 1:30 pm

Re: Linking error to MKL when building yambo-4.0.0-rev78

Post by yunhailiseu » Thu May 14, 2015 1:01 pm

Dear Daniele,

I have the config.log and config/report files in the attachment.
config.tar.gz
Best,
Yunhai
You do not have the required permissions to view the files attached to this post.
Yunhai Li
Department of Physics, Southeast University
Nanjing, Jiangsu, PRC

yunhailiseu
Posts: 21
Joined: Fri Nov 29, 2013 1:30 pm

Re: Linking error to MKL when building yambo-4.0.0-rev78

Post by yunhailiseu » Mon May 18, 2015 8:06 am

Well, this problem is temporarily resolved with the help of -rpath flag.

In fact, the reason why I have to use static libraries is that yambo built upon the MKL shipped with Intel Compiler 11.1.046 (the one installed on the super-computer) produces erroneous results. I have to keep a local copy of MKL of higher version, but are nor permitted to modify LD_LIBRARY_PATH in ~/.bashrc as many other users share the same user account with me.

Now I link compile yambo using dynamic linking, with the -rpath flag pointing to the directory where the local copy of MKL resides.
Yunhai Li
Department of Physics, Southeast University
Nanjing, Jiangsu, PRC

User avatar
Daniele Varsano
Posts: 4198
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: Linking error to MKL when building yambo-4.0.0-rev78

Post by Daniele Varsano » Mon May 18, 2015 8:17 am

Dear yunhai,
I'm very glad you solved the problem. Indeed from the configurare there are option to point to the desired path. See options by typing:

Code: Select all

./configure -h
Best
Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

Post Reply