Install GROMACS with CP2K failed during make

GROMACS version:2022.1
GROMACS modification: Yes/No

I am trying to compile GROMACS with CP2K package to do QM/MM simulation. I have installed CP2K and the cmake process for GROMACS configured without any problem. But the make -j N process failed at 100% Lining CXX executable …/…/bin/gmx_mpi.
It started to print out a long list of undefined references messages. and then failed with Linker error. Pleas e see below a part of the output print.
I am not sure where is the problem, I did use the same library as CP2K to compile the GROMACS, and have tried multiple options, but none of them success. I will be greatly appreciated if some one can give me a suggestion where I made the mistake.

The version of my CP2k is 9.1.

Code to compile GROMACS on my cluster.
CC=icx CXX=icpx cmake .. -DBUILD_SHARED_LIBS=OFF -DGMXAPI=OFF -DGMX_INSTALL_NBLIB_API=OFF -DGMX_FFT_LIBRARY=mkl -DGMX_MPI=ON -DGMX_OPENMP=ON -DGMX_CYCLE_SUBCOUNTERS=ON -DGMX_GPU=OFF -DGMX_BUILD_HELP=OFF -DGMX_HWLOC=OFF -DGMX_SIMD=AVX_512_KNL -DGMX_OPENMP_MAX_THREADS=256 -DGMX_CP2K=ON -DCP2K_DIR=/home/shi.li/downloads/cp2k-9.1/lib/Bebop-knl-x86-64-intel-minimal/psmp -DCMAKE_INSTALL_PREFIX=/home/shi.li/apps/gromacs_cp2k

This configured without any problem.

make -j 32



[100%] Built target libgromacs
[100%] Linking CXX executable …/…/bin/gmx_mpi
/home/shi.li/downloads/cp2k-9.1/lib/Bebop-knl-x86-64-intel-minimal/psmp/libcp2k.a(libcp2k.o): In function cp2k_get_version': /gpfs/fs1/home/shi.li/downloads/cp2k-9.1/src/start/libcp2k.F:72: undefined reference to for_len_trim’
/home/shi.li/downloads/cp2k-9.1/lib/Bebop-knl-x86-64-intel-minimal/psmp/libcp2k.a(libcp2k.o): In function cp2k_create_force_env': /gpfs/fs1/home/shi.li/downloads/cp2k-9.1/src/start/libcp2k.F:137: undefined reference to for_cpystr’
/gpfs/fs1/home/shi.li/downloads/cp2k-9.1/src/start/libcp2k.F:137: undefined reference to for_cpystr' ... ... ... gpfs/fs1/home/shi.li/downloads/cp2k-9.1/exts/dbcsr/src/core/dbcsr_list_timerenv.F:21: undefined reference to for_dealloc_allocatable’
/gpfs/fs1/home/shi.li/downloads/cp2k-9.1/exts/dbcsr/src/core/dbcsr_list_timerenv.F:21: undefined reference to for_dealloc_allocatable' /home/shi.li/downloads/cp2k-9.1/lib/Bebop-knl-x86-64-intel-minimal/psmp/exts/dbcsr/libdbcsr.a(dbcsr_list_timerenv.o): In function dbcsr_list_timerenv_mp_list_timerenv_init_‘:
/gpfs/fs1/home/shi.li/downloads/cp2k-9.1/exts/dbcsr/src/core/dbcsr_list_timerenv.F:21: undefined reference to for_check_mult_overflow64' /gpfs/fs1/home/shi.li/downloads/cp2k-9.1/exts/dbcsr/src/core/dbcsr_list_timerenv.F:21: undefined reference to for_allocate’
/gpfs/fs1/home/shi.li/downloads/cp2k-9.1/exts/dbcsr/src/core/dbcsr_list_timerenv.F:21: undefined reference to `for_check_mult_overflow64’
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/gmx_mpi] Error 1
make[1]: *** [src/programs/CMakeFiles/gmx.dir/all] Error 2
make: *** [all] Error 2