Hi,
the signature for the function `computeNeighborListVoxelHash` changed in 6.3, it now requires the periodic box vectors instead of the box size.
what is the easiest way for plugins to support both versions of this function?
thanks!
Support both OpenMM 6.2 and 6.3
- Peter Eastman
- Posts: 2588
- Joined: Thu Aug 09, 2007 1:25 pm
Re: Support both OpenMM 6.2 and 6.3
The simplest approach is probably just to use an #ifdef to control what arguments you pass based on the version you're compiling for.
Peter
Peter
- Andrea Zonca
- Posts: 17
- Joined: Tue Aug 19, 2014 1:32 pm
Re: Support both OpenMM 6.2 and 6.3
Thanks, how do I extract the current version of OpenMM at compilation time of a plugin?
- Peter Eastman
- Posts: 2588
- Joined: Thu Aug 09, 2007 1:25 pm
Re: Support both OpenMM 6.2 and 6.3
When OpenMM itself is compiled, the build script defines a set of constants for the version number (OPENMM_MAJOR_VERSION and OPENMM_MINOR_VERSION). You can do something similar when compiling your plugin: define constants to tell it what version to compile for.
Peter
Peter
- Andrea Zonca
- Posts: 17
- Joined: Tue Aug 19, 2014 1:32 pm
Re: Support both OpenMM 6.2 and 6.3
I wonder if it would be reasonable to rely on the Python wrapper, something like:
Code: Select all
python -c "from simtk import openmm; print(openmm.version.short_version)"
- Jason Swails
- Posts: 47
- Joined: Mon Jan 07, 2013 5:11 pm
Re: Support both OpenMM 6.2 and 6.3
Assuming you can rely on the simtk.openmm package belonging to the same installation as the OpenMM build whose libraries you are linking, that should work fine.
A word of caution here, though, is that it's easy to install multiple versions of the OpenMM libraries on the same machine, but more difficult to keep corresponding versions of the Python bindings for all of them. The standard workflow of "configure, install to a prefix" will dump the Python libraries in the site-packages for Python. So if you compile 6.2, then 6.3 and don't take care to specially handle the simtk packages, then you will be left with only a single set of Python bindings for OpenMM corresponding to version 6.3 (even if you try to link to 6.2 libraries).
So long story short, this is OK if you have only one OpenMM build on your system or if you have a robust way of keeping different Python bindings for different versions separate and properly loaded with each of the OpenMM versions you have installed. Otherwise, you may run into problems.
A word of caution here, though, is that it's easy to install multiple versions of the OpenMM libraries on the same machine, but more difficult to keep corresponding versions of the Python bindings for all of them. The standard workflow of "configure, install to a prefix" will dump the Python libraries in the site-packages for Python. So if you compile 6.2, then 6.3 and don't take care to specially handle the simtk packages, then you will be left with only a single set of Python bindings for OpenMM corresponding to version 6.3 (even if you try to link to 6.2 libraries).
So long story short, this is OK if you have only one OpenMM build on your system or if you have a robust way of keeping different Python bindings for different versions separate and properly loaded with each of the OpenMM versions you have installed. Otherwise, you may run into problems.
- Andrea Zonca
- Posts: 17
- Joined: Tue Aug 19, 2014 1:32 pm
Re: Support both OpenMM 6.2 and 6.3
Thanks Jason,
I was actually more concerned about users that only use OpenMM C++ and don't even install the Python wrapper, do you have a feeling of what fraction of OpenMM users use only C++?
I was actually more concerned about users that only use OpenMM C++ and don't even install the Python wrapper, do you have a feeling of what fraction of OpenMM users use only C++?
- Peter Eastman
- Posts: 2588
- Joined: Thu Aug 09, 2007 1:25 pm
Re: Support both OpenMM 6.2 and 6.3
I think "what you're building for" and "what you have installed" are two different questions. For example, you may have OpenMM 6.3 installed on your computer, but still want to build separate binaries that are compatible with both 6.2 and 6.3.
Peter
Peter