Merge branch 'rotation-4-5' into rotation
authorCarsten Kutzner <ckutzne@gwdg.de>
Thu, 4 Nov 2010 10:51:56 +0000 (11:51 +0100)
committerCarsten Kutzner <ckutzne@gwdg.de>
Thu, 4 Nov 2010 10:51:56 +0000 (11:51 +0100)
Conflicts:
src/tools/Makefile.am

1  2 
include/string2.h
include/vec.h
src/kernel/CMakeLists.txt
src/tools/CMakeLists.txt

diff --combined include/string2.h
index 95cd558880b6eb05d9d298c92c125e9b80a714da,184c82205969c988ea47a61086e581c8cfa8ca00..0f26e3ffbc4973a362fe3db94d424b1e2855a75a
@@@ -118,11 -118,15 +118,15 @@@ char *wrap_lines(const char *buf,int li
   */
  
  
 -char **split(char sep,char *str);
 +char **split(char sep,const char *str);
  /* Implementation of the well-known Perl function split */
  
  gmx_large_int_t str_to_large_int_t(const char *str, char **endptr);
  
+ #if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && !defined __CYGWIN__ && !defined __CYGWIN32__)
+ #define snprintf _snprintf
+ #endif
  #ifdef __cplusplus
  }
  #endif
diff --combined include/vec.h
index a2b0c099d4a5600b8799da325b467556048d8016,139a9c4514f339210ce8be0b2edd756f960f0284..10d221c259afa7a8c11de1020cbe6a07a01c7ce3
@@@ -785,7 -785,7 +785,7 @@@ static gmx_inline void mvmul(matrix a,c
  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];
  }
  
@@@ -828,7 -828,7 +828,7 @@@ static gmx_inline real trace(matrix m
    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);
@@@ -866,7 -866,7 +866,7 @@@ static void matrix_convert(matrix box, 
                         -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
index c26c887ee57fbfb4416f117ec6cc35f0d0ab883b,f35457ce843a0ba98a2a15426ae7b1291b85ad20..3236d83b66f5e80817946ddbbb78d2b4263a2234
@@@ -36,27 -36,21 +36,22 @@@ set(GMXPREPROCESS_SOURCE
  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})   
@@@ -112,6 -106,8 +107,8 @@@ if(GMX_OPENMM AND MSVC
  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)
diff --combined src/tools/CMakeLists.txt
index 18f8b7f6223a1bc5483e1d0f4afa843d8341f6d2,0308d69d5ce0f7743e8d4dd42eb3912f02af1fc8..9274b1469070bcd22561311206f1d08281d44902
@@@ -29,7 -29,7 +29,7 @@@ add_library(gmxan
              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)
@@@ -47,11 -47,11 +47,11 @@@ set(GMX_TOOLS_PROGRAM
      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)
  
  
  
@@@ -62,9 -62,13 +62,13 @@@ foreach(TOOL ${GMX_TOOLS_PROGRAMS}
  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)