fixed the default for OpenMM plugin dir location (bug #606)
authorSzilard Pall <pszilard@cbr.su.se>
Fri, 29 Oct 2010 15:24:06 +0000 (17:24 +0200)
committerSzilard Pall <pszilard@cbr.su.se>
Fri, 29 Oct 2010 16:07:52 +0000 (18:07 +0200)
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
src/kernel/openmm_wrapper.cpp

index a093c9e783ca4740fddf1b9faf73cec14dee6a7d..1e6cf9656bd92aeb85994c8feb53e0c1981721ec 100644 (file)
@@ -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})   
index acc829cb22936f6489a4b202d76c7187b00f6b5a..239f4c7eb78b03845dbc6b56186e46cec7f5d736 100644 (file)
@@ -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);