Page 1 of 1

Install OpenMM without Conda

Posted: Tue Nov 16, 2021 7:17 am
by jarunan
Dear all,

I would like to install OpenMM on our server as a Python module without using Conda. What are dependencies for OpenMM? Is there a way to use "pip install" or "python" commands for installation?

Thank you and best regards,
Jarunan

Re: Install OpenMM without Conda

Posted: Tue Nov 16, 2021 8:14 am
by egallicc
To install the OpenMM libraries without Conda we like to have:

set(PYTHON_SETUP_COMMAND "install --prefix=${CMAKE_INSTALL_PREFIX}")

in wrappers/python/CMakeLists.txt instead of the default, which I think is

set(PYTHON_SETUP_COMMAND "install --root=\$ENV{DESTDIR}/")

That way the python wrappers are installed under the same folder as the OpenMM libraries. I am not sure it is the best way to do it, but it works for us.

Re: Install OpenMM without Conda

Posted: Tue Nov 16, 2021 9:47 am
by peastman
The conda packages are the only precompiled versions, but you can compile from source. See the documentation at http://docs.openmm.org/development/user ... iling.html.

Re: Install OpenMM without Conda

Posted: Wed Nov 17, 2021 7:25 am
by jarunan
Thank you very much for both replies. I followed the instruction in the link http://docs.openmm.org/development/user ... iling.html to install openmm 7.5.1 to be used with AlphaFold. However, only `import simtk.openmm` works, not `import openmm`. Is this what to expect?

Code: Select all

$ python
Python 3.8.5 (default, Oct  6 2020, 10:04:29) 
[GCC 6.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import simtk.openmm
>>> import openmm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'openmm'
Here are the compilation and installation commands:

Code: Select all

$ source /cluster/apps/alphafold/venv_alphafold/bin/activate
(venv_alphafold)$ cmake -DCMAKE_INSTALL_PREFIX=/cluster/apps/alphafold/openmm/7.5.1 -DPYTHON_EXECUTABLE=/cluster/apps/alphafold/venv_alphafold/bin/python ..
(venv_alphafold)$ make -j4
(venv_alphafold)$ make install
(venv_alphafold)$ make PythonInstall

Re: Install OpenMM without Conda

Posted: Wed Nov 17, 2021 9:42 am
by peastman
Yes, that's correct. The simplified namespace was introduced in 7.6. You can still "import simtk.openmm" in 7.6. It will just show a deprecation warning.

Re: Install OpenMM without Conda

Posted: Thu Nov 18, 2021 12:31 am
by jarunan
It's clear now. Thank you for your quick response!

Best regards,
Jarunan