# Gromacs2023.4 installation error with cp2k2023.2

**URL:** <https://gromacs.bioexcel.eu/t/gromacs2023-4-installation-error-with-cp2k2023-2/9064>\
**Category:** User discussions\
**Tags:** installation-error, qm-mm\
**Created:** [May 5, 2024, 12:59pm UTC](https://gromacs.bioexcel.eu/t/gromacs2023-4-installation-error-with-cp2k2023-2/9064 "2024-05-05T12:59:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elapsebos](https://avatars.discourse-cdn.com/v4/letter/e/cab0a1/32.png) [@elapsebos](https://gromacs.bioexcel.eu/u/elapsebos)\
**Post date:** [May 5, 2024, 12:59pm UTC](https://gromacs.bioexcel.eu/t/gromacs2023-4-installation-error-with-cp2k2023-2/9064/1 "2024-05-05T12:59:40Z")

</div>

GROMACS version:2023.4  
hello developers. im compiling Gromacs-2023.4 with cp2k-2023.2，and the GNU complier used is gcc-11.4 installed by cp2k toolchain.I successfully installed GROMACS (with some extended versions like double precision and MPI) and CP2K separately, but encountered problems when using libcp2k.a to install GROMACS with QM/MM functionality support. My installation command is as follows:  
module load cmake/3  
source /home/elapsebos/scratch/cp2k-2023.2/tools/toolchain/install/setup  
cd /home/elapsebos/scratch/gromacs-2023.5  
rm -rf build  
mkdir build  
cd build  
cmake …   
-DCMAKE\_INSTALL\_PREFIX=/scratch/elapsebos/gmx2023.5\_qm   
-DCMAKE\_PREFIX\_PATH=/scratch/elapsebos/cp2k-2023.2/tools/toolchain/install/fftw-3.3.10   
-DGMX\_BUILD\_OWN\_FFTW=off   
-DGMX\_DOUBLE=on -DGMX\_MPI=off -DGMX\_SIMD=AVX\_512   
-DGMX\_FFT\_LIBRARY=fftw3   
-DFFTWF\_LIBRARY=“/scratch/elapsebos/cp2k-2023.2/tools/toolchain/install/fftw-3.3.10/lib/libfftw3.so.3.6.10”   
-DFFTWF\_INCLUDE\_DIR=“/scratch/elapsebos/cp2k-2023.2/tools/toolchain/install/fftw-3.3.10/include”   
-DBUILD\_SHARED\_LIBS=OFF -DGMXAPI=OFF -DGMX\_INSTALL\_NBLIB\_API=OFF   
-DGMX\_CP2K=ON -DCP2K\_DIR=/scratch/elapsebos/cp2k-2023.2/lib/local/ssmp   
-DGMX\_BLAS\_USER=/scratch/elapsebos/cp2k-2023.2/tools/toolchain/install/openblas-0.3.27   
-DGMX\_LAPACK\_USER=/scratch/elapsebos/cp2k-2023.2/tools/toolchain/install/scalapack-2.2.1   
-DGMX\_DEFAULT\_SUFFIX=OFF -DGMX\_BINARY\_SUFFIX=\_qm -DGMX\_LIBS\_SUFFIX=\_qm\_d  
make -j48  
make -j48 check && make -j48 install  
But when the make -j command was about to finish, I encountered the following issue:  
/project2/elapsebos/binutils/bin/ld: warning: libgfortran.so.3, needed by /lib/…/lib64/libxc.so, may conflict with libgfortran.so.5

/project2/elapsebos/binutils/bin/ld: warning: libgfortran.so.3, needed by /lib/…/lib64/libxc.so, may conflict with libgfortran.so.5

/project2/elapsebos/binutils/bin/ld: /scratch/elapsebos/cp2k-2023.2/lib/local/ssmp/libcp2k.a(xc\_libxc.o): in function `\_\_xc\_libxc\_MOD\_libxc\_add\_sections’:

/scratch/elapsebos/cp2k-2023.2/src/xc/xc\_libxc.F:227: undefined reference to `xc\_number\_of\_functionals’

/project2/elapsebos/binutils/bin/ld: /scratch/elapsebos/cp2k-2023.2/src/xc/xc\_libxc.F:228: undefined reference to `xc\_maximum\_name\_length’

/project2/elapsebos/binutils/bin/ld: /scratch/elapsebos/cp2k-2023.2/src/xc/xc\_libxc.F:232: undefined reference to `xc\_available\_functional\_numbers’

/project2/elapsebos/binutils/bin/ld: /scratch/elapsebos/cp2k-2023.2/src/xc/xc\_libxc.F:232: undefined reference to `xc\_available\_functional\_numbers’

[100%] Linking CXX static library …/…/lib/libtestutils.a

[100%] Built target testutils

/project2/elapsebos/binutils/bin/ld: /home/elapsebos/scratch/cp2k-2023.2/tools/toolchain/install/libxc-6.2.2/lib/libxcf03.a(libxcf03.o): in function `\_\_xc\_f03\_lib\_m\_MOD\_xc\_f03\_aux\_func\_weights’:

/home/elapsebos/scratch/cp2k-2023.2/tools/toolchain/build/libxc-6.2.2/src/…/…/src/libxc\_master.F90:1445: undefined reference to `xc\_aux\_func\_weights’

/project2/elapsebos/binutils/bin/ld: /home/elapsebos/scratch/cp2k-2023.2/tools/toolchain/install/libxc-6.2.2/lib/libxcf03.a(libxcf03.o): in function `\_\_xc\_f03\_lib\_m\_MOD\_xc\_f03\_aux\_func\_ids’:

/home/elapsebos/scratch/cp2k-2023.2/tools/toolchain/build/libxc-6.2.2/src/…/…/src/libxc\_master.F90:1438: undefined reference to `xc\_aux\_func\_ids’

/project2/elapsebos/binutils/bin/ld: /home/elapsebos/scratch/cp2k-2023.2/tools/toolchain/install/libxc-6.2.2/lib/libxcf03.a(libxcf03.o): in function `\_\_xc\_f03\_lib\_m\_MOD\_xc\_f03\_func\_set\_ext\_params\_name’:

/home/elapsebos/scratch/cp2k-2023.2/tools/toolchain/build/libxc-6.2.2/src/…/…/src/libxc\_master.F90:1142: undefined reference to `xc\_func\_set\_ext\_params\_name’  
…  
It appears that all functions related to libxc are undefined. Hope someone could help me…

---

<div class="post-metadata">

**Author:** ![elapsebos](https://avatars.discourse-cdn.com/v4/letter/e/cab0a1/32.png) [@elapsebos](https://gromacs.bioexcel.eu/u/elapsebos)\
**Post date:** [May 10, 2024, 5:39am UTC](https://gromacs.bioexcel.eu/t/gromacs2023-4-installation-error-with-cp2k2023-2/9064/2 "2024-05-10T05:39:32Z")

</div>

The issue was resolved manually by specifying the -DCP2K\_LINKER\_FLAGS, which is an optional step as outlined in the official GROMACS documentation.

---

<div class="post-metadata">

**Author:** ![Supernova](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/supernova/32/1400_2.png) [@Supernova](https://gromacs.bioexcel.eu/u/Supernova)\
**Post date:** [May 26, 2024, 11:46am UTC](https://gromacs.bioexcel.eu/t/gromacs2023-4-installation-error-with-cp2k2023-2/9064/3 "2024-05-26T11:46:51Z")

</div>

Hello. Is there any instructions about how to set the -DCP2K\_LINKER\_FLAGS parameter?

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [May 28, 2024, 6:57am UTC](https://gromacs.bioexcel.eu/t/gromacs2023-4-installation-error-with-cp2k2023-2/9064/4 "2024-05-28T06:57:51Z")

</div>

It’s a cmake flag. Read [https://manual.gromacs.org/documentation/current/install-guide/index.html#building-with-cp2k-qm-mm-support](https://manual.gromacs.org/documentation/current/install-guide/index.html#building-with-cp2k-qm-mm-support) for more information.
