Opened 9 years ago

Closed 8 years ago

#653 closed defect (fixed)

Odd library problem installing OpenMM 7.1.0

Reported by: Tristan Croll Owned by: tic20@…
Priority: major Milestone: 0.7
Component: Tool Shed Version:
Keywords: Cc: goddard@…
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

As per Tom's suggestion a while back, I've installed OpenMM 7.1.0 into ChimeraX's Python on my machine - and come across the following little oddity. If I try to run ISOLDE immediately after starting ChimeraX, it crashes back to the command line on hitting the line:

from simtk.openmm import Platform

with the backtrace pasted below. The weird thing is that if I first open the shell and type:

from simtk import openmm

and then run ISOLDE, everything works just fine. Nothing changes if I add the ... import openmm line to ISOLDE prior to importing Platform. From the backtrace, the crash is due to it finding the main libOpenMM.so in the new location (/home/tic20/apps/openmm-7.1.0/lib), but still finding the OpenMM plugin libraries in the old location (/home/tic20/apps/chimerax/lib/plugins). So it would seem that imports via the shell and imports via the back end see slightly different library search paths.

Top of the stack trace:

*** Error in `/home/tic20/apps/chimerax/bin/ChimeraX': malloc(): memory corruption: 0x0000000005bef5b0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7e89d)[0x7f7ccab9d89d]
/lib64/libc.so.6(__libc_malloc+0x4c)[0x7f7ccab9f26c]
/home/tic20/apps/gcc-4.9.2/lib64/libstdc++.so.6(_Znwm+0x18)[0x7f7ccb4584a8]
/home/tic20/apps/openmm-7.1.0/lib/libOpenMM.so(_ZNSt8_Rb_treeISsSt4pairIKSsPN6OpenMM13KernelFactoryEESt10_Select1stIS5_ESt4lessISsESaIS5_EE17_M_insert_unique_ESt23_Rb_tree_const_iteratorIS5_ERKS5_+0x23e)[0x7f7beaded4ee]
/home/tic20/apps/openmm-7.1.0/lib/libOpenMM.so(_ZN6OpenMM8Platform21registerKernelFactoryERKSsPNS_13KernelFactoryE+0x11c)[0x7f7beadebc1c]
/home/tic20/apps/openmm-7.1.0/lib/libOpenMM.so(_ZN6OpenMM17ReferencePlatformC1Ev+0x16f)[0x7f7beae340af]
/home/tic20/apps/chimerax/lib/plugins/libOpenMMCPU.so(_ZN6OpenMM11CpuPlatformC2Ev+0x14)[0x7f7be9c48434]
/home/tic20/apps/chimerax/lib/plugins/libOpenMMCPU.so(registerPlatforms+0x30)[0x7f7be9c483c0]
/home/tic20/apps/openmm-7.1.0/lib/libOpenMM.so(_ZN6OpenMM8Platform24loadPluginsFromDirectoryERKSs+0x457)[0x7f7beadeb107]
/home/tic20/apps/chimerax/lib/python3.6/site-packages/simtk/openmm/_openmm.cpython-36m-x86_64-linux-gnu.so(+0xf1e2c)[0x7f7beb2b3e2c]

Change History (8)

comment:1 by Tristan Croll, 9 years ago

Cc: Tristan Croll added

comment:2 by Conrad Huang, 8 years ago

Owner: changed from Conrad Huang to Tom Goddard

TomG handles OpenMM installation. Maybe this is already fixed?

comment:3 by Tom Goddard, 8 years ago

Owner: changed from Tom Goddard to tic20@…

I don't know how OpenMM finds its plugins on linux. But I have worked around this problem in the past. Maybe you can find a better solution.

In the tug atoms mouse mode I have an initialize_openmm() routine called before importing OpenMM that sets the environment variable that tells OpenMM where to find its plugins.

Source code file

chimerax/src/bundles/tug/src/tugatoms.py

_openmm_initialized = False
def initialize_openmm():

# On linux need to set environment variable to find plugins.
# Without this it gives an error saying there is no "CPU" platform.
global _openmm_initialized
if not _openmm_initialized:

_openmm_initialized = True
from sys import platform
if platform == 'linux' or platform == 'darwin':

from os import environ, path
from chimerax import app_lib_dir
environOPENMM_PLUGIN_DIR = path.join(app_lib_dir, 'plugins')

comment:4 by Tom Goddard, 8 years ago

Cc: goddard@… added; Tristan Croll removed

comment:5 by Eric Pettersen, 8 years ago

Milestone: Beta Release0.5

Milestone renamed

comment:6 by Conrad Huang, 8 years ago

Milestone: 0.50.6

comment:7 by Tom Goddard, 8 years ago

Milestone: 0.60.7

Tristan, is this OpenMM issue resolved? Could you close it if it is?

comment:8 by Tristan Croll, 8 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.