openmm / openmm-plumed

OpenMM plugin to interface with PLUMED
55 stars 23 forks source link

install plugin with custom versions openMM #57

Open georopon opened 2 years ago

georopon commented 2 years ago

hi,

I like install plumed plugin with last version of openMM (7.7), but not have clear as make it task.

please, can help me.

raimis commented 2 years ago

Here are the instructions: https://github.com/openmm/openmm-plumed#installing-the-plugin

georopon commented 2 years ago

Thanks so much!

PedroHuertaRoque commented 2 years ago

Hi, When I build the plugin I get this error:

make install

No such file or directory 32 | #include "openmm/OpenMMException.h" | ^~~~~~ compilation terminated. make[2]: [CMakeFiles/OpenMMPlumed.dir/build.make:63: CMakeFiles/OpenMMPlumed.dir/openmmapi/src/PlumedForce.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:137: CMakeFiles/OpenMMPlumed.dir/all] Error 2 make: *** [Makefile:141: all] Error 2

please, can help me.

raimis commented 2 years ago

@PedroHuertaRoque is any reason to build the plugin from the source rather than using conda (https://github.com/openmm/openmm-plumed#installing-the-plugin)?

tonigi commented 2 years ago

See if this helps https://github.com/giorginolab/miniomm/wiki/4.-Installing-OpenMM-Plumed-plugin

peastman commented 2 years ago

That suggests that OPENMM_DIR isn't set correctly in CMake. It isn't finding the header files.

jgninterline commented 9 months ago

Has anyone made progress on this? I have to compile plumed from source since I need a non-standard feature, so I assume that I need to install the plugin from source too.

I have openmm installed from conda so I set OPENMM_DIR to "~/miniconda3/envs/openmm-plumed/include", which contains "openmm/OpenMMException.h". grepping "OPENMM_DIR" shows that the path is correctly set in CMakeCache.txt, but CMakeLists.txt seems to both have an incorrect path (/usr/local/openmm) and the directory structure doesn't match the conda installation. (include and lib aren't in the OPENMM_DIR)

Is there a way to install plumed and the plugin with openmm from conda or do I need to install the whole stack from scratch?

UPDATE

Installing with OpenMM compiled from source worked. I did have to use "/path_to_plumed/plumed/include/plumed" for PLUMED_INCLUDE_DIR rather than "/path_to_plumed/plumed/include" as I would have expected.

tonigi commented 9 months ago

A while ago I wrote this. Not sure if still relevant. https://github.com/giorginolab/miniomm/wiki/4.-Installing-OpenMM-Plumed-plugin

peastman commented 9 months ago

I think you want to set OPENMM_DIR to ../miniconda3/envs/openmm-plumed. It expects to find include and lib directories inside the home directory.

The value set in CMakeLists.txt is just the default. It gets overridden by whatever value you choose.

jgninterline commented 9 months ago

Thanks for your help, both!

Attacking the problem on two fronts. I have separate conda environments for each, but currently have shared openmm-plumed and plumed installations.

First, trying to install everything from source. Using both my settings and @tonigi's, everything compiles OK, however I get a CUDA_ERROR_UNSUPPORTED_PTX_VERSION when I try to run the CUDA tests. According to this post, it could be a CUDA version incompatibility. I'm running driver 470.182.03 and and just installed CUDA 11.4 which, according to the table @peastman referenced in that thread, should be compatible, but I still get the error. (and they ship together according to our network admin)

I'm also trying to get the conda installation working. @peastman's suggestion worked to install the plugin, however, when I run "make PythonInstall", I get:

$ make PythonInstall [100%] Generating PlumedPluginWrapper.cpp /home/gnelson/miniconda3/envs/openmm-plumed/include/swig/OpenMMSwigHeaders.i:12: Error: Unknown directive '%factory'. make[3]: [python/CMakeFiles/PythonInstall.dir/build.make:73: python/PlumedPluginWrapper.cpp] Error 1 make[2]: [CMakeFiles/Makefile2:434: python/CMakeFiles/PythonInstall.dir/all] Error 2 make[1]: [CMakeFiles/Makefile2:441: python/CMakeFiles/PythonInstall.dir/rule] Error 2 make: [Makefile:283: PythonInstall] Error 2

and python can't find openmmplumed. (the installation does work otherwise, including on the GPU) I know nothing about swig so let me know what other information I can provide.

peastman commented 9 months ago

The CUDA_ERROR_UNSUPPORTED_PTX_VERSION is generally caused by using a CUDA toolkit that is newer than what your driver supports. Your driver is fairly old. Can you upgrade it? Another thing that can cause this problem is if you've set the OPENMM_CUDA_COMPILER environment variable to tell it to use a specific version of nvcc, which may be more recent than what you think you're using. In OpenMM 8.1 we're getting rid of the option to use nvcc. It will always use nvrtc from the toolkit, which should eliminate that problem.

The Unknown directive '%factory' error was introduced by an update to SWIG. OpenMM 8.1 will also have a workaround for it. In the mean time you can work around it in the OpenMM-PLUMED code by adding the line %include "factory.i" to plumedplugin.i, immediately after the %module line. See https://github.com/openmm/openmm/issues/3989.

jgninterline commented 8 months ago

thanks @peastman!

I compiled everything on my local machine with cuda 11.8 and driver 520 and, as you predicted, the CUDA error went away. I'm now running into a problem making the openmm-plumed python installation:

$ make PythonInstall In file included from PlumedPluginWrapper.cpp:3194: /path/to/openmm-plumed-master/openmmapi/include/PlumedForce.h:35:10: fatal error: openmm/Context.h: No such file or directory

include "openmm/Context.h"

      ^~~~~~~~~~~~~~~~~~

compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1 make[3]: [python/CMakeFiles/PythonInstall.dir/build.make:78: PythonInstall] Error 1 make[2]: [CMakeFiles/Makefile2:434: python/CMakeFiles/PythonInstall.dir/all] Error 2 make[1]: [CMakeFiles/Makefile2:441: python/CMakeFiles/PythonInstall.dir/rule] Error 2 make: [Makefile:283: PythonInstall] Error 2

I assume make just isn't looking in the right place or something simple like that since Context.h is located in CMAKE_INSTAL_PREFIX/include/openmm as I would expect.