Merge release-4-5-patches into release-4-6
authorRoland Schulz <roland@utk.edu>
Sun, 11 Dec 2011 20:05:19 +0000 (15:05 -0500)
committerRoland Schulz <roland@utk.edu>
Sun, 11 Dec 2011 20:05:57 +0000 (15:05 -0500)
Conflicts:
admin/GerritBuild.bat

Change-Id: Ib62e8f5949cc8e65342cd1826888901d11032474

1  2 
CMakeLists.txt
admin/GerritBuild.bat
src/mdlib/fft5d.c

diff --combined CMakeLists.txt
index 0b84abe054b713f6c941c6abf23cb142604f7fc0,25f22b777f8d1c93ec9ee9c51207e7dc75864550..b3f02403aff1fced8d0d107f99c8ee7bda2295d2
@@@ -1,4 -1,4 +1,4 @@@
 -cmake_minimum_required(VERSION 2.6)
 +cmake_minimum_required(VERSION 2.8)
  
  project(Gromacs)
  include(Dart)
@@@ -12,7 -12,7 +12,7 @@@ mark_as_advanced(DART_ROOT
  # machine with no git. 
  #
  # NOTE: when releasing the "-dev" suffix needs to be stripped off!
 -set(PROJECT_VERSION "4.5.5-dev")
 +set(PROJECT_VERSION "4.6-dev")
  set(CUSTOM_VERSION_STRING ""
      CACHE STRING "Custom version string (if empty, use hard-coded default)")
  mark_as_advanced(CUSTOM_VERSION_STRING)
@@@ -22,8 -22,8 +22,8 @@@ endif (CUSTOM_VERSION_STRING
  set(SOVERSION 6)
  # It is a bit irritating, but this has to be set separately for now!
  SET(CPACK_PACKAGE_VERSION_MAJOR "4")
 -SET(CPACK_PACKAGE_VERSION_MINOR "5")
 -SET(CPACK_PACKAGE_VERSION_PATCH "5")
 +SET(CPACK_PACKAGE_VERSION_MINOR "6")
 +#SET(CPACK_PACKAGE_VERSION_PATCH "0")
  
  
  # Cmake modules/macros are in a subdirectory to keep this file cleaner
@@@ -194,23 -194,16 +194,25 @@@ if(GMX_MPI
          set(GMX_THREADS OFF CACHE BOOL 
              "Thread-based parallelization conflicts with MPI." FORCE)
      endif(GMX_THREADS)
 -    find_package(MPI)
 +
 +    # Work-around for Cray MPI
 +    TRY_COMPILE(MPI_FOUND ${CMAKE_BINARY_DIR}
 +      "${CMAKE_SOURCE_DIR}/cmake/TestMPI.c"
 +      COMPILE_DEFINITIONS )
 +    if(NOT MPI_FOUND)
 +      # search for normal MPI installations
 +      find_package(MPI)
 +    endif(NOT MPI_FOUND)
 +
      if(MPI_FOUND)
          set(GROMACS_C_FLAGS ${GROMACS_FLAGS} ${MPI_COMPILE_FLAGS})
        set(GROMACS_LINKER_FLAGS ${GROMACS_LINKER_FLAGS} ${MPI_LINK_FLAGS})
          
          include_directories(${MPI_INCLUDE_PATH})
          list(APPEND GMX_EXTRA_LIBRARIES ${MPI_LIBRARIES})
-         add_definitions( -DMPI ) #for FAHCORE
+         if(GMX_FAHCORE)
+             add_definitions( -DMPI ) #for FAHCORE
+         endif(GMX_FAHCORE)
          include(gmxTestMPI_IN_PLACE)
          if (GMX_MPI_IN_PLACE)
              gmx_test_mpi_in_place(MPI_IN_PLACE_EXISTS)
@@@ -481,22 -474,12 +483,22 @@@ endif(CYGWIN
  if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
      if(USE_VERSION_H)
          # We need at least git v1.5.1 be able to parse git's date output. If not 
 -        # fund or the version is too small, we can't generate version information.
 -        find_package(Git 1.5.1)
 -        # this should at some point become VERSION_LESS
 -        if(NOT Git_FOUND OR Git_VERSION STRLESS "1.5.1")
 -            message("No compatible git version found, won't be able to generate proper development version information.")
 -            set(USE_VERSION_H OFF)
 +        # found or the version is too small, we can't generate version information.
 +        find_package(Git)
 +
 +      # Find out the git version
 +      if(GIT_FOUND AND NOT GIT_VERSION)
 +        execute_process(COMMAND ${GIT_EXECUTABLE} "--version"
 +            OUTPUT_VARIABLE _exec_out
 +            OUTPUT_STRIP_TRAILING_WHITESPACE)
 +        string(REGEX REPLACE "git version (.*)" "\\1" GIT_VERSION ${_exec_out})
 +        set(GIT_VERSION ${GIT_VERSION} CACHE STRING "Git version")
 +        mark_as_advanced(GIT_VERSION)
 +      endif()
 +
 +        if(NOT GIT_FOUND OR GIT_VERSION VERSION_LESS "1.5.1")
 +          message("No compatible git version found, won't be able to generate proper development version information.")
 +          set(USE_VERSION_H OFF)
          endif()
      endif()
  else()
@@@ -537,6 -520,7 +539,6 @@@ gmx_test_large_files(GMX_LARGEFILES
  check_function_exists(fseeko     HAVE_FSEEKO)
  
  include(gmxTestSignal)
 -gmx_test_retsigtype(RETSIGTYPE)
  gmx_test_sigusr1(HAVE_SIGUSR1)
  
  include(gmxTestInline)
diff --combined admin/GerritBuild.bat
index 6cd95bb362b14a1c409b534a962ac8926bfe8b0e,ca1186e0ebb332e31f088371587d5acbd8baa078..f603724726900c7a756afc12a570bec5c1791ded
@@@ -3,6 -3,5 +3,4 @@@ REM Run Windows SDK SetEnv scrip
  SetEnv && ^
  cmake -G "Visual Studio 10 Win64" -D GMX_DOUBLE=%GMX_DOUBLE% -D GMX_MPI=%GMX_MPI% -D GMX_OPENMP=%GMX_OPENMP% -DGMX_DEFAULT_SUFFIX=off -DCMAKE_BUILD_TYPE=Debug . && ^
  msbuild All_Build.vcxproj && ^
- REM currently the test one example test doesn't work on Windows
- REM ctest -D ExperimentalTest -V
+ ctest -D ExperimentalTest -C Debug -V
 -
diff --combined src/mdlib/fft5d.c
index e2f5266ec423b9eeb791f11034034274a3031be8,afc8d093f311f759771e1751f4f1b68ce3d034d3..bc431757dcfd10eb873b87e0a943d4dac0cf68a0
@@@ -101,7 -101,6 +101,7 @@@ static int lfactor(int z) 
        int i;
        for (i=sqrt(z);;i--)
                if (z%i==0) return i;
 +      return 1;
  }
  
  /* largest factor */
@@@ -110,7 -109,6 +110,7 @@@ static int l2factor(int z) 
        if (z==1) return 1;
        for (i=z/2;;i--)
                if (z%i==0) return i;
 +      return 1;
  }
  
  /* largest prime factor: WARNING: slow recursion, only use for small numbers */
@@@ -432,7 -430,7 +432,7 @@@ fft5d_plan fft5d_plan_3d(int NG, int MG
  #ifdef GMX_FFT_FFTW3  /*if not FFTW - then we don't do a 3d plan but insead only 1D plans */
      if ((!(flags&FFT5D_INPLACE)) && (!(P[0]>1 || P[1]>1))) {  /*don't do 3d plan in parallel or if in_place requested */  
              int fftwflags=FFTW_DESTROY_INPUT;
-             fftw_iodim dims[3];
+             FFTW(iodim) dims[3];
              int inNG=NG,outMG=MG,outKG=KG;
  
              FFTW_LOCK;
@@@ -797,7 -795,7 +797,7 @@@ static void compute_offsets(fft5d_plan 
              rotate(NG);            
          }
      }
 -    if (plan->flags&FFT5D_REALCOMPLEX && ((!(plan->flags&FFT5D_BACKWARD) && s==0) || (plan->flags&FFT5D_BACKWARD && s==2))) {
 +    if ((plan->flags&FFT5D_REALCOMPLEX) && ((!(plan->flags&FFT5D_BACKWARD) && s==0) || ((plan->flags&FFT5D_BACKWARD) && s==2))) {
          xl[0] = rC[s];
      }
  }
@@@ -1035,7 -1033,7 +1035,7 @@@ void fft5d_compare_data(const t_complex
      int x,y,z,l;
      int *coor = plan->coor;
      int ll=2; /*compare ll values per element (has to be 2 for complex)*/
 -    if (plan->flags&FFT5D_REALCOMPLEX && plan->flags&FFT5D_BACKWARD) 
 +    if ((plan->flags&FFT5D_REALCOMPLEX) && (plan->flags&FFT5D_BACKWARD))
      {
          ll=1;
      }