Page 1 of 1

Static build of OpenMM?

Posted: Wed Feb 12, 2014 12:11 am
by sam
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.

Re: Static build of OpenMM?

Posted: Wed Feb 12, 2014 11:41 am
by proteneer
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.