Compilation problems

aldol chan... at
Sun Nov 9 19:28:52 UTC 2014

I am new to cp2k and am trying to install its parallel  version.
I downloaded the BLAS, LAPACK and SCALAPACK libraries
and installed them as follows:

Installing BLAS
gunzip blas.tgz
tar -xvf blas.tar
gfortran -c -O3 *.f
ar rv libblas.a *.o

Installing LAPACK
tar -xvf lapack-3.5.0.tar
cd lapack-3.5.0
cp INSTALL/ ./
change BLASLIB = ../../librefblas.a to 
make 1> make.out 2>&1 &

Installing SCALAPACK
tar -xvf scalapack-2.0.2.tar
cd scalapack-2.0.2

Then I change FC = mpif90 
CC = mpicc 

BLASLIB= -lblas 
BLASLIB= -lblas -L/home/rbs/chandan/softs/forcp2k/BLAS/

LAPACKLIB = -llapack 
LAPACKLIB = -llapack -L/home/rbs/chandan/softs/forcp2k/lapack-3.5.0/

make 1> make.out 2>&1 &

My arch file is as follows:
CC         = /home/rbs/chandan/softs/openmpi-1.8.3-gcc-4.9.1/bin/mpicc
CPP        =
FC         = /home/rbs/chandan/softs/openmpi-1.8.3-gcc-4.9.1/bin/mpif90
LD         = /home/rbs/chandan/softs/openmpi-1.8.3-gcc-4.9.1/bin/mpif90
AR         = ar -r
FFTW_LIB   = /home/rbs/chandan/softs/fftw-3.3.4-openmpi-1.8.3-gcc-4.9.1/lib
LIBINT_INC = /home/rbs/chandan/softs/LIBINT/include
LIBINT_LIB = /home/rbs/chandan/softs/LIBINT/lib
LIBXC_INC  = /home/rbs/chandan/softs/LIBXC/include
LIBXC_LIB  = /home/rbs/chandan/softs/LIBXC/lib
LIBBLAS    = /home/rbs/chandan/softs/forcp2k/BLAS
LIBLAPACK  = /home/rbs/chandan/softs/forcp2k/lapack-3.5.0
LIBSCALAPACK = /home/rbs/chandan/softs/forcp2k/scalapack-2.0.2

             -D__LIBINT_MAX_AM=7 -D__LIBDERIV_MAX_AM1=6 -D__MAX_CONTR=4\
             -D__parallel -D__BLACS -D__SCALAPACK
FCFLAGS    = $(DFLAGS) -O2 -ffast-math -ffree-form -ffree-line-length-none\
             -ftree-vectorize -funroll-loops \
             -I$(ACML_INC) -I$(FFTW_INC) -I$(LIBINT_INC) -I$(LIBXC_INC)
LDFLAGS    = $(FCFLAGS) -static-libgfortran
LIBS       = $(FFTW_LIB)/libfftw3.a\
             $(LIBBLAS)/libblas.a \
             $(LIBLAPACK)/liblapack.a \
             $(LIBLAPACK)/libtmglib.a \


Now cp2k compilation stops with the error:

Warning: size of symbol `build_eri' changed from 19208 in 
to 5000 in /home/rbs/chandan/softs/LIBINT/lib/libint.a(init_libint.o)
/home/rbs/chandan/softs/forcp2k/lapack-3.5.0/liblapack.a(strtri.o): In 
function `strtri_':
strtri.f:(.text+0x264): undefined reference to `strmm_'
strtri.f:(.text+0x2ac): undefined reference to `strsm_'
strtri.f:(.text+0x580): undefined reference to `strmm_'
strtri.f:(.text+0x5eb): undefined reference to `strsm_'
/home/rbs/chandan/softs/forcp2k/lapack-3.5.0/liblapack.a(dgecon.o): In 
function `dgecon_':
dgecon.f:(.text+0x3d6): undefined reference to `idamax_'
/home/rbs/chandan/softs/forcp2k/lapack-3.5.0/liblapack.a(dgetri.o): In 
function `dgetri_':
dgetri.f:(.text+0x2ee): undefined reference to `dswap_'
/home/rbs/chandan/softs/forcp2k/lapack-3.5.0/liblapack.a(dlacn2.o): In 
function `dlacn2_':
dlacn2.f:(.text+0xb1): undefined reference to `dasum_'
dlacn2.f:(.text+0x130): undefined reference to `dasum_'
dlacn2.f:(.text+0x1ff): undefined reference to `idamax_'
dlacn2.f:(.text+0x2c0): undefined reference to `idamax_'
dlacn2.f:(.text+0x348): undefined reference to `dasum_'

The problem seems that these functions are not present in liblapack.a 
So I checked using:
nm -A libblas.a |grep strmm
The output was:
libblas.a:strmm.o:0000000000000000 r .LC8
libblas.a:strmm.o:                 U lsame_
libblas.a:strmm.o:                 U memset
libblas.a:strmm.o:0000000000000000 T strmm_
libblas.a:strmm.o:                 U xerbla_

nm -A liblapack.a |grep strmm
The output was:
liblapack.a:sgehrd.o:                 U strmm_
liblapack.a:slahr2.o:                 U strmm_
liblapack.a:slaqr5.o:                 U strmm_
liblapack.a:slarfb.o:                 U strmm_
liblapack.a:slarzb.o:                 U strmm_
liblapack.a:slauum.o:                 U strmm_
liblapack.a:ssygst.o:                 U strmm_
liblapack.a:ssygv.o:                 U strmm_
liblapack.a:ssygvd.o:                 U strmm_
liblapack.a:ssygvx.o:                 U strmm_
liblapack.a:ssytri2x.o:                 U strmm_
liblapack.a:strtri.o:                 U strmm_
liblapack.a:spftri.o:                 U strmm_
liblapack.a:stftri.o:                 U strmm_
liblapack.a:sgeqrt3.o:                 U strmm_
liblapack.a:stprfb.o:                 U strmm_

SO my guess is that the function strmm_ is present in BLAS.

Is this a linking issue ?? If so how to do the correctly link BLAS, LAPACK 
Did I miss some flags in the arch file ?

Any help would be deeply appreciated.

I am attaching the output files from make for the libraries and cp2k.

Thanks in advance,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make-lapack.out
Type: application/octet-stream
Size: 188290 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make-scalapack.out
Type: application/octet-stream
Size: 269861 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make-cp2k.out
Type: application/octet-stream
Size: 920189 bytes
Desc: not available
URL: <>

More information about the CP2K-user mailing list