GROMACS with PLUMED error

GROMACS version: 2025.0
GROMACS modification: No

My cmake configuration code is

cmake .. -DCMAKE_INSTALL_PREFIX=/opt/software/gromacs-2025.0 -DCMAKE_PREFIX_PATH=/opt/tool/fftw-3.3.10 -DGMX_USE_PLUMED=ON -DGMX_TORCH=TORCH

then gromacs has been installed…But when I run a simulation with PLUMED:

gmx mdrun -ntmpi 1 -v -s pmf.tpr -plumed dat

I meet a error:

Program:     gmx mdrun, version 2025.0
Source file: src/gromacs/applied_forces/plumed/plumedMDModule_stub.cpp (line 81)
Function:    gmx::{anonymous}::PlumedMDModule::subscribeToSimulationSetupNotifications(gmx::MDModulesNotifiers*)::<lambda(const gmx::PlumedInputFilename&)>

Error in user input:
GROMACS is not compiled with the PLUMED interface, if you want to use -plumed
option, please reconfigure GROMACS with -DGMX_USE_PLUMED=ON.

For more information and tips for troubleshooting, please check the GROMACS
website at https://manual.gromacs.org/current/user-guide/run-time-errors.html

Can someone help me to use GROMACS with PLUMED?
Thanks a lot!

Dempsey

Hi,
It’s likely that something went wrong during configuration. Could you share your cmake output? Also, remember that to run a simulation with PLUMED, you have to first run e.g. export PLUMED_KERNEL=$plumed_prefix/lib/libPlumedKernel.so so that GROMACS knows where to find the library.

Also, you should not set -DGMX_TORCH=TORCH (in fact, you shouldn’t set it at all). If you want to configure GROMACS with support for neural network potentials, you have to tell it about your Libtorch installation, see the installation guide.

Sorry, I wrote the wrong cmake code I used, here is the code during my configuration

cmake .. -DCMAKE_INSTALL_PREFIX=/opt/software/gromacs-2025.0 -DCMAKE_PREFIX_PATH=/opt/tool/fftw-3.3.10 -DGMX_USE_PLUMED=ON -DGMX_NNPOT=TORCH

The cmake output:

