Share 
Follow 
AboutDownloadsDocumentsForumsWikiIssuesNews
Date:
2016-06-02 21:07
Priority:
3
State:
Open
Submitted by:
D Greene (tonberry)
Assigned to:
Nobody (None)
Resolution:
none
Summary:
OpenMM import error: undefined symbol

Detailed description
Hi everyone,

I am trying to install OpenMM and am running into an issue when I try to test the installation afterwards. I did not conda install openMM; instead, I followed the instructions given here for Linux: http://docs.openmm.org/7.0.0/userguide/application.html

I followed the linux instructions where I downloaded the distro, unzipped, entered the folder, and then did: sudo install.sh from the command line (I followed the steps exactly as given, using the default locations for python, etc. as the installation instructions recommended, and I skipped all of the optional steps for the Cuda and whatnot). There were no errors given during the installation itself, but when I ran the test script afterwards I got this error:

$ python -m simtk.testInstallation
Failed to import OpenMM packages; OpenMM will not work.
Make sure OpenMM is installed and the library path is set correctly.

Error message: /usr/local/lib/python2.7/dist-packages/simtk/openmm/_openmm.so: undefined symbol: _ZN6OpenMM23CustomCentroidBondForce20addTabulatedFunctionERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_17TabulatedFunctionE

If you need any other info from me please just let me know.

Thanks in advance for your time.

Add A Comment: Notepad

Message  ↓
Date: 2018-02-12 18:22
Sender: Kent Wenger

I installed miniconda (version is 4.4.9) (it installed into ~/miniconda2).

Then I think I just ran
~/miniconda2/bin/conda install -c omnia openmm

Date: 2018-02-10 00:29
Sender: Peter Eastman

Sounds like it didn't get installed correctly. Can you describe exactly what steps you followed? What python distribution did you start with (e.g. Anaconda 5.0.1 Python 3.6 for Linux), where is it installed (in your home directory I assume?), and what command did you type to install OpenMM?

Date: 2018-02-09 19:49
Sender: Kent Wenger

With the conda install I got:
Failed to import OpenMM packages; OpenMM will not work.
Make sure OpenMM is installed and the library path is set correctly.

Error message: libOpenMM.so: cannot open shared object file: No such file or directory

