Compilation problems

Matthias Krack matthia... at psi.ch
Mon Nov 10 07:49:01 UTC 2014


Hi,

I would try to change the order of the libraries in the link step, because 
this matters. Just check the arch files in cp2k/arch to get an idea of an 
appropriate order. The usual link order is libscalapack, liblapack, and 
then libblas. The libtmglib is not needed.

Matthias

On Sunday, 9 November 2014 20:28:52 UTC+1, aldol wrote:
>
> Hi,
> 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
> cd BLAS
> 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/make.inc.gfortran ./make.inc
> change BLASLIB = ../../librefblas.a to 
> BLASLIB=~/chandan/softs/forcp2k/BLAS/libblas.a
> make 1> make.out 2>&1 &
>
> Installing SCALAPACK
> tar -xvf scalapack-2.0.2.tar
> cd scalapack-2.0.2
> cp SLmake.inc.example SLmake.inc
> vi SLmake.inc
>
> Then I change FC = mpif90 
> to 
> FC=/home/rbs/chandan/softs/openmpi-1.8.3-gcc-4.9.1/bin/mpif90
> and
> CC = mpicc 
> to 
> CC=/home/rbs/chandan/softs/openmpi-1.8.3-gcc-4.9.1/bin/mpicc
>
> BLASLIB= -lblas 
> to 
> BLASLIB= -lblas -L/home/rbs/chandan/softs/forcp2k/BLAS/
>
> LAPACKLIB = -llapack 
> to 
> 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_INC   = 
> /home/rbs/chandan/softs/fftw-3.3.4-openmpi-1.8.3-gcc-4.9.1/include
> 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
>
> DFLAGS     = -D__GFORTRAN -D__FFTACML -D__FFTSG -D__FFTW3 -D__LIBINT 
> -D__LIBXC2\
>              -D__LIBINT_MAX_AM=7 -D__LIBDERIV_MAX_AM1=6 -D__MAX_CONTR=4\
>              -D__parallel -D__BLACS -D__SCALAPACK
> CPPFLAGS   =
> FCFLAGS    = $(DFLAGS) -O2 -ffast-math -ffree-form -ffree-line-length-none\
>              -ftree-vectorize -funroll-loops \
>              -mtune=native\
>              -I$(ACML_INC) -I$(FFTW_INC) -I$(LIBINT_INC) -I$(LIBXC_INC)
> LDFLAGS    = $(FCFLAGS) -static-libgfortran
> LIBS       = $(FFTW_LIB)/libfftw3.a\
>              $(LIBXC_LIB)/libxc.a\
>              $(LIBINT_LIB)/libderiv.a\
>              $(LIBINT_LIB)/libint.a\
>              $(LIBBLAS)/libblas.a \
>              $(LIBLAPACK)/liblapack.a \
>              $(LIBLAPACK)/libtmglib.a \
>              $(LIBSCALAPACK)/libscalapack.a
>
> ****************************************
>
> Now cp2k compilation stops with the error:
>
> /home/rbs/local/lib64/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../x86_64-unknown-linux-gnu/bin/ld: 
> Warning: size of symbol `build_eri' changed from 19208 in 
> /home/rbs/chandan/softs/cp2k-2.5.1/makefiles/../lib/Linux-x86-64-gfortran-openmpi-libint-blas-lapack/popt/libcp2k_lib.a(hfx_libint_wrapper.o) 
> 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_
>
> and 
> 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 
> and SCALAPACK ?
> 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,
> Chandan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20141109/0c327a70/attachment.htm>


More information about the CP2K-user mailing list