Installation error GMX+CP2K on CRAY

GROMACS version:
GROMACS modification: Yes/No
Here post your question

Dear Gromacs community

I tried to install GROMACS 2022.2 in combination with CP2K.2022.1 on our CRAY supercomputer.
From what I understand in a previous post (link reported at the end of this post) the
-DCP2K_LINKER_FLAGS is not needed anymore starting from cp2k.9.1

I successfully install cp2k.2022.1 and I tried to install gromacs

I got some mpi warning:

warning: use of old-style cast [-Wold-style-cast]
MPI_Comm libraryWorldCommunicator_ = MPI_COMM_NULL;

and at the end this error at the end:

[100%] Building CXX object src/gromacs/CMakeFiles/libgromacs.dir/selection/sm_simple.cpp.o
[100%] Building CXX object src/gromacs/CMakeFiles/libgromacs.dir/selection/symrec.cpp.o
3 warnings generated.
7 warnings generated.
18 warnings generated.
[100%] Linking CXX static library …/…/lib/libgromacs_mpi_d.a
[100%] Built target libgromacs
[100%] Linking CXX executable …/…/bin/gmx_mpi_d
ld.lld: error: unable to find library -lsymspg
ld.lld: error: unable to find library -lplumed
ld.lld: error: unable to find library -lgsl
ld.lld: error: unable to find library -lxsmmf
ld.lld: error: unable to find library -lxsmm
ld.lld: error: unable to find library -lxcf03
ld.lld: error: unable to find library -lxc
ld.lld: error: unable to find library -lint2
ld.lld: error: unable to find library -lfftw3_mpi
ld.lld: error: unable to find library -lfftw3
ld.lld: error: unable to find library -lfftw3_omp
ld.lld: error: unable to find library -lvori
ld.lld: error: unable to find library -lsymspg
ld.lld: error: unable to find library -lplumed
ld.lld: error: unable to find library -lgsl
ld.lld: error: unable to find library -lxsmmf
ld.lld: error: unable to find library -lxsmm
ld.lld: error: unable to find library -lxcf03
ld.lld: error: unable to find library -lxc
ld.lld: error: unable to find library -lint2
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/programs/CMakeFiles/gmx.dir/build.make:97: bin/gmx_mpi_d] Error 1
make[1]: *** [CMakeFiles/Makefile2:6163: src/programs/CMakeFiles/gmx.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Here my cmake file

#!/bin/bash
export DIR_LIB=/lustre/igladich/opt/cp2k-2022.1/tools/toolchain/install/
source ${DIR_LIB}/setup
export DIR_CP2K=/lustre/igladich/opt/cp2k-2022.1/
export DIR_GMX=/lustre/igladich/opt/gromacs-2022.2_wCP2K/

${DIR_LIB}/cmake-3.22.1/bin/cmake … -DGMX_MPI=ON
-DCMAKE_INSTALL_PREFIX=${DIR_GMX}/opt/ -DGMX_DOUBLE=ON
-DBUILD_SHARED_LIBS=OFF -DGMXAPI=OFF -DGMX_INSTALL_NBLIB_API=OFF
-DGMX_FFT_LIBRARY=fftw3
-DCMAKE_PREFIX_PATH=${DIR_LIB}/fftw-3.3.10
-DCP2K_DIR=${DIR_CP2K}/lib/local/psmp -DGMX_CP2K=ON

Please, let me know if you have any suggestions
Thank you very much for your help

Best

Ivan

PS:

Hi there should be file libcp2k.pc in the directory /lustre/igladich/opt/cp2k-2022.1//lib/local/psmp/pkgconfig could you share that?

Hi Dmitry

thank you for your reply and help

We had some adjustments on our CRAY machine and now I am trying to install GROMACS 2022.3 in combination with CP2K.9.1 (right now I have some trouble installing the last version of cp2k).The error that I get is, anyway, very similar

[100%] Linking CXX executable …/…/bin/gmx_mpi_d
No supported cpu target is set, CRAY_CPU_TARGET=x86-64 will be used.
Load a valid targeting module or set CRAY_CPU_TARGET
/usr/bin/ld: cannot find -lplumed
/usr/bin/ld: cannot find -lgsl
/usr/bin/ld: cannot find -lgslcblas
/usr/bin/ld: cannot find -lxsmmf
/usr/bin/ld: cannot find -lxsmm
collect2: error: ld returned 1 exit status
make[2]: *** [src/programs/CMakeFiles/gmx.dir/build.make:97: bin/gmx_mpi_d] Error 1
make[1]: *** [CMakeFiles/Makefile2:6163: src/programs/CMakeFiles/gmx.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

Below my libcp2k.pc

Name: libcp2k
Description: CP2K as a library
URL: https://www.cp2k.org
Version: git:d8d7100
includedir=/ddn/home/ivgladi48/opt/cp2k-9.1/src/start
Cflags: -I${includedir}
libdir=/ddn/home/ivgladi48/opt/cp2k-9.1/lib/local/psmp
Libs: -L${libdir} -Wl,-rpath=${libdir} -lcp2k -march=native -mtune=native -fno-omit-frame-pointer -g -O3 -funroll-loops -fopenmp -I’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/fftw-3.3.10/include’ -I’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/libint-v2.6.0-cp2k-lmax-5/include’ -I’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/libxc-5.1.7/include’ -I’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/libxsmm-1.17/include’ -I’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/elpa-2021.11.001/cpu/include/elpa_openmp-2021.11.001/modules’ -I’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/elpa-2021.11.001/cpu/include/elpa_openmp-2021.11.001/elpa’ -I’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/gsl-2.7/include’ -fbacktrace -ffree-form -fimplicit-none -std=f2008 -Werror=aliasing -Werror=ampersand -Werror=c-binding-type -Werror=intrinsic-shadow -Werror=intrinsics-std -Werror=line-truncation -Werror=tabs -Werror=target-lifetime -Werror=underflow -Werror=unused-but-set-variable -Werror=unused-variable -Werror=unused-dummy-argument -Werror=conversion -Werror=zerotrip -Wno-maybe-uninitialized -Wuninitialized -Wuse-without-only -D__LIBXSMM -D__SCALAPACK -D__parallel -D__MPI_VERSION=3 -D__FFTW3 -D__LIBINT -D__LIBXC -D__ELPA -D__GSL -D__PLUMED2 -D__LIBVORI -D__COMPILE_ARCH=“local” -D__COMPILE_DATE=“Thu Oct 27 10:55:50 +03 2022” -D__COMPILE_HOST=“raad2a” -D__COMPILE_REVISION=“git:d8d7100” -D__DATA_DIR=“/ddn/home/ivgladi48/opt/cp2k-9.1/data” -Wl,–enable-new-dtags -L’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/fftw-3.3.10/lib’ -Wl,-rpath=‘/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/fftw-3.3.10/lib’ -L’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/libint-v2.6.0-cp2k-lmax-5/lib’ -L’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/libxc-5.1.7/lib’ -Wl,-rpath=‘/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/libxc-5.1.7/lib’ -L’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/libxsmm-1.17/lib’ -Wl,-rpath=‘/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/libxsmm-1.17/lib’ -L’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/elpa-2021.11.001/cpu/lib’ -Wl,-rpath=‘/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/elpa-2021.11.001/cpu/lib’ -L’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/gsl-2.7/lib’ -Wl,-rpath=‘/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/gsl-2.7/lib’ -L’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/plumed-2.7.3/lib’ -Wl,-rpath=‘/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/plumed-2.7.3/lib’ -L’/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/libvori-210412/lib’ -Wl,-rpath=‘/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/libvori-210412/lib’ -L/ddn/home/ivgladi48/opt/cp2k-9.1/lib/local/psmp/exts/dbcsr -ldbcsr -lplumed -ldl -lstdc++ -lz -ldl -lgsl -lgslcblas -lelpa_openmp -lxsmmf -lxsmm -ldl -lpthread -lxcf03 -lxc -lint2 -lfftw3_mpi -lfftw3 -lfftw3_omp -lz -ldl -lvori -lstdc++ -lstdc++

Here the script that I used for the gromacs installation

#!/bin/bash
cd build
rm -rf *
export DIR_LIB=/ddn/home/ivgladi48/opt/cp2k-9.1/tools/toolchain/install/
source ${DIR_LIB}/setup
export DIR_CP2K=/ddn/home/ivgladi48/opt/cp2k-9.1/
export DIR_GMX=/ddn/home/ivgladi48/opt/gromacs-2022.3/
${DIR_LIB}/cmake-3.22.1/bin/cmake … -DGMX_MPI=ON
-DCMAKE_INSTALL_PREFIX=${DIR_GMX}/opt/ -DGMX_DOUBLE=ON
-DBUILD_SHARED_LIBS=OFF -DGMXAPI=OFF -DGMX_INSTALL_NBLIB_API=OFF
-DGMX_FFT_LIBRARY=fftw3 -DCMAKE_PREFIX_PATH=${DIR_LIB}/fftw-3.3.10
-DCP2K_DIR=${DIR_CP2K}/lib/local/psmp -DGMX_CP2K=ON

Thank you very much for any possible help

Best
Ivan

Hi, Could you try compile CP2K without GSL and without PLUMED and then link to GROMACS?

Hi

removing gsl and plumed I was able to compile.
The code runs a simple test case, but now I am going to do more performance tests
(it looks a bit slow, also for a simple classical MD, but I want to be more precise…)
Thank you very much

PS: below the installation note for cp2k and gromacs used on my CRAY machine, in case someone needs

CP2K

!/bin/bash
rm -rf cp2k-9.1
tar -xvf cp2k-9.1.tar.bz2
module switch PrgEnv-cray/6.0.10 PrgEnv-gnu/6.0.9
module switch gcc/10.3.0 gcc/9.3.0
cd cp2k-9.1/tools/toolchain/
./install_cp2k_toolchain.sh --libint-lmax=5 --with-fftw=install --with-plumed=no --with-sirius=no --with-spfft=no --with-cosma=no --with-gsl=no --with-spglib=no --with-plumed=no
cp /ddn/home/ivgladi48/opt/New/cp2k-9.1/tools/toolchain/install/arch/* …/…/arch/
cd …/…/
source /ddn/home/ivgladi48/opt/New/cp2k-9.1/tools/toolchain/install/setup
make -j 24 ARCH=local VERSION=“ssmp sdbg psmp pdbg” libcp2k

GMX

#!/bin/bash
module switch PrgEnv-cray/6.0.10 PrgEnv-gnu/6.0.9
module switch gcc/10.3.0 gcc/9.3.0
cd build
rm -rf *
export DIR_LIB=/ddn/home/ivgladi48/opt/New/cp2k-9.1/tools/toolchain/install/
source ${DIR_LIB}/setup
export DIR_CP2K=/ddn/home/ivgladi48/opt/New/cp2k-9.1/
export DIR_GMX=/ddn/home/ivgladi48/opt/gromacs-2022.3/
${DIR_LIB}/cmake-3.22.1/bin/cmake … -DGMX_MPI=ON -DCMAKE_INSTALL_PREFIX=${DIR_GMX}/opt/ -DGMX_DOUBLE=ON -DBUILD_SHARED_LIBS=OFF -DGMXAPI=OFF -DGMX_INSTALL_NBLIB_API=OFF -DGMX_FFT_LIBRARY=fftw3 -DCMAKE_PREFIX_PATH=${DIR_LIB}/fftw-3.3.10 -DCP2K_DIR=${DIR_CP2K}/lib/local/psmp -DGMX_CP2K=ON
make -j 24
make install

good that its now working!