Opened 9 years ago
Closed 9 years ago
#497 closed defect (fixed)
Using tug atoms or ISOLDE on Mac cannot find OpenMM CPU platform
Reported by: | Owned by: | Tom Goddard | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Platform | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
OpenMM can only find the reference platform on Mac when using ISOLDE or the tug atoms mouse mode. This bug does not happen in my current development ChimeraX install but the daily build has the problem. Tug atoms and ISOLDE set an environment variable on Linux OPENMM_PLUGIN_DIR to find the libraries needed for the openmm platforms (cpu, cuda, opencl, ...) to chimerax lib/plugins. In the past the Mac version seemed to be able to find the plugins directory. If I set the environment variable on Mac in tug atoms it fixes the problem.
Traceback (most recent call last):
File "/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/ui/mousemodes.py", line 340, in <lambda>
gw.mousePressEvent = lambda e, s=self: s._dispatch_mouse_event(e, "mouse_down")
File "/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/core/ui/mousemodes.py", line 281, in _dispatch_mouse_event
f(MouseEvent(event))
File "/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/tug/tugatoms.py", line 66, in mouse_down
self._tugger = st = StructureTugger(a.structure)
File "/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/tug/tugatoms.py", line 188, in init
self._create_openmm_system()
File "/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/chimerax/tug/tugatoms.py", line 313, in _create_openmm_system
platform = mm.Platform.getPlatformByName(self._platform_name)
File "/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/simtk/openmm/openmm.py", line 15450, in getPlatformByName
return _openmm.Platform_getPlatformByName(name)
Exception: There is no registered Platform called "CPU"
Exception: There is no registered Platform called "CPU"
File "/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/simtk/openmm/openmm.py", line 15450, in getPlatformByName
return _openmm.Platform_getPlatformByName(name)
See log for Python traceback.
Begin forwarded message:
From: Tristan Croll
Subject: Re: New version of ISOLDE online
Date: December 5, 2016 at 6:42:19 AM PST
To: Tom Goddard
Hi all,
For the time being, I've just tweaked the makefile to bundle all .so, .dylib and .dll files from the ISOLDE directory, and have modified the Python code to load the correct one based on the value of sys.platform. Any compiled libraries I'll be making at this stage are going to be tiny anyway, so I don't think this is a big deal. Can re-visit to create fully system-specific builds once everything is more mature. I don't have a Windows development environment set up yet, so there's no .dll, but I've set up and tested the build on my wife's iMac. A few things I noted on that:
- Her machine was still running El Cap. In that environment ChimeraX started OK, but trying to download from the Toolshed crashed it with a dependency issue. Didn't save the specific message, I'm afraid, but a quick Google said it was connected to Python 3.5. I suspect you're not too worried about supporting El Cap in any case.
- After upgrading to Sierra, the next issue I ran into was that an out-of-the-box ChimeraX installation doesn't have permissions to write into its own directories, which of course caused the Toolshed installation to fail. Easily fixed at the command line by running 'sudo chown -R <user> Applications/ChimeraX.app', but non-ideal.
- ISOLDE runs, but OpenMM only shows the Reference implementation as being available.
In any case, I've uploaded a new version which should run on both Linux and Mac. Will set up an environment in Windows on my laptop hopefully tonight.
Cheers,
Tristan
Fixed tug atoms to set OPENMM_PLUGINS_DIR on Mac.
Tristan, you will should make the same fix to ISOLDE changing in isolde.py the "if platform == 'linux'" to "if platform == 'linux' or platform == 'darwin'" in the initialize_openmm() routine.
I'm not sure why this used to work. But I don't know how OpenMM finds its plugins. Since we have to set the environment variable on Linux, may as well set it on Mac too so OpenMM finds its plugins. On Windows Conrad patched the openmm install to allow it to find the plugins directory.