static gmx_inline void mvmul_ur0(matrix a,const rvec src,rvec dest)
{
dest[ZZ]=a[ZZ][XX]*src[XX]+a[ZZ][YY]*src[YY]+a[ZZ][ZZ]*src[ZZ];
- dest[YY]=a[YY][XX]*src[XX]+a[YY][YY];
+ dest[YY]=a[YY][XX]*src[XX]+a[YY][YY]*src[YY];
dest[XX]=a[XX][XX]*src[XX];
}
return (m[XX][XX]+m[YY][YY]+m[ZZ][ZZ]);
}
-static gmx_inline real _divide(real a,real b,const char *file,int line)
+static gmx_inline real _divide_err(real a,real b,const char *file,int line)
{
if (fabs(b) <= GMX_REAL_MIN)
gmx_fatal(FARGS,"Dividing by zero, file %s, line %d",file,line);
-box[ZZ][XX]*box[ZZ][XX]-box[ZZ][YY]*box[ZZ][YY]);
}
-#define divide(a,b) _divide((a),(b),__FILE__,__LINE__)
+#define divide_err(a,b) _divide_err((a),(b),__FILE__,__LINE__)
#define mod(a,b) _mod((a),(b),__FILE__,__LINE__)
#ifdef __cplusplus
set(MDRUN_SOURCES
gctio.c ionize.c runner.c
do_gct.c repl_ex.c xutils.c
- md.c mdrun.c genalg.c md_openmm.c)
+ md.c mdrun.c genalg.c membed.c
+ md_openmm.c)
add_library(gmxpreprocess ${GMXPREPROCESS_SOURCES})
target_link_libraries(gmxpreprocess md)
set_target_properties(gmxpreprocess PROPERTIES OUTPUT_NAME "gmxpreprocess${GMX_LIBS_SUFFIX}" SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${LIB_INSTALL_DIR}")
- set_target_properties(md PROPERTIES OUTPUT_NAME "md${GMX_LIBS_SUFFIX}" SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${LIB_INSTALL_DIR}")
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})
endif()
+ install(TARGETS gmxpreprocess DESTINATION ${LIB_INSTALL_DIR} COMPONENT libraries)
+ install(TARGETS mdrun DESTINATION ${BIN_INSTALL_DIR} COMPONENT mdrun)
install(TARGETS
grompp
tpbconv
gmxdump
g_x2top
gmxcheck
- mdrun
- gmxpreprocess DESTINATION ${LIB_INSTALL_DIR}
+ COMPONENT runtime
RUNTIME DESTINATION ${BIN_INSTALL_DIR})
-
- # if we build shared gromacs libs, when installing throught the install-mdrun target
- # these libs need to be installed as well
- if(BUILD_SHARED_LIBS)
- # in MDRUN_LIBS we store the libraries MDRUN links against (NOTE: hardcoded!!!)
- set(MDRUN_LIBS gmxpreprocess md gmx)
-
- # generate install-libXXX custom target for each shared lib that mdrun links against
- foreach(_lib ${MDRUN_LIBS})
- # double-check that the type is SHARED
- get_target_property(_type ${_lib} TYPE)
- if(NOT ${_type} STREQUAL "SHARED_LIBRARY")
- message(FATAL_ERROR " Internal error: library ${_lib} is not shared so it's not supposed to be processed for installing")
- endif()
-
- # figure out the path and filename under which the lib will be installed
- # (libname with pre- and suffix)
- get_target_property(_lib_path ${_lib} LOCATION)
- string(REGEX REPLACE "/" ";" _lib_fname ${_lib_path})
- list(REVERSE _lib_fname)
- list(GET _lib_fname 0 _lib_fname)
-
- # create custom target for copying each library to the install location
- # TODO: need to fix this to have the .so.6 form
- add_custom_target(install-${_lib}
- COMMAND ${CMAKE_COMMAND} -E copy
- "${_lib_path}" "${LIB_INSTALL_DIR}/${_lib_fname}.${SOVERSION}"
- COMMAND ${CMAKE_COMMAND} -E create_symlink
- "${_lib_fname}.${SOVERSION}" "${LIB_INSTALL_DIR}/${_lib_fname}"
- COMMENT "Installing library ${_lib}")
- add_dependencies(install-${_lib} ${_lib})
-
- # gather the custom target names in a string
- # set(_lib_install_targets "${_lib_install_targets} install-lib${_lib}")
- list(APPEND _lib_install_targets "install-${_lib}")
- endforeach(_lib)
- endif(BUILD_SHARED_LIBS)
-
- get_target_property(_mdrun_path mdrun LOCATION)
- add_custom_target(install-mdrun
- COMMAND ${CMAKE_COMMAND} -E copy "${_mdrun_path}"
- "${BIN_INSTALL_DIR}/${_mdrun_exec_name}"
- COMMENT "Installing mdrun")
- add_dependencies(install-mdrun mdrun ${_lib_install_targets})
+ # Create the custom install-mdrun target
+ if (BUILD_SHARED_LIBS)
+ # If shared libraries are used, we need to install the libraries in
+ # addition to the mdrun binary.
+ add_custom_target(install-mdrun
+ COMMAND ${CMAKE_COMMAND} -DCOMPONENT=libraries
+ -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ COMMAND ${CMAKE_COMMAND} -DCOMPONENT=mdrun
+ -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ COMMENT "Installing mdrun")
+ else (BUILD_SHARED_LIBS)
+ add_custom_target(install-mdrun
+ COMMAND ${CMAKE_COMMAND} -DCOMPONENT=mdrun
+ -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ COMMENT "Installing mdrun")
+ endif (BUILD_SHARED_LIBS)
+ add_dependencies(install-mdrun mdrun)
endif(GMX_FAHCORE)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libgmxpreprocess.pc.cmakein ${CMAKE_CURRENT_BINARY_DIR}/libgmxpreprocess.pc @ONLY)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgmxpreprocess.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
- RENAME "libgmxpreprocess${GMX_LIBS_SUFFIX}.pc")
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgmxpreprocess.pc
+ DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
+ RENAME "libgmxpreprocess${GMX_LIBS_SUFFIX}.pc"
+ COMPONENT development)
gmx_editconf.c gmx_genbox.c gmx_genion.c gmx_genconf.c
gmx_genpr.c gmx_eneconv.c gmx_vanhove.c gmx_wheel.c
addconf.c calcpot.c edittop.c gmx_bar.c
- gmx_membed.c gmx_pme_error.c )
+ gmx_pme_error.c )
target_link_libraries(gmxana md gmx)
g_helixorient g_principal g_dipoles g_disre g_dist
g_dyndom g_enemat g_energy g_lie g_filter g_gyrate
g_h2order g_hbond g_helix g_mindist g_msd g_morph g_nmeig
- g_nmens g_order g_polystat g_potential g_rama g_rdf g_rms
+ g_nmens g_order g_kinetics g_polystat g_potential g_rama g_rdf g_rms
g_rmsf g_rotacf g_saltbr g_sas g_select g_sgangle g_sham g_sorient
g_spol g_spatial g_tcaf g_traj g_tune_pme g_vanhove
g_velacc g_clustsize g_mdmat g_wham g_sigeps g_bar
- g_membed g_pme_error g_rmsdist g_rotmat)
+ g_pme_error g_rmsdist g_rotmat)
endforeach(TOOL ${GMX_TOOLS_PROGRAMS})
+ install(TARGETS gmxana DESTINATION ${LIB_INSTALL_DIR} COMPONENT runtime)
install(TARGETS ${GMX_TOOLS_PROGRAMS}
- gmxana DESTINATION ${LIB_INSTALL_DIR}
- RUNTIME DESTINATION ${BIN_INSTALL_DIR})
+ DESTINATION ${BIN_INSTALL_DIR}
+ COMPONENT runtime)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libgmxana.pc.cmakein ${CMAKE_CURRENT_BINARY_DIR}/libgmxana.pc @ONLY)
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgmxana.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig RENAME "libgmxana${GMX_LIBS_SUFFIX}.pc")
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libgmxana.pc
+ DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
+ RENAME "libgmxana${GMX_LIBS_SUFFIX}.pc"
+ COMPONENT development)