<div>My saga with installation continued. I got a weird interaction between -llapack and -lscalapack.</div><div><br></div><div>If I'm not mistaken, at least some other codes handle scalapack as optional per a direction in the input code.</div><div>Apparently, it causes issues for cp2k and I got errors complaining about:</div><div><span style="white-space: pre;"><br></span></div><div><span style="white-space: pre;"><font face="Times New Roman">undefined reference to `std::ios_base::Init::Init()'</font></span></div><div><span style="white-space: pre;"><br></span></div><div><span style="white-space: pre;">starting with </span><span style="white-space: pre;">`_GLOBAL__sub_I_libint2_build_default' and 3891 more.</span></div><div><span style="white-space: pre;"><br></span></div><div><span style="white-space: pre;">If I remove -llapack, it goes away. Any thoughts or comments?</span></div><div class="gmail_quote"><div dir="auto" class="gmail_attr">On Friday, January 28, 2022 at 2:15:53 PM UTC+1 Sam Broderick wrote:<br/></div><blockquote class="gmail_quote" style="margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Thanks! That did the trick!<div><br></div><div>I had used --enable-fortran per the command line help, but it apparently was ignored.</div><div><br></div><div>Rgds</div><div>Sam<br><br></div><div class="gmail_quote"><div dir="auto" class="gmail_attr">On Thursday, January 27, 2022 at 5:34:14 PM UTC+1 Matthias Krack wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hi
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">The libint installer sometimes fails to build the Fortran interface, i.e. the module file libint_f.mod. The installer (makefile) uses the CXX instead of the Fortran
 linker to generate the module file which does not work in all cases. Change to the libint-2.6.0 build folder and run “make fortran” there. This should generate a libint_f.mod file in the subfolder libint-2.6.0/fortran which is installed (copied) after “make
 install”.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I don’t see any --D__SCALAPACK flag in your arch file which is required for parallel builds (-D__parallel) using MPI.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">HTH<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Matthias<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"></div></div></div><div lang="EN-US" link="blue" vlink="purple"><div><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif">Von:</span></b><span lang="DE" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a rel="nofollow">cp...@googlegroups.com</a> <<a rel="nofollow">cp...@googlegroups.com</a>>
<b>Im Auftrag von </b>Sam Broderick<br>
<b>Gesendet:</b> Donnerstag, 27. Januar 2022 16:53<br>
<b>An:</b> cp2k <<a rel="nofollow">cp...@googlegroups.com</a>><br>
<b>Betreff:</b> [CP2K:16517] Difficulties with Install & existing libraries<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Good Evening!<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">After much reading, searching (this list, too) and trial-and-error, I am still unable to install cp2k. While I am hardly an expert, I have had success in installing a variety of packages such as blas/fftw/gcc11.2/gsl/hdf/lapack/libint/libxc/netcdf/openmpi/pfft/scalapack.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">The crux of the issue is convincing the CP2K v9.1 to link to external libraries. From the best I can tell, my arch file leaves make wanting to use source code, e.g.: <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">/home/sam/Downloads/cp2k/cp2k-9.1/src/libint_wrapper.F:31:8:<br>
<br>
   31 |    USE libint_f, ONLY: &<br>
      |        1<br>
Fatal Error: Cannot open module file ‘libint_f.mod’ for reading at (1): No such file or directory<br>
compilation terminated.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I already have linint and libxc installed. My fairly short arch file (Linux-x86-64-mpifort.psmp) is below.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Does anyone see what I am doing wrong?<br>
<br>
Many thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Sam Broderick<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal">CC       := mpicc<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">CXX      := mpic++ -g<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">FC       := mpifort<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">LD       := mpifort<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">AR       := ar -r<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">DFLAGS   := -D__NO_STATM_ACCESS -D__parallel -D__MPI_VERSION=3<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">DFLAGS   += -D__LIBXC<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">DFLAGS   += -D__LIBINT<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">DFLAGS   += -D__FFTW3<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">LIBXC_INC      := /opt/extlib/libxc/5.1.7/mpicc/4.1.1/gcc/11.2.0/include<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">LIBINT_INC     := /opt/extlib/libint/2.6.0/mpicc/4.1.1/gcc/11.2.0/include<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">FFTW_INC       := /opt/extlib/fftw/3.3.10/mpicc/4.1.1/gcc/11.2.0/include<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">CFLAGS   := -fopenmp<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">CFLAGS   += -I$(LIBINT_INC)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">CFLAGS   += -I$(LIBXC_INC)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">CFLAGS   += -I$(FFTW_INC)<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">FCFLAGS  := -O2 -funroll-loops -ftree-vectorize -march=native -ffree-form $(DFLAGS) $(CFLAGS)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">LDFLAGS  := $(FCFLAGS)<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
<div>
<p class="MsoNormal">LIBXC_LIB      := /opt/extlib/libxc/5.1.7/mpicc/4.1.1/gcc/11.2.0/lib<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">LIBINT_LIB     := /opt/extlib/libint/2.6.0/mpicc/4.1.1/gcc/11.2.0/lib<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">FFTW_LIB       := /opt/extlib/fftw/3.3.10/mpicc/4.1.1/gcc/11.2.0/lib<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">BLAS_LIB       := /opt/extlib/blas/3.10.0/mpicc/4.1.1/gcc/11.2.0/lib<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">SCALAPACK_LIB  := /opt/extlib/scalapack/2.1.0/mpicc/4.1.1/gcc/11.2.0/lib<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">LAPACK_LIB     := /opt/extlib/lapack/3.10.0/mpicc/4.1.1/gcc/11.2.0/lib<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">LIBS     := -llapack -lblas -lscalapack -lfftw3 -lfftw3_omp -lmpi<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">LIBS     += -Wl,-rpath=$(LIBXC_LIB) -L$(LIBXC_LIB) -lxcf03 -lxc<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">LIBS     += -Wl,-rpath=$(LIBINT_LIB) -L$(LIBINT_LIB) -lint2<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">LIBS     += -Wl,-rpath=$(FFTW_LIB) -L$(FFTW_LIB) -lfftw3_mpi -lfftw3_omp -lfftw3 
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">LIBS     += -Wl,-rpath=$(SCALAPACK_LIB) -L$(SCALAPACK_LIB) -lscalapack<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">LIBS     += -Wl,-rpath=$(LAPACK_LIB) -L$(LAPACK_LIB) -llapack<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">LIBS     += -Wl,-rpath=$(BLAS_LIB) -L$(BLAS_LIB) -lblas<u></u><u></u></p>
</div>
</div>
</div>
</div></div></div><div lang="EN-US" link="blue" vlink="purple"><div><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt"><p class="MsoNormal">-- <br>
You received this message because you are subscribed to the Google Groups "cp2k" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to
<a rel="nofollow">cp2k+uns...@googlegroups.com</a>.<br>
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/cp2k/29efe32b-d4eb-40a0-9024-bb9dc45e4e60n%40googlegroups.com?utm_medium=email&utm_source=footer" rel="nofollow" target="_blank" data-saferedirecturl="https://www.google.com/url?hl=en&q=https://groups.google.com/d/msgid/cp2k/29efe32b-d4eb-40a0-9024-bb9dc45e4e60n%2540googlegroups.com?utm_medium%3Demail%26utm_source%3Dfooter&source=gmail&ust=1643465997710000&usg=AFQjCNEsWq-jBI188i58CZN3ghbo56KL1A">
https://groups.google.com/d/msgid/cp2k/29efe32b-d4eb-40a0-9024-bb9dc45e4e60n%40googlegroups.com</a>.<u></u><u></u></p>
</div>
</div>
</div>

</blockquote></div></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups "cp2k" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:cp2k+unsubscribe@googlegroups.com">cp2k+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/cp2k/b77db556-b193-47d0-9004-57d340cafa25n%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/cp2k/b77db556-b193-47d0-9004-57d340cafa25n%40googlegroups.com</a>.<br />