Problems with CP2K+PLUMED build

70 views
Skip to first unread message

Scott Milner

unread,
May 24, 2023, 8:09:30 PM5/24/23
to cp2k
After successfully building local.psmp architecture of CP2K, I tried to install CP2K+PLUMED.  This failed, as I describe below.

1) I built PLUMED from source without errors, using the standard procedure:

     ./configure --prefix=/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe
     make
     make install

2) I created an architecture file local_PLUMED.psmp file by modifying local.psmp, with these changes , following the instructions on the cp2k.org website
a) lines added at the top

     include /storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib/plumed/src/lib/Plumed.inc
     EXTERNAL_OBJECTS=$(PLUMED_STATIC_DEPENDENCIES)

b) added  -D__PLUMED2 to DFLAGS

c) added  -lz -ldl -lstdc++ to LIBS

d) I am not using OPENMPI, so I did not add -lmpi_cxx -lrt to LIBS

3) Then the make command

     make ARCH=local_PLUMED VERSION=psmp

fails, with errors in which components of PLUMED are not found:

/storage/group/stm9/default/SOFTWARE/cp2k-2023.1-intel/lib/local_PLUMED/psmp/libcp2kmain.a(metadynamics.o): In function `metadynamics_mp_metadyn_finalise_plumed_':
/storage/group/stm9/default/SOFTWARE/cp2k-2023.1-intel/src/metadynamics.F:208: undefined reference to `plumed_gfinalize'
/storage/group/stm9/default/SOFTWARE/cp2k-2023.1-intel/lib/local_PLUMED/psmp/libcp2kmain.a(metadynamics.o): In function `metadynamics_mp_metadyn_integrator_':
/storage/group/stm9/default/SOFTWARE/cp2k-2023.1-intel/src/metadynamics.F:299: undefined reference to `plumed_gcmd'
/storage/group/stm9/default/SOFTWARE/cp2k-2023.1-intel/src/metadynamics.F:300: undefined reference to `plumed_gcmd'
/storage/group/stm9/default/SOFTWARE/cp2k-2023.1-intel/src/metadynamics.F:301: undefined reference to `plumed_gcmd'
/storage/group/stm9/default/SOFTWARE/cp2k-2023.1-intel/src/metadynamics.F:302: undefined reference to `plumed_gcmd'
/storage/group/stm9/default/SOFTWARE/cp2k-2023.1-intel/src/metadynamics.F:303: undefined reference to `plumed_gcmd'
/storage/group/stm9/default/SOFTWARE/cp2k-2023.1-intel/lib/local_PLUMED/psmp/libcp2kmain.a(metadynamics.o):/storage/group/stm9/default/SOFTWARE/cp2k-2023.1-intel/src/metadynamics.F:304: more undefined references to `plumed_gcmd' follow

But the directory
/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib/plumed/src/lib/
does contain Plumed.inc, with the following contents:

PLUMED_RUNTIME_LOAD= "/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib/libplumedWrapper.a" -ldl
PLUMED_STATIC_LOAD= "/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib/libplumed.a" -ldl  -lstdc++ -lz -ldl   -rdynamic -Wl,-Bsymbolic -fopenmp
PLUMED_SHARED_LOAD= "/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib/libplumed.so" -ldl
PLUMED_RUNTIME_DEPENDENCIES=
PLUMED_STATIC_DEPENDENCIES= "/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib/libplumed.a"
PLUMED_SHARED_DEPENDENCIES= "/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib/libplumed.so"
PLUMED_FORTRAN= "/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib/plumed/fortran/plumed.f90"
PLUMED_FORTRAN08= "/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib/plumed/fortran/plumed_f08.f90"

And the directory 
/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib 
does contain the library libplumed.a;
and libplumed.a does contain the object PlumedStatic.o;
and PlumedStatic.o does contain the missing items:

(base) [stm9@submit03 lib]$ nm PlumedStatic.o | grep plumed_gcmd
0000000000000eb0 T plumed_gcmd
0000000000000ed0 T plumed_gcmd_safe
(base) [stm9@submit03 lib]$ nm PlumedStatic.o | grep plumed_gfinalize
0000000000000ee0 T plumed_gfinalize

I have tried modifying local_PLUMED.psmp, by
adding -L/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib to LIBS;
adding -I/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/include to CFLAGS and FCFLAGS;
and adding -L/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib to LDFLAGS;
with exactly the same errors resulting.


Krack Matthias

unread,
May 25, 2023, 4:46:35 AM5/25/23
to cp...@googlegroups.com

Did you add also “-lplumed” to LIBS?

The toolchain adds PLUMED_LIBS=”-lplumed -ldl -lstdc++ -lz -ldl” to LIBS.

--
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/a8864437-9ea1-4ce4-a89e-be72380b2511n%40googlegroups.com.

Milner, Scott Thomas

unread,
May 25, 2023, 8:49:17 AM5/25/23
to cp...@googlegroups.com
Matthias:  Adding —lplumed to LIBS worked, thank you. 

I had previously tried putting an explicit path in LIBS, i.e., 
-L/storage/home/stm9/group/SOFTWARE/plumed-2.8.2/exe/lib

which did not work.

Note that the instructions on the CP2K HOWTO webpage https://www.cp2k.org/howto:install_with_plumed
make no mention of adding —lplumed to LIBS, 
and indeed make no mention of —with-plumed being a toolchain option
(which I only discovered by browsing in install_cp2k_toolchain.sh, 
after your email implied that PLUMED could be installed via toolchain).
It would be helpful if the instructions on the HOWTO page were clarified.

Scott Milner
William H. Joyce Professor
The Pennsylvania State University
Department of Chemical Engineering
204 CBE Building
University Park, PA 16802
(814) 863-9355
st...@psu.edu

You received this message because you are subscribed to a topic in the Google Groups "cp2k" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cp2k/WyGfl5D1juQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cp2k+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/ZRAP278MB08277956CEA0823833B63C7FF4469%40ZRAP278MB0827.CHEP278.PROD.OUTLOOK.COM.

Reply all
Reply to author
Forward
0 new messages