<div dir="ltr">Hi,<br><br>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.<br><br>Matthias<br><br>On Sunday, 9 November 2014 20:28:52 UTC+1, aldol  wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr">Hi,<br>I am new to cp2k and am trying to install its parallel  version.<br>I downloaded the BLAS, LAPACK and SCALAPACK libraries<br>and installed them as follows:<br><br>Installing BLAS<br>gunzip blas.tgz<br>tar -xvf blas.tar<br>cd BLAS<br>gfortran -c -O3 *.f<br>ar rv libblas.a *.o<br><br>Installing LAPACK<br>tar -xvf lapack-3.5.0.tar<br>cd lapack-3.5.0<br>cp INSTALL/make.inc.gfortran ./make.inc<br>change BLASLIB = ../../librefblas.a to BLASLIB=~/chandan/softs/<wbr>forcp2k/BLAS/libblas.a<br>make 1> make.out 2>&1 &<br><br>Installing SCALAPACK<br>tar -xvf scalapack-2.0.2.tar<br>cd scalapack-2.0.2<br>cp SLmake.inc.example SLmake.inc<br>vi SLmake.inc<br><br>Then I change FC = mpif90 <br>to <br>FC=/home/rbs/chandan/softs/<wbr>openmpi-1.8.3-gcc-4.9.1/bin/<wbr>mpif90<br>and<br>CC = mpicc <br>to <br>CC=/home/rbs/chandan/softs/<wbr>openmpi-1.8.3-gcc-4.9.1/bin/<wbr>mpicc<br><br>BLASLIB= -lblas <br>to <br>BLASLIB= -lblas -L/home/rbs/chandan/softs/<wbr>forcp2k/BLAS/<br><br>LAPACKLIB = -llapack <br>to <br>LAPACKLIB = -llapack -L/home/rbs/chandan/softs/<wbr>forcp2k/lapack-3.5.0/<br><br>make 1> make.out 2>&1 &<br><br>My arch file is as follows:<br>*****************<br>CC         = /home/rbs/chandan/softs/<wbr>openmpi-1.8.3-gcc-4.9.1/bin/<wbr>mpicc<br>CPP        =<br>FC         = /home/rbs/chandan/softs/<wbr>openmpi-1.8.3-gcc-4.9.1/bin/<wbr>mpif90<br>LD         = /home/rbs/chandan/softs/<wbr>openmpi-1.8.3-gcc-4.9.1/bin/<wbr>mpif90<br>AR         = ar -r<br>FFTW_INC   = /home/rbs/chandan/softs/fftw-<wbr>3.3.4-openmpi-1.8.3-gcc-4.9.1/<wbr>include<br>FFTW_LIB   = /home/rbs/chandan/softs/fftw-<wbr>3.3.4-openmpi-1.8.3-gcc-4.9.1/<wbr>lib<br>LIBINT_INC = /home/rbs/chandan/softs/<wbr>LIBINT/include<br>LIBINT_LIB = /home/rbs/chandan/softs/<wbr>LIBINT/lib<br>LIBXC_INC  = /home/rbs/chandan/softs/LIBXC/<wbr>include<br>LIBXC_LIB  = /home/rbs/chandan/softs/LIBXC/<wbr>lib<br>LIBBLAS    = /home/rbs/chandan/softs/<wbr>forcp2k/BLAS<br>LIBLAPACK  = /home/rbs/chandan/softs/<wbr>forcp2k/lapack-3.5.0<br>LIBSCALAPACK = /home/rbs/chandan/softs/<wbr>forcp2k/scalapack-2.0.2<br><br>DFLAGS     = -D__GFORTRAN -D__FFTACML -D__FFTSG -D__FFTW3 -D__LIBINT -D__LIBXC2\<br>             -D__LIBINT_MAX_AM=7 -D__LIBDERIV_MAX_AM1=6 -D__MAX_CONTR=4\<br>             -D__parallel -D__BLACS -D__SCALAPACK<br>CPPFLAGS   =<br>FCFLAGS    = $(DFLAGS) -O2 -ffast-math -ffree-form -ffree-line-length-none\<br>             -ftree-vectorize -funroll-loops \<br>             -mtune=native\<br>             -I$(ACML_INC) -I$(FFTW_INC) -I$(LIBINT_INC) -I$(LIBXC_INC)<br>LDFLAGS    = $(FCFLAGS) -static-libgfortran<br>LIBS       = $(FFTW_LIB)/libfftw3.a\<br>             $(LIBXC_LIB)/libxc.a\<br>             $(LIBINT_LIB)/libderiv.a\<br>             $(LIBINT_LIB)/libint.a\<br>             $(LIBBLAS)/libblas.a \<br>             $(LIBLAPACK)/liblapack.a \<br>             $(LIBLAPACK)/libtmglib.a \<br>             $(LIBSCALAPACK)/libscalapack.a<br><br>******************************<wbr>**********<br><br>Now cp2k compilation stops with the error:<br><br>/home/rbs/local/lib64/gcc/x86_<wbr>64-unknown-linux-gnu/4.9.1/../<wbr>../../../x86_64-unknown-linux-<wbr>gnu/bin/ld: Warning: size of symbol `build_eri' changed from 19208 in /home/rbs/chandan/softs/cp2k-<wbr>2.5.1/makefiles/../lib/Linux-<wbr>x86-64-gfortran-openmpi-<wbr>libint-blas-lapack/popt/<wbr>libcp2k_lib.a(hfx_libint_<wbr>wrapper.o) to 5000 in /home/rbs/chandan/softs/<wbr>LIBINT/lib/libint.a(init_<wbr>libint.o)<br>/home/rbs/chandan/softs/<wbr>forcp2k/lapack-3.5.0/<wbr>liblapack.a(strtri.o): In function `strtri_':<br>strtri.f:(.text+0x264): undefined reference to `strmm_'<br>strtri.f:(.text+0x2ac): undefined reference to `strsm_'<br>strtri.f:(.text+0x580): undefined reference to `strmm_'<br>strtri.f:(.text+0x5eb): undefined reference to `strsm_'<br>/home/rbs/chandan/softs/<wbr>forcp2k/lapack-3.5.0/<wbr>liblapack.a(dgecon.o): In function `dgecon_':<br>dgecon.f:(.text+0x3d6): undefined reference to `idamax_'<br>/home/rbs/chandan/softs/<wbr>forcp2k/lapack-3.5.0/<wbr>liblapack.a(dgetri.o): In function `dgetri_':<br>dgetri.f:(.text+0x2ee): undefined reference to `dswap_'<br>/home/rbs/chandan/softs/<wbr>forcp2k/lapack-3.5.0/<wbr>liblapack.a(dlacn2.o): In function `dlacn2_':<br>dlacn2.f:(.text+0xb1): undefined reference to `dasum_'<br>dlacn2.f:(.text+0x130): undefined reference to `dasum_'<br>dlacn2.f:(.text+0x1ff): undefined reference to `idamax_'<br>dlacn2.f:(.text+0x2c0): undefined reference to `idamax_'<br>dlacn2.f:(.text+0x348): undefined reference to `dasum_'<br><br>The problem seems that these functions are not present in liblapack.a <br>So I checked using:<br>nm -A libblas.a |grep strmm<br>The output was:<br>libblas.a:strmm.o:<wbr>0000000000000000 r .LC8<br>libblas.a:strmm.o:            <wbr>     U lsame_<br>libblas.a:strmm.o:            <wbr>     U memset<br>libblas.a:strmm.o:<wbr>0000000000000000 T strmm_<br>libblas.a:strmm.o:            <wbr>     U xerbla_<br><br>and <br>nm -A liblapack.a |grep strmm<br>The output was:<br>liblapack.a:sgehrd.o:         <wbr>        U strmm_<br>liblapack.a:slahr2.o:         <wbr>        U strmm_<br>liblapack.a:slaqr5.o:         <wbr>        U strmm_<br>liblapack.a:slarfb.o:         <wbr>        U strmm_<br>liblapack.a:slarzb.o:         <wbr>        U strmm_<br>liblapack.a:slauum.o:         <wbr>        U strmm_<br>liblapack.a:ssygst.o:         <wbr>        U strmm_<br>liblapack.a:ssygv.o:          <wbr>       U strmm_<br>liblapack.a:ssygvd.o:         <wbr>        U strmm_<br>liblapack.a:ssygvx.o:         <wbr>        U strmm_<br>liblapack.a:ssytri2x.o:       <wbr>          U strmm_<br>liblapack.a:strtri.o:         <wbr>        U strmm_<br>liblapack.a:spftri.o:         <wbr>        U strmm_<br>liblapack.a:stftri.o:         <wbr>        U strmm_<br>liblapack.a:sgeqrt3.o:        <wbr>         U strmm_<br>liblapack.a:stprfb.o:         <wbr>        U strmm_<br><br>SO my guess is that the function strmm_ is present in BLAS.<br><br>Is this a linking issue ?? If so how to do the correctly link BLAS, LAPACK and SCALAPACK ?<br>Did I miss some flags in the arch file ?<br><br>Any help would be deeply appreciated.<br><br>I am attaching the output files from make for the libraries and cp2k.<br><br>Thanks in advance,<br>Chandan<br><br></div></blockquote></div>