From dad57e7c32dd65fb1f434c76f45a71c668a12be6 Mon Sep 17 00:00:00 2001 From: Szilard Pall Date: Fri, 29 Oct 2010 17:24:06 +0200 Subject: [PATCH] fixed the default for OpenMM plugin dir location (bug #606) The OpenMM plugin lookup mechanism works again, so when running mdrun-gpu on the same machine/OS where the binaries were built, the plugins are picked up from the OpenMM installation used for building (but the env.var. OPENMM_PLUGIN_DIR still has priority over all defaults!). --- src/kernel/CMakeLists.txt | 12 ++++-------- src/kernel/openmm_wrapper.cpp | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt index a093c9e783..1e6cf9656b 100644 --- a/src/kernel/CMakeLists.txt +++ b/src/kernel/CMakeLists.txt @@ -46,14 +46,10 @@ if(GMX_OPENMM) add_subdirectory(gmx_gpu_utils) include_directories(./gmx_gpu_utils ${OpenMM_INCLUDE_DIR}) link_directories(${OpenMM_LIBRARY_DIR}) - # only define if this is a local build not a release - # we assume that the auto-generated version is not used && - # version string does not contain "-dev" => it's a release build - if(NOT USE_VERSION_H AND NOT PROJECT_VERSION MATCHES ".*-dev.*") - add_definitions( -DOPENMM_PLUGIN_DIR="${OpenMM_PLUGIN_DIR}" ) - else() - add_definitions( -DOPENMM_PLUGIN_DIR="" ) - endif() + # with this define no evn.var. is needed with OPENMM_PLUGIN_DIR + # if the same OpenMM installation is used for running and building + add_definitions( -DOPENMM_PLUGIN_DIR="${OpenMM_PLUGIN_DIR}" ) + file(TO_CMAKE_PATH ${OpenMM_PLUGIN_DIR} _path) add_library(openmm_api_wrapper STATIC openmm_wrapper.cpp) target_link_libraries(openmm_api_wrapper gmx_gpu_utils ${OpenMM_LIBRARIES}) set(GMX_OPENMM_LIBRARIES openmm_api_wrapper gmx_gpu_utils ${OpenMM_LIBRARIES}) diff --git a/src/kernel/openmm_wrapper.cpp b/src/kernel/openmm_wrapper.cpp index acc829cb22..239f4c7eb7 100644 --- a/src/kernel/openmm_wrapper.cpp +++ b/src/kernel/openmm_wrapper.cpp @@ -796,7 +796,7 @@ void* openmm_init(FILE *fplog, const char *platformOptStr, } /* macro set at build time */ -#ifdef OpenMM_PLUGIN_DIR +#ifdef OPENMM_PLUGIN_DIR if (!hasLoadedPlugins) { loadedPlugins = Platform::loadPluginsFromDirectory(OPENMM_PLUGIN_DIR); -- 2.22.0