-- The C compiler identification is GNU 11.4.1
-- The CXX compiler identification is GNU 11.4.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python3: /usr/bin/python3.9 (found suitable version "3.9.18", minimum required is "3.9") found components: Interpreter Development Development.Module Development.Embed
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Performing Test CFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS
-- Performing Test CFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS - Success
-- Performing Test CFLAGS_EXCESS_PREC
-- Performing Test CFLAGS_EXCESS_PREC - Success
-- Performing Test CFLAGS_COPT
-- Performing Test CFLAGS_COPT - Success
-- Performing Test CFLAGS_NOINLINE
-- Performing Test CFLAGS_NOINLINE - Success
-- Performing Test CXXFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS
-- Performing Test CXXFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS - Success
-- Performing Test CXXFLAGS_EXCESS_PREC
-- Performing Test CXXFLAGS_EXCESS_PREC - Success
-- Performing Test CXXFLAGS_COPT
-- Performing Test CXXFLAGS_COPT - Success
-- Performing Test CXXFLAGS_NOINLINE
-- Performing Test CXXFLAGS_NOINLINE - Success
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file pwd.h
-- Looking for include file pwd.h - found
-- Looking for include file dirent.h
-- Looking for include file dirent.h - found
-- Looking for include file time.h
-- Looking for include file time.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file io.h
-- Looking for include file io.h - not found
-- Looking for include file sched.h
-- Looking for include file sched.h - found
-- Looking for include file xmmintrin.h
-- Looking for include file xmmintrin.h - found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for nice
-- Looking for nice - found
-- Looking for fsync
-- Looking for fsync - found
-- Looking for _fileno
-- Looking for _fileno - not found
-- Looking for fileno
-- Looking for fileno - found
-- Looking for _commit
-- Looking for _commit - not found
-- Looking for sigaction
-- Looking for sigaction - found
-- Performing Test HAVE_BUILTIN_CLZ
-- Performing Test HAVE_BUILTIN_CLZ - Success
-- Performing Test HAVE_BUILTIN_CLZLL
-- Performing Test HAVE_BUILTIN_CLZLL - Success
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for feenableexcept in m
-- Looking for feenableexcept in m - found
-- Looking for fedisableexcept in m
-- Looking for fedisableexcept in m - found
-- Checking for sched.h GNU affinity API
-- Performing Test sched_affinity_compile
-- Performing Test sched_affinity_compile - Success
-- Looking for include file mm_malloc.h
-- Looking for include file mm_malloc.h - found
-- Looking for include file malloc.h
-- Looking for include file malloc.h - found
-- Checking for _mm_malloc()
-- Checking for _mm_malloc() - supported
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for memalign
-- Looking for memalign - not found
-- Found Torch: Neural network potential support enabled.
-- Using default binary suffix: ""
-- Using default library suffix: ""
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test TEST_ATOMICS
-- Performing Test TEST_ATOMICS - Success
-- Atomic operations found
-- Performing Test PTHREAD_SETAFFINITY
-- Performing Test PTHREAD_SETAFFINITY - Success
-- Detecting best SIMD instructions for this CPU
-- Checking for GCC x86 inline asm
-- Checking for GCC x86 inline asm - supported
-- Detected build CPU features - aes apic avx avx2 avx512f avx512cd avx512bw avx512vl clfsh cmov cx8 cx16 f16c fma htt intel lahf mmx msr nonstop_tsc pcid pclmuldq pdcm pdpe1gb popcnt pse rdrnd rdtscp sse2 sse3 sse4.1 sse4.2 ssse3 tdt x2apic
-- Detected build CPU brand - Intel(R) Xeon(R) Silver 4210 CPU @ 2.20GHz
-- Performing Test C_march_skylake_avx512_FLAG_ACCEPTED
-- Performing Test C_march_skylake_avx512_FLAG_ACCEPTED - Success
-- Performing Test C_march_skylake_avx512_COMPILE_WORKS
-- Performing Test C_march_skylake_avx512_COMPILE_WORKS - Success
-- Performing Test CXX_march_skylake_avx512_FLAG_ACCEPTED
-- Performing Test CXX_march_skylake_avx512_FLAG_ACCEPTED - Success
-- Performing Test CXX_march_skylake_avx512_COMPILE_WORKS
-- Performing Test CXX_march_skylake_avx512_COMPILE_WORKS - Success
-- This is an Intel CPU with only 1 AVX-512 FMA unit, so AVX2 will be faster.
-- Detected best SIMD instructions for this CPU - AVX2_256
-- Performing Test C_mavx2_mfma_FLAG_ACCEPTED
-- Performing Test C_mavx2_mfma_FLAG_ACCEPTED - Success
-- Performing Test C_mavx2_mfma_COMPILE_WORKS
-- Performing Test C_mavx2_mfma_COMPILE_WORKS - Success
-- Performing Test CXX_mavx2_mfma_FLAG_ACCEPTED
-- Performing Test CXX_mavx2_mfma_FLAG_ACCEPTED - Success
-- Performing Test CXX_mavx2_mfma_COMPILE_WORKS
-- Performing Test CXX_mavx2_mfma_COMPILE_WORKS - Success
-- Enabling 256-bit AVX2 SIMD instructions using CXX flags:  -mavx2 -mfma
-- Performing Test _Wno_unused_command_line_argument_FLAG_ACCEPTED
-- Performing Test _Wno_unused_command_line_argument_FLAG_ACCEPTED - Success
-- Performing Test _callconv___vectorcall
-- Performing Test _callconv___vectorcall - Failed
-- Performing Test _callconv___regcall
-- Performing Test _callconv___regcall - Failed
-- Performing Test _callconv_ 
-- Performing Test _callconv_  - Success
-- Detected build CPU vendor - Intel
-- Detected build CPU family - 6
-- Detected build CPU model - 85
-- Detected build CPU stepping - 7
-- Checking for 64-bit off_t
-- Checking for 64-bit off_t - present
-- Checking for fseeko/ftello
-- Checking for fseeko/ftello - present
-- Checking for SIGUSR1
-- Checking for SIGUSR1 - found
-- Checking for pipe support
-- Checking for system XDR support
-- Checking for system XDR support - not present
-- Checking for module 'fftw3f'
--   Found fftw3f, version 3.3.10
-- Looking for fftwf_plan_many_dft in /opt/tool/fftw-3.3.10/lib/libfftw3f.so
-- Looking for fftwf_plan_many_dft in /opt/tool/fftw-3.3.10/lib/libfftw3f.so - found
-- Looking for fftwf_plan_many_dft_r2c in /opt/tool/fftw-3.3.10/lib/libfftw3f.so
-- Looking for fftwf_plan_many_dft_r2c in /opt/tool/fftw-3.3.10/lib/libfftw3f.so - found
-- Looking for fftwf_plan_many_dft_c2r in /opt/tool/fftw-3.3.10/lib/libfftw3f.so
-- Looking for fftwf_plan_many_dft_c2r in /opt/tool/fftw-3.3.10/lib/libfftw3f.so - found
-- Looking for fftwf_have_simd_sse in /opt/tool/fftw-3.3.10/lib/libfftw3f.so
-- Looking for fftwf_have_simd_sse in /opt/tool/fftw-3.3.10/lib/libfftw3f.so - not found
-- Looking for fftwf_have_sse in /opt/tool/fftw-3.3.10/lib/libfftw3f.so
-- Looking for fftwf_have_sse in /opt/tool/fftw-3.3.10/lib/libfftw3f.so - not found
-- Looking for fftwf_have_simd_sse2 in /opt/tool/fftw-3.3.10/lib/libfftw3f.so
-- Looking for fftwf_have_simd_sse2 in /opt/tool/fftw-3.3.10/lib/libfftw3f.so - found
-- Using external FFT library - FFTW3
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Could NOT find BLAS (missing: BLAS_LIBRARIES) 
-- Using GROMACS built-in BLAS.
-- Could NOT find LAPACK (missing: LAPACK_LIBRARIES) 
    Reason given by package: LAPACK could not be found because dependency BLAS could not be found.

