Static build of OpenMM?

The functionality of OpenMM will (eventually) include everything that one would need to run modern molecular simulation.
POST REPLY
User avatar
Samuel Flores
Posts: 188
Joined: Mon Apr 30, 2007 1:06 pm

Static build of OpenMM?

Post by Samuel Flores » Wed Feb 12, 2014 12:11 am

Is it possible to do a static build of OpenMM? I have a cluster with outdated libstdc++ that I need to run on. Apparently the only way to do it is to statically link libstdc++ on my build machine. To do that, I need to compile everything statically, which means static OpenMM libs. I don't see a cmake variable to make this work.

User avatar
Yutong Zhao
Posts: 6
Joined: Wed Apr 18, 2012 11:40 am

Re: Static build of OpenMM?

Post by Yutong Zhao » Wed Feb 12, 2014 11:41 am

Well, you're in luck. OpenMM 6.0 RC has a static builds of OpenMM, OpenMMCUDA, OpenMMOpenCL, OpenMMCPU platforms, in addition to the PME Plugin. We hoped this would cover most use cases. Set the cmake OPENMM_BUILD_STATIC_LIB option to true, which will the generate *_static libraries.

Note that to use these static libraries, your runtimes must declare the corresponding extern'd functions that are visible only in the static library.

They are:

For the platforms:

extern "C" void registerCpuPlatform();
extern "C" void registerCudaPlatform();
extern "C" void registerOpenCLPlatform();

For the PME plugin:

extern "C" void registerCpuPmeKernelFactories();

And they MUST be called at runtime of your executable.

POST REPLY