Gromacs patched with Libtorch

GROMACS version: 2025.2
GROMACS modification: Yes/No
Hi all, I am trying to patch gromacs 2025.2 with libtorch 2.4.

When i run

cmake ..  -DGMX_GPU=CUDA  -DGMX_MPI=OFF  -DGMX_BUILD_OWN_FFTW=ON  -DTorch_DIR=/opt/libtorch/share/cmake/Torch/    -DCMAKE_INSTALL_PREFIX=/usr/bin:/opt/

I get the error

CMake Error at /usr/lib64/python2.7/site-packages/cmake/data/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):  Could NOT find Python (missing: Python_INCLUDE_DIRS Python_LIBRARIES  Development Development.Module Development.Embed) (found version "2.7.18")Call Stack (most recent call first):  /usr/lib64/python2.7/site-packages/cmake/data/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)  /usr/lib64/python2.7/site-packages/cmake/data/share/cmake-3.28/Modules/FindPython.cmake:616 (find_package_handle_standard_args)  src/gromacs/applied_forces/nnpot/CMakeLists.txt:49 (find_package)`

I have python 2.7 and python 3.6 in /usr/binbut that’s not making it work.

I installed cmake 3.28.4 with pip2 pip2 install cmake.

Thank you for your help !

It is the python library, not the binary, that cannot be found. You need to have the python 3 library install directory in your linker path.