Page 1 of 1

Linking error to MKL when building yambo-4.0.0-rev78

Posted: Thu May 14, 2015 9:11 am
by yunhailiseu
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

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

Posted: Thu May 14, 2015 12:16 pm
by Daniele Varsano
Dear Yunhai,
in order to spot the problem,
can you please post the config.log and the ./config/report files.

Best
Daniele

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

Posted: Thu May 14, 2015 1:01 pm
by yunhailiseu
Dear Daniele,

I have the config.log and config/report files in the attachment.
config.tar.gz
Best,
Yunhai

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

Posted: Mon May 18, 2015 8:06 am
by yunhailiseu
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.

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

Posted: Mon May 18, 2015 8:17 am
by Daniele Varsano
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