-- Using GROMACS built-in LAPACK.
-- Performing Test HAS_WARNING_EVERYTHING
-- Performing Test HAS_WARNING_EVERYTHING - Failed
-- Found Python: /usr/bin/python3.9 (found version "3.9.18") found components: Interpreter
-- Performing Test HAVE_NO_DEPRECATED_COPY
-- Performing Test HAVE_NO_DEPRECATED_COPY - Success
-- Found Python: /usr/bin/python3.9 (found version "3.9.18") found components: Interpreter Development Development.Module Development.Embed
-- Performing Test LINKER_SUPPORTS_NO_AS_NEEDED
-- Performing Test LINKER_SUPPORTS_NO_AS_NEEDED - Success
-- Performing Test HAS_NO_STRINGOP_TRUNCATION
-- Performing Test HAS_NO_STRINGOP_TRUNCATION - Success
-- Performing Test HAS_WARNING_NO_CAST_FUNCTION_TYPE_STRICT
-- Performing Test HAS_WARNING_NO_CAST_FUNCTION_TYPE_STRICT - Success
-- Performing Test HAS_NO_UNUSED
-- Performing Test HAS_NO_UNUSED - Success
-- Performing Test HAS_NO_UNUSED_PARAMETER
-- Performing Test HAS_NO_UNUSED_PARAMETER - Success
-- Performing Test HAS_NO_MISSING_DECLARATIONS
-- Performing Test HAS_NO_MISSING_DECLARATIONS - Success
-- Performing Test HAS_NO_NULL_CONVERSIONS
-- Performing Test HAS_NO_NULL_CONVERSIONS - Success
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Performing Test HAS_WARNING_NO_DEPRECATED_NON_PROTOTYPE
-- Performing Test HAS_WARNING_NO_DEPRECATED_NON_PROTOTYPE - Success
-- Looking for dlopen
-- Looking for dlopen - found
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE pygments) (Required is at least version "4.0.0")
-- Could NOT find LATEX (missing: LATEX_COMPILER) 
-- Configuring done (12.0s)
-- Generating done (0.7s)
-- Build files have been written to: /opt/package/gromacs/gromacs-2025.0/build

When I run a simulation with PLUMED, the environment variable is set:

echo $PLUMED_KERNEL 
/opt/software/plumed-2.9.3/lib/libplumedKernel.so

Hmm, this looks OK to me. Since you set GMX_USE_PLUMED=ON, cmake should issue a fatal error when it can’t create the interface. Can you make sure that you’re sourcing the correct GROMACS build when you try and run the simulation with PLUMED? Otherwise, this could be a bug.

Actually, I’m able to reproduce your problem, so this looks like a bug. I went ahead and created an issue on Gitlab, which you can follow here.

Just to update: This should get fixed in the next patch release 2025.1, but in the meantime, as a simple workaround it seems to be enough to just run CMake twice.

Thanks. I have compiled GROMACS with PLUMED by run CMake twice, and run some simulations!