Static build of OpenMM?
- Samuel Flores
- Posts: 189
- Joined: Mon Apr 30, 2007 1:06 pm
Static build of OpenMM?
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.
- Yutong Zhao
- Posts: 6
- Joined: Wed Apr 18, 2012 11:40 am
Re: Static build of OpenMM?
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.
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.