-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can not import PlumedForce #10
Comments
I realized the PLUMED_BUILD_PYTHON_WRAPPERS is off by default. I changed it to ON and run "make PythonInstall" and the errors become /bin/sh: 1: SWIG_EXECUTABLE-NOTFOUND: not found Thanks for helping. |
That means it couldn't find SWIG. Have you installed it? Is SWIG_EXECUTABLE set correctly? |
Thanks for replying. However, every time I import openmmplumed, I get And I can see the file in the build/lib dir. It just can not read it. Should I change some path? --Hongbin |
It's also possible the error message is incorrect: the file is there, but it couldn't be opened because it depends on something else that's missing. For example, make sure the PLUMED library directory is in your LD_LIBRARY_PATH. You can use |
I double checked my anaconda dir, and there were no libOpenMMPlumed.so found there. I am not quite sure if it will solve all the issues on my work-station(ubuntu), and I am going to do some quick distance meta-dynamics simulations to see the performance. Thanks a lot for helping. |
Check the output from 'make PythonInstall' carefully. It should be copying that file to somewhere. Make sure no errors are being reported. |
I think I made a mistake. I typed in " run python install" (no errors) instead of "make PythonInstall"(shows the following errors) [100%] Generating PlumedPluginWrapper.cpp And the running tests show Exception: Specified a Platform for a Context which does not support all required kernels Moreover, the openmm simulations without plumed run well without any errors. --Hongbin |
It looks like
It didn't mention anything about CUDA or OpenCL, though, so I gather you have |
I have PLUMED_BUILD_CUDA_LIB and PLUMED_BUILD_OPENCL_LIB on. See followings. CMAKE_BUILD_TYPE Release The testing systems: Before I run openmm-plumed to do NMR restraints simulations, I have done several similar gromacs+plumed simulations before. See followings. The error message is Exception: Specified a Platform for a Context which does not support all required kernels import openmmplumed class Tee(object): integrator = mm.LangevinIntegrator(300unit.kelvin, 91.0/unit.picoseconds,2.0unit.femtoseconds) |
Hi Peter, I re-installed everything and no errors there. But the simulation still gives me: And without doing system.addForce(PlumedForce(plumed_script)), everything works fine. --Hongbin |
Try this: from simtk.openmm import *
print(pluginLoadedLibNames)
print(Platform.getPluginLoadFailures()) What does that print? |
In [1]: from simtk.openmm import * In [2]: print(pluginLoadedLibNames) In [3]: print(Platform.getPluginLoadFailures()) Should I expect libOpenMMPlumedReference.so ?? |
That looks like the libraries for the Plumed plugin haven't been installed. First verify what directory it's loading the plugins from: print(version.openmm_library_path) Now check that directory. Are the Plumed plugin libraries there? |
The output is: |
We have tried a lot different CMAKE_INSTALL_PREFIX, and still can not merge the plumed plugins libraries to openMM. Our ccmake file is attached. Is there anything we can do to solve this issue? Thanks a lot for helping. CMAKE_BUILD_TYPE Release |
It's possible conda is splitting up the files in a way that doesn't match the expected directory structure. If that's the case, though, there's an easy workaround. Add a call to |
I used Platform.loadPluginsFromDirectory() as you mentioned to load the OpenMMPlumed**.so files, and it worked well. Thank you very much for helping with everything. |
Dear All, banging my head while trying to build openmm-plumed - could somebody help me? I have successfully compiled cmake-3.10.0, plumed-2.3.3, and openmm-7.1.1 For openmm-plumed, I set the following options (no OpenCL, just CUDA with toolkit 7.0) after CMAKE_BUILD_TYPE Release after I "configured" again and "generated" with error messages, I execute make install and get the following error message: I don't seem to find "ibOpenMMPlumed.so" anywhere
Thanks! |
That means the linker wasn't able to find Plumed to link against. You specified
What's contained in that directory? Is libplumed.so there? |
Great, thanks, Peter! Solution is to change Which python import commands do I have to use to able to use PlumedForce within an openmm/python session, i.e. to make the example code work: //////////// Thanks again, |
from openmmplumed import PlumedForce I should add that to the readme. |
OK, that means something is potentially wrong with my installation (I cannot import or even manually find this module). "openmmplumed" should reside somewhere in (I had to build OpenMM from a linux binary, so not directly via conda) Thanks! |
Did you |
great, thanks Peter! in addition, adding the library paths for both plumed and openmm to the environment variable Thanks again, |
Hi Peter, $ As at 100% I get this error and if I run So I used Exception: Specified a Platform for a Context which does not support all required kernels I can't figure how to resolve this. Please help. |
The relevant part of the error log is
That means it couldn't find the CUDA library to link against. Make sure you have |
I have set the correct path to CMAKE_BUILD_TYPE |
Are you sure |
Yes. The cuda library is accessible on both login node and compute nodes. |
It is working when I load the plugin with direct address of cuda platform |
That's very strange. It indicates that it's successfully built the CUDA plugin already. So why was it able to locate |
I have had the exact same problem as @juanmit and followed the comments to this point. What files I should be looking for when you say the 'Plumed plugins'? |
In your
Have you installed Plumed on your computer? Where is it? |
I have one file that looks like that: 'libOpenMMPlumed.dylib' it is in the directory where I ran the initial 'make PythonInstall' command. In the lib/plugins directory I have the following: It is worth noting that if I touch the libOpenMMPlumed.dylib file (moving it for example) I start getting a bunch of errors thrown when I try to import OpenMM in python. When I try to load the directory that contains 'libOpenMMPlumed.dylib' using Platform.loadPluginsFromDirectory() I still get the same error: Exception: No Platform supports all the requested kernels I do have Plumed installed - it was a conda install. I checked the installation with "plumed --is-installed" command which runs without error. I can track down where it is precisely if that is important. |
Looking over the make PythonInstall response there were a number of warnings generated. Most of them looked like this: but there were two warning towards the end: warning: directory not found for option '-L/Users/user_name/anaconda3/pkgs/openmm-7.2.2-py36_1/include/openmm/lib' /Users/user_name/anaconda3/envs/CGMD_OpenMM/include/openmm/GayBerneForce.h:292:23: warning: field 'epsilon' will be initialized after field 'xparticle' [-Wreorder] |
libOpenMMPlumed.dylib defines the API. It goes in the lib directory. The library defining the The file libOpenMMPlumedReference.dylib defines the implementation for the reference platform. There likewise might be ones for the OpenCL and/or CUDA platforms. They go in lib/plugins. They get dynamically loaded at runtime. If you don't have one for the platform you're trying to use, you'll get the message about "No Platform supports all the requested kernels" when you try to create a Context. Check the output from
Yes, the library needs to be able to link against it. PLUMED_LIBRARY_DIR should be set to the directory containing it. |
Looking back at the cmake I have the following which appears to be reasonable (which is to say there are plumed directories there): I found the following lines in the make result: copying build/lib.macosx-10.9-x86_64-3.6/_openmmplumed.cpython-36m-darwin.so -> /usrpath/anaconda3/envs/env_name/lib/python3.6/site-packages If I go to that directory (/usrpath/anaconda3/envs/env_name/lib/python3.6/site-packages) I do find those two files: Not sure if those are the files I'm looking for or not. If I point Platform.loadPluginsFromDirectory('/usrpath/anaconda3/envs/env_name/lib/python3.6/site-packages'), I get the following output: I assume I'm not reading the output of the make correctly. I apologize for the size of this, but I'm just going to post the whole thing and maybe that will help solve this riddle. |
Side note - just moving the libOpenMMPlumed.dylib to the lib directory does not work. After doing that when I try to import openMM it can't find the file (referenced from 'lib/python3.6/site-packages/_openmmplumed.cpython-36m-darwin.so' directly to where the file was put originally). |
_openmmplumed.cpython-36m-darwin.so is something different. That's the Python module. It's created during |
Well - I see the problem now at least. I wasn't running the make install, only the make PythonInstall. When I run make install there is a clear error "fatal error: 'wrapper/Plumed.h' file not found". The error arises in file: openmm-plumed-master/platforms/reference/src/ReferencePlumedKernelFactory.cpp. Looking through my files I find Plumed.h in /usrpath/anaconda3/envs/env_name/include/plumed/wrapper. My cmake has the Plumed include directory pointing to: /usrpath/anaconda3/envs/env_name/include, so that seems reasonable. This appears to be a similar error to what was previously seen in issue #8.. It sounds like the previous person solved this by modifying something in the cmake files themselves to change where it expected to find files, but it wasn't clear exactly which file should get modified. My apologies for being particularly slow. I appreciate all of the help. PS This is how far the install had proceeded before the error: |
Does it work if you set |
Ok, that's very strange. It looks like it's getting confused trying to interpret it as C++11. The thing is, OpenMM 7.2 doesn't use C++11, so it doesn't actually need to be turned on. 7.3 does use it, which is why the plugin's build script specifies it. Try installing the 7.3 beta (see https://simtk.org/plugins/phpBB/viewtopicPhpbb.php?f=161&t=9433&p=0&start=0&view=&sid=e423c3d0b3b6a5819dd549d758fbfd58), or alternatively remove this line from the plugin's build script: https://github.com/peastman/openmm-plumed/blob/master/CMakeLists.txt#L19 |
Well that is definitely better. I commented out the line you highlighted and now there are a slew of 'deprecated' warnings but it installs. Having done that, though, I'm now back to the previous python level problem:
Looking over the output file I get the following:
When I check where the python is looking for the libraries I find:
The next thing I tried was to just point to the env_name/include/lib/plugin folder explicitly.
That appears to work (in that two libraries are read in: 'libOpenMMPlumedOpenCL.dylib', 'libOpenMMPlumedReference.dylib'), but resulted in a kernel crash when I tried to actually run a python call to OpenMMPlumed. I also, for good measure, tried the loadPluginsFromDirectory() using env_name/include/lib/ but that resulted in the same exception error as before. |
That sounds like it might be the same problem discussed at frida/frida#338. They resolved it by running |
If you didn't already, you might also try rerunning cmake since some paths may have changed. |
Hi Peter,
I think I successfully installed the openmmplumed because it says %100 on the built target.
And I tried to export LD_LIBRARY_PATH=/usr/local/lib/plumed.
However, I can not import PlumedFOrce and it says "No module named openmmplumed".
Are there anything I missed in the installation process? Thanks for helping.
--Hongbin
The text was updated successfully, but these errors were encountered: