The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
-
Hoa Thanh Le
- Posts: 5
- Joined: Thu Dec 12, 2024 2:16 am
Post
by Hoa Thanh Le » Thu Dec 12, 2024 2:24 am
Dear Developers,
I am trying to install the Python API using source code. The platform is x64 Linux GNU with CUDA. When I invoke this command:
or try to run a tutorial script, I encounter this error:
Code: Select all
Traceback (most recent call last):
File "<frozen runpy>", line 189, in _run_module_as_main
File "<frozen runpy>", line 112, in _get_module_details
File "/path/to/miniconda3/lib/python3.12/site-packages/openmm/__init__.py", line 24, in <module>
from openmm.openmm import *
File "/path/to/miniconda3/lib/python3.12/site-packages/openmm/openmm.py", line 10, in <module>
from . import _openmm
ImportError: /path/to/miniconda3/lib/python3.12/site-packages/openmm/_openmm.cpython-312-x86_64-linux-gnu.so: undefined symbol: _ZN6OpenMM30AmoebaGeneralizedKirkwoodForce19setDielectricOffsetEd
Apparently it has something to do with the AMOEBA forcefield.
I'm looking forward to receiving help from you.
Best regards,
Hoa T. Le
-
Peter Eastman
- Posts: 2602
- Joined: Thu Aug 09, 2007 1:25 pm
Post
by Peter Eastman » Thu Dec 12, 2024 9:35 am
I'm not sure what would cause that error. Clearly something to do with the way it was built. That symbol should be found in libOpenMMAmoeba.so, which will be located in the lib subdirectory inside wherever you told CMake to install with CMAKE_INSTALL_PREFIX. You can use "nm -gD /path/to/libOpenMMAmoeba.so" to list the symbols in it and confirm that one is really there. And make sure it's a directory Python searches for libraries.
-
Hoa Thanh Le
- Posts: 5
- Joined: Thu Dec 12, 2024 2:16 am
Post
by Hoa Thanh Le » Thu Dec 12, 2024 8:09 pm
Hi Eastman,
Thank you for your help. That symbol is in the libOpenMMAmoeba.so file, which is located in the directory specified by CMAKE_INSTALL_PREFIX. I've also included the installation directory to the PYTHONPATH environment variable, rebuild PythonInstall, run:
And the error happened again.
By the way, does the OpenMM package on conda support CUDA?
Kind regards,
Hoa T. Le
-
Peter Eastman
- Posts: 2602
- Joined: Thu Aug 09, 2007 1:25 pm
Post
by Peter Eastman » Thu Dec 12, 2024 9:41 pm
Perhaps the directory you set with CMAKE_INSTALL_PREFIX is somewhere Python isn't looking for libraries?
By the way, does the OpenMM package on conda support CUDA?
Yes.
-
Hoa Thanh Le
- Posts: 5
- Joined: Thu Dec 12, 2024 2:16 am
Post
by Hoa Thanh Le » Thu Dec 12, 2024 10:43 pm
Perhaps the directory you set with CMAKE_INSTALL_PREFIX is somewhere Python isn't looking for libraries?
My CMAKE_INSTALL_PREFIX is /usr/local/openmm
My Python package is installed via conda. From what I read, environment variable also works for Conda. So, I added the cmake install prefix directory into the PYTHONPATH environment variable. After that, the error persists.
Originally, I set OPENCL_INCLUDE and OPENCL_LIBRARY to be the OpenCL of CUDA. It did not solve the problem. Then, I left them as default, which was the OpenCL provided by conda. The issue was finally fixed.