Index: CMakeLists.txt =================================================================== --- CMakeLists.txt (revision 597) +++ CMakeLists.txt (working copy) @@ -416,6 +416,11 @@ if(OPENMM_FOUND) target_link_libraries(charmm mcbarostat2 OpenMMGBSW ${OpenMM_LIBRARY}) + if(OPENMM_API_UPDATE) + set_property(TARGET charmm + APPEND_STRING + PROPERTY COMPILE_FLAGS "-DOPENMM_API_UPDATE ") + endif() endif() if(domdec_gpu) Index: doc/openmm.doc =================================================================== --- doc/openmm.doc (revision 597) +++ doc/openmm.doc (working copy) @@ -107,7 +107,7 @@ Max OSX (csh): setenv DYLD_LIBRARY_PATH /usr/local/openmm/lib:$OPENMM_PLUGIN_DIR:$DYLD_LIBRARY_PATH -OpenMM anisotropic barostat, GBSW and PHMD functionality are also available as OpenMM plugins. When CHARMM is built using install.com, the plugins are installed in the directory /lib//openmm_plugins (for example /lib/osx/openmm_plugins). When CHARMM is built using CMake, the plugins are install in the directory /lib. There is no longer any need to set CHARMM_PLUGIN_DIR at build or run time. +OpenMM anisotropic barostat, GBSW and PHMD functionality are also available as OpenMM plugins. When CHARMM is built using install.com, the plugins are installed in the directory /lib//openmm_plugins (for example /lib/osx/openmm_plugins). When CHARMM is built using CMake, the plugins are install in the directory /lib. There is no longer any need to set CHARMM_PLUGIN_DIR at build or run time unless you have copied the CHARMM's plugins to a new directory. In this case, you may need to add the new directory to (DY)LD_LIBRARY_PATH and set the environment variable CHARMM_PLUGIN_DIR to the new location. INSTALLING CHARMM/OpenMM ======================== Index: install.com =================================================================== --- install.com (revision 597) +++ install.com (working copy) @@ -1359,17 +1359,16 @@ # endif # must leave in vvv to compile against openmm >= 7.1 Feb 2017 + setenv omm_defines "" grep -q -w getDefaultTemperature "$OPENMM_DIR/include/openmm/MonteCarloBarostat.h" if ( $status == 0 ) then - setenv OPENMM_API_UPDATE 1 - else - setenv OPENMM_API_UPDATE 0 + setenv omm_defines "-DOPENMM_API_UPDATE" endif set plugin_dir="$chmsrc/openmm/plugins" sed -e "s@ADDLIB =@ADDLIB = -L$omm_lib -L$chmlib/openmm_plugins $linker_rpath @" \ -e "s@QLIB =@QLIB = $omm_libs -ldl @" \ - -e "s@INCLUDE =@INCLUDE = -I"$chmbuild" -I$OPENMM_DIR/include -I$plugin_dir/MonteCarloBarostat2/wrappers @" \ + -e "s@INCLUDE =@INCLUDE = $omm_defines -I"$chmbuild" -I$OPENMM_DIR/include -I$plugin_dir/MonteCarloBarostat2/wrappers @" \ < $chmbuild/Makefile_$chmhost > $chmbuild/Makefile_$$ /bin/mv $chmbuild/Makefile_$$ $chmbuild/Makefile_$chmhost @@ -1777,9 +1776,6 @@ if ( $ommplugin == 1 ) then echo "OMMPLUGIN" >> $chmbuild/pref$$.dat endif - if ( $OPENMM_API_UPDATE == 1 ) then - echo "OPENMM_API_UPDATE" >> $chmbuild/pref$$.dat - endif endif #---end of new feature keys if ( $qgamess == 1 ) then Index: source/openmm/omm_main.src =================================================================== --- source/openmm/omm_main.src (revision 597) +++ source/openmm/omm_main.src (working copy) @@ -486,7 +486,7 @@ temperature = OpenMM_MonteCarloBarostat2_getTemperature(barostat2) else barostat = transfer(force,OpenMM_MonteCarloBarostat(0)) -#if KEY_OPENMM_API_UPDATE == 1 +#ifdef OPENMM_API_UPDATE call OpenMM_MonteCarloBarostat_setDefaultTemperature(barostat, opts%temperatureReference) temperature = OpenMM_MonteCarloBarostat_getDefaultTemperature(barostat) #else @@ -498,11 +498,12 @@ end subroutine new_Temperature subroutine get_plugins(plugin_dir) + use stream, only: prnlev, outu character(len=*), intent(in) :: plugin_dir type(OpenMM_StringArray) :: plugin_list character(len=200) :: plugin_name integer*4 :: ii, n - + if (PRNLEV >= 6) write (OUTU, "(1x, 2a)") & 'In OpenMM plugin directory ', trim(plugin_dir) call OpenMM_Platform_loadPluginsFromDirectory(plugin_dir, plugin_list) @@ -524,7 +525,8 @@ !> Loads any shared libraries containing GPU implementations. subroutine load_libs() use new_timer - character(len=100) :: dir_name, charmm_plugin_dir_name + use stream, only: prnlev, outu + character(len=1024) :: dir_name, plugin_dir character(len=10) :: omm_version integer :: ii logical, save :: loaded = .false. @@ -540,10 +542,17 @@ read(omm_version(ii:ii),*) openmm_version_number if (PRNLEV >= 2) write (OUTU, "(1x, 2a)") & 'OpenMM version ', trim(omm_version) - + ! directories set in plugin_locs.f90 at compile time call get_plugins(OPENMM_PLUGIN_DIR) call get_plugins(CHARMM_PLUGIN_DIR) + + ! get plugins from OpenMMs default locations + ! and environment variable CHARMM_PLUGIN_DIR + call OpenMM_Platform_getDefaultPluginsDirectory(plugin_dir) + call get_plugins(plugin_dir) + call getenv('CHARMM_PLUGIN_DIR', plugin_dir) + call get_plugins(plugin_dir) call load_device_info() call timer_stop(T_omm_load) @@ -553,6 +562,7 @@ end subroutine load_libs subroutine load_device_info() + use stream, only: prnlev, outu character(len=80) :: cuda_compiler character(len=20) :: device_prop, omm_precision character(len=10) :: platform_name, device_id, opencl_impl Index: source/openmm/plugins/MonteCarloBarostat2/Makefile =================================================================== --- source/openmm/plugins/MonteCarloBarostat2/Makefile (revision 597) +++ source/openmm/plugins/MonteCarloBarostat2/Makefile (working copy) @@ -68,7 +68,7 @@ $(CXX) $(link_opts) -o $@ $^ -L $(CHARMM_OPENMM_LIB) -L $(OPENMM_DIR)/lib -lOpenMM$(OMMD) $(XML_LIB): $(REF_LIB) $(XML_OBJS) - $(CXX) $(link_opts) -L"$(OPENMM_DIR)/lib" -lOpenMM$(OMMD) -L"$(CHARMM_OPENMM_LIB)" -lOpenMMCharmm -o $@ $^ + $(CXX) $(link_opts) -L"$(OPENMM_DIR)/lib" -lOpenMM$(OMMD) -L"$(CHARMM_OPENMM_LIB)" -lOpenMMCharmm -o $@ $(XML_OBJS) $(chmbuild)/MonteCarloBarostat2Proxy.o: serialization/MonteCarloBarostat2Proxy.cpp $(CXX) $(CXXFLAGS) $(REF_INCLUDES) -c -o $@ $< @@ -83,10 +83,18 @@ $(CXX) $(link_opts) -o $@ $^ -framework OpenCL -L $(OPENMM_DIR)/lib -L $(OPENMM_DIR)/lib/plugins -lOpenMM$(OMMD) -lOpenMMOpenCL$(OMMD) -L $(CHARMM_OPENMM_LIB) -lOpenMMCharmm else $(CUDA_LIB): $(REF_LIB) $(CUDA_OBJS) - $(CXX) $(link_opts) -o $@ $^ -L $(OPENMM_DIR)/lib -L $(OPENMM_DIR)/lib/plugins -lOpenMM$(OMMD) -lOpenMMCUDA$(OMMD) -L $(CHARMM_OPENMM_LIB) -lOpenMMCharmm -L$(CUDATK)/lib $(cuda_lib) + $(CXX) $(link_opts) -o $@ $(CUDA_OBJS) \ + -L"$(OPENMM_DIR)/lib" -lOpenMM$(OMMD) \ + -Wl,-rpath,"$(OPENMM_DIR)/lib" \ + -L"$(OPENMM_DIR)/lib/plugins" -lOpenMMCUDA$(OMMD) \ + -Wl,-rpath,"$(OPENMM_DIR)/lib/plugins" \ + -L"$(CHARMM_OPENMM_LIB)" -lOpenMMCharmm \ + -Wl,-rpath,"$(CHARMM_OPENMM_LIB)" \ + -L"$(CUDATK)/lib" $(cuda_lib) \ + -Wl,-rpath,"$(CUDATK)/lib" $(OPENCL_LIB): $(REF_LIB) $(OPENCL_OBJS) - $(CXX) $(link_opts) -o $@ $^ -L $(OPENMM_DIR)/lib -L $(OPENMM_DIR)/lib/plugins -lOpenMM$(OMMD) -lOpenMMOpenCL$(OMMD) -L $(CHARMM_OPENMM_LIB) -lOpenMMCharmm + $(CXX) $(link_opts) -o $@ $(OPENCL_OBJS) -L $(OPENMM_DIR)/lib -L $(OPENMM_DIR)/lib/plugins -lOpenMM$(OMMD) -lOpenMMOpenCL$(OMMD) -L $(CHARMM_OPENMM_LIB) -lOpenMMCharmm endif $(chmbuild)/MonteCarloBarostat2.o: openmmapi/src/MonteCarloBarostat2.cpp Index: tool/cmake/prefx_keywords.cmake =================================================================== --- tool/cmake/prefx_keywords.cmake (revision 597) +++ tool/cmake/prefx_keywords.cmake (working copy) @@ -161,9 +161,6 @@ if(OPENMM_FOUND) list(APPEND keywords OPENMM) - if(OPENMM_API_UPDATE) - list(APPEND keywords OPENMM_API_UPDATE) - endif() endif() if(EXAFMM_FOUND)