(Note that I didn't do 'sudo conda install...' I just did it as a normal user, so it installed everything in my home directory. I'm not sure if it would have put things in /usr/local or something if I had sudo'ed it.)

I didn't try setting LD_LIBRARY_PATH to the appropriate directory, which might have fixed things...

Date: 2018-02-09 19:46
Sender: Peter Eastman

What failure did you get running the test script with the conda install?

Date: 2018-02-09 19:33
Sender: Kent Wenger

I was installing OpenMM 7.1.1 on Ubuntu 16.04, and I ran into exactly the same problem (when I installed with install.sh). So after looking at the various comments here, I tried installing with conda. That also gave me a (different) failure when running the test script -- I'm not sure I did the conda installation correctly.

However, the really interesting thing is this: when I did the conda installation, I got a different _openmm.so than when I did the install.sh installation. The install.sh one has (undefined) references to the CustomCentroidBondForce method, and the one from conda does not. (Even though version.py is the same, including the git_revision string.)

I got things to work by installing with install.sh, and then manually copying the _openmm.so from the conda installation over the one from the install.sh installation...

Date: 2017-10-10 16:48
Sender: Peter Eastman

Try installing with conda. That tends to have fewer problems.

Date: 2017-10-10 16:31
Sender: weitong ren

I got the similar error:

---------------------------------------
Failed to import OpenMM packages; OpenMM will not work.
Make sure OpenMM is installed and the library path is set correctly.

Error message: /share/home/wangj/software/anaconda2/lib/python2.7/site-packages/simtk/openmm/_openmm.so: undefined symbol: _ZTVNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEE
-----------------------------------------
I installed the OpenMM-7.1.1 on a cluster followed the linux instructions.
Does anyone have a solution?

Date: 2017-06-21 10:51
Sender: Mateusz Bieniek

I compiled the code on Ubuntu 16.04 and now I can import openmm and run the examples.

Date: 2017-06-21 09:25
Sender: Mateusz Bieniek

The same issue happened to me on Ubuntu 16.04. After installation I cannot import openmm:
python -c 'from simtk import openmm'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/simtk/openmm/__init__.py", line 19, in <module>
from simtk.openmm.openmm import *
File "/usr/local/lib/python2.7/dist-packages/simtk/openmm/openmm.py", line 28, in <module>
_openmm = swig_import_helper()
File "/usr/local/lib/python2.7/dist-packages/simtk/openmm/openmm.py", line 24, in swig_import_helper
_mod = imp.load_module('_openmm', fp, pathname, description)
ImportError: /usr/local/lib/python2.7/dist-packages/simtk/openmm/_openmm.so: undefined symbol: _ZN6OpenMM23CustomCentroidBondForce20addTabulatedFunctionERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_17TabulatedFunctionE

The following variables were present:
OPENMM_INCLUDE_PATH to /usr/local/openmm/include
OPENMM_LIB_PATH to /usr/local/openmm/lib
LD_LIBRARY_PATH to /usr/local/openmm/lib:...

Thanks

Date: 2017-06-19 14:35
Sender: Mateusz Bieniek

I am running into a similar issue using the linux installation.

python -m simtk.testInstallation dresio@archy
Failed to import OpenMM packages; OpenMM will not work.
Make sure OpenMM is installed and the library path is set correctly.

Error message: /usr/lib/python3.6/site-packages/simtk/openmm/_openmm.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN6OpenMM23CustomCentroidBondForce20addTabulatedFunctionERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_17TabulatedFunctionE

Similarly:

python -c 'from simtk import openmm' dresio@archy
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.6/site-packages/simtk/openmm/__init__.py", line 19, in <module>
from simtk.openmm.openmm import *
File "/usr/lib/python3.6/site-packages/simtk/openmm/openmm.py", line 28, in <module>
_openmm = swig_import_helper()
File "/usr/lib/python3.6/site-packages/simtk/openmm/openmm.py", line 24, in swig_import_helper
_mod = imp.load_module('_openmm', fp, pathname, description)
File "/usr/lib/python3.6/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.6/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: /usr/lib/python3.6/site-packages/simtk/openmm/_openmm.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN6OpenMM23CustomCentroidBondForce20addTabulatedFunctionERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPNS_17TabulatedFunctionE

Which looks rather similar to:
https://github.com/omnia-md/openmm-dev/issues/15


I am using arch linux.

Date: 2016-08-17 20:21
Sender: sbgrid admin

I've seen the same - install.sh completes with status 0 and then the test fails (not using Anaconda python).

As an aside - it looks like pip by default will install (the different) "openmm" that is rev 0.2, but "OpenMM" is apparently not known to pip by default. And pip apparently cannot distinguish between "openmm" and "OpenMM" once *either* one of them is installed in a given python distribution. Or apparently pip cannot work with/list/install both "openmm" and "OpenMM". It seems there is a kind of "package name space pollution" going on that is incompatible with the standard install tools.

Date: 2016-06-02 22:46
Sender: D Greene

I don't think I have multiple copies of OpenMM installed as I had never attempted to install it before last night. I have installed other things like numpy and openeye to run on python 2.7 and those run fine (to verify I just did a check a few moments ago, and I was able to import and run openeye and numpy on an ipython notebook without any issues).

I should mention that I did try to install mdtraj, nglview, parmed, and openmoltools last night before trying to install the main OpenMM package (I actually only attempted to install the main OpenMM after I got an error while running the test script for openmoltools).

Here are the contents of my /usr/local/lib/python2.7/dist-packages folder if it helps:

Cython
Cython-0.24.dist-info
cython.py
cython.pyc
easy-install.pth
ipywidgets
ipywidgets-4.1.1.dist-info
jupyter-1.0.0.dist-info
jupyter_console
jupyter_console-4.1.1.dist-info
jupyter.py
jupyter.pyc
mdtraj
mdtraj-1.7.2-py2.7.egg-info
nglview
nglview-0.4+202.ge7ee8e5-py2.7.egg-info
numpy
numpy-1.11.0-py2.7.egg-info
openeye
OpenEye_toolkits_python2.7_ubuntu_14.04_x64-2016.2.1-py2.7.egg-info
OpenMM-7.0.1.egg-info
openmoltools-0.7.1.dev0-py2.7.egg
ParmEd-2.5.1-py2.7-linux-x86_64.egg
pyximport
qtconsole
qtconsole-4.2.1.dist-info
simtk
solvationtoolkit-0.2.4.dev0-py2.7.egg

Thanks for the help!

Date: 2016-06-02 21:12
Sender: Peter Eastman

Just a guess, but do you have multiple copies of OpenMM installed on your computer? That looks to me like the Python module is from one release, but it's trying to link to the C++ libraries from a different release. That could happen, for example, if your LD_LIBRARY_PATH points to an older version.

No Changes Have Been Made to This Item

Feedback