Update versioning for new scheme
authorTeemu Murtola <teemu.murtola@gmail.com>
Thu, 17 Dec 2015 10:44:07 +0000 (12:44 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sat, 19 Dec 2015 01:23:13 +0000 (02:23 +0100)
Make versioning use the new YYYY[.P] scheme that was decided quite a
while back.

Also, remove the literal "VERSION" prefix from the return value of
gmx_version() to give caller better control for deciding on the usage of
the version string.

Change-Id: I1ed171502a4a900c87988faabf48fafeef735c4f

cmake/VersionInfo.cmake.cmakein
cmake/gmxCPackUtilities.cmake
cmake/gmxVersionInfo.cmake
src/gromacs/fileio/checkpoint.cpp
src/gromacs/fileio/tngio.cpp
src/gromacs/fileio/tpxio.cpp
src/gromacs/utility/baseversion-gen.c.cmakein
src/gromacs/utility/baseversion.h
src/gromacs/utility/binaryinformation.cpp
src/gromacs/utility/errorformat.cpp

index b3f81b4ae197efd17900bf066a4a6353e9781dca..4eefad669e1a375b9b5f20346b6ecbaad11c5700 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2014, by the GROMACS development team, led by
+# Copyright (c) 2014,2015, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -34,7 +34,6 @@
 
 set(GMX_VERSION                   "@GMX_VERSION@")
 set(GMX_VERSION_MAJOR             "@GMX_VERSION_MAJOR@")
-set(GMX_VERSION_MINOR             "@GMX_VERSION_MINOR@")
 set(GMX_VERSION_PATCH             "@GMX_VERSION_PATCH@")
 set(GMX_VERSION_STRING            "@GMX_VERSION_STRING@")
 
index 805aeb6f7ef335e017fa283b6145cd2890d611d0..c780bc7a3f5c48a25a216d6e44062932c63cbfc1 100644 (file)
@@ -102,7 +102,6 @@ function (gmx_cpack_write_config)
         "GROMACS - a toolkit for high-performance molecular simulation")
     # Set version info.
     set(CPACK_PACKAGE_VERSION_MAJOR ${GMX_VERSION_MAJOR})
-    set(CPACK_PACKAGE_VERSION_MINOR ${GMX_VERSION_MINOR})
     set(CPACK_PACKAGE_VERSION_PATCH ${GMX_VERSION_PATCH})
     set(CPACK_PACKAGE_VERSION       ${GMX_VERSION_STRING})
     # Add various text resources for some installers.
index 282dcefa601d6a8dd15db90915c30d74e82d474e..56ca2feeb9064e80a031d4f6480f7e0896daa9e4 100644 (file)
@@ -38,9 +38,8 @@
 # This script provides the following basic version variables that need to be
 # maintained manually:
 #   GMX_VERSION_MAJOR      Major version number.
-#   GMX_VERSION_MINOR      Minor version number.
 #   GMX_VERSION_PATCH      Patch version number.
-#       Should always be defined: zero for, e.g., 5.0.
+#       Should always be defined: zero for, e.g., 2016.
 #   GMX_VERSION_SUFFIX     String suffix to add to numeric version string.
 #       "-dev" is automatically added when not building from a source package,
 #       and does not need to be kept here. This mechanism is not quite enough
 # They are collected into a single section below.
 # The following variables are set based on these:
 #   GMX_VERSION            String composed from GMX_VERSION_* numeric variables
-#       above. Example: 4.6.1, 5.0
+#       above. Example: 4.6.1, 5.0, 2016
 #   GMX_VERSION_STRING     String with GMX_VERSION suffixed with the given
 #       suffix and possibly "-dev" for builds not from a source package.
-#   GMX_VERSION_NUMERIC    Numeric version number (e.g., 40601 for 4.6.1).
+#   GMX_VERSION_NUMERIC    Numeric version number (e.g., 40601 for 4.6.1, 20160001 for 2016.1).
 #   GMX_API_VERSION        Numeric API version.
 #       This is currently set automatically to GMX_VERSION_NUMERIC, but may
 #       become manually maintained in the future if there will be releases
@@ -213,8 +212,7 @@ endif()
 
 # The GROMACS convention is that these are the version number of the next
 # release that is going to be made from this branch.
-set(GMX_VERSION_MAJOR 5)
-set(GMX_VERSION_MINOR 2)
+set(GMX_VERSION_MAJOR 2016)
 set(GMX_VERSION_PATCH 0)
 # The suffix, on the other hand, is used mainly for betas and release
 # candidates, where it signifies the most recent such release from
@@ -239,9 +237,9 @@ set(LIBRARY_VERSION ${LIBRARY_SOVERSION_MAJOR}.${LIBRARY_SOVERSION_MINOR}.0)
 # General version management based on manually set numbers
 
 if (GMX_VERSION_PATCH)
-    set(GMX_VERSION "${GMX_VERSION_MAJOR}.${GMX_VERSION_MINOR}.${GMX_VERSION_PATCH}")
+    set(GMX_VERSION "${GMX_VERSION_MAJOR}.${GMX_VERSION_PATCH}")
 else()
-    set(GMX_VERSION "${GMX_VERSION_MAJOR}.${GMX_VERSION_MINOR}")
+    set(GMX_VERSION "${GMX_VERSION_MAJOR}")
 endif()
 set(GMX_VERSION_STRING "${GMX_VERSION}${GMX_VERSION_SUFFIX}")
 option(GMX_BUILD_TARBALL "Build tarball without -dev version suffix" OFF)
@@ -259,7 +257,7 @@ set(REGRESSIONTEST_BRANCH "refs/heads/master")
 set(REGRESSIONTEST_MD5SUM "614a74e9b143bda5476f87f4ce08eec0" CACHE INTERNAL "MD5 sum of the regressiontests tarball")
 
 math(EXPR GMX_VERSION_NUMERIC
-     "${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_MINOR}*100 + ${GMX_VERSION_PATCH}")
+     "${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_PATCH}")
 set(GMX_API_VERSION ${GMX_VERSION_NUMERIC})
 
 #####################################################################
index 3f5c0ecf990302f4d885b25a51f7240318fc4dba..24acc553dbe9e060cc44eb41dd1df0539bfec849 100644 (file)
@@ -1767,12 +1767,11 @@ static void check_match(FILE *fplog,
          * different patch level versions, but we do not guarantee
          * compatibility between different major/minor versions - check this.
          */
-        int   gmx_major, gmx_minor;
-        int   cpt_major, cpt_minor;
-        sscanf(gmx_version(), "VERSION %5d.%5d", &gmx_major, &gmx_minor);
-        int   ret = sscanf(version, "VERSION %5d.%5d", &cpt_major, &cpt_minor);
-        version_differs = (ret < 2 || gmx_major != cpt_major ||
-                           gmx_minor != cpt_minor);
+        int   gmx_major;
+        int   cpt_major;
+        sscanf(gmx_version(), "%5d", &gmx_major);
+        int   ret = sscanf(version, "%5d", &cpt_major);
+        version_differs = (ret < 1 || gmx_major != cpt_major);
     }
 
     check_string(fplog, "Build time", BUILD_TIME, btime, &mm);
@@ -1802,13 +1801,13 @@ static void check_match(FILE *fplog,
     if (mm)
     {
         const char msg_version_difference[] =
-            "The current GROMACS major & minor version are not identical to those that\n"
+            "The current GROMACS major version is not identical to the one that\n"
             "generated the checkpoint file. In principle GROMACS does not support\n"
             "continuation from checkpoints between different versions, so we advise\n"
             "against this. If you still want to try your luck we recommend that you use\n"
             "the -noappend flag to keep your output files from the two versions separate.\n"
             "This might also work around errors where the output fields in the energy\n"
-            "file have changed between the different major & minor versions.\n";
+            "file have changed between the different versions.\n";
 
         const char msg_mismatch_notice[] =
             "GROMACS patchlevel, binary or parallel settings differ from previous run.\n"
index 5981310ff6a3e6322456af398a536a8bd46ee438..603c47c41b358441a02e6cd1f0bb42c41d3c9605 100644 (file)
@@ -121,7 +121,7 @@ void gmx_tng_open(const char       *filename,
 #ifdef GMX_DOUBLE
         precisionString = " (double precision)";
 #endif
-        sprintf(programInfo, "%.100s, %.128s%.24s",
+        sprintf(programInfo, "%.100s %.128s%.24s",
                 gmx::getProgramContext().displayName(),
                 gmx_version(), precisionString);
         if (mode == 'w')
index 98878555672756b035f610ebc0a1d9b35828c166..79bb915431df9b8368c6b69971ce5d8c473039fd 100644 (file)
@@ -68,6 +68,7 @@
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
 #include "gromacs/utility/txtdump.h"
 
 #define TPX_TAG_RELEASE  "release"
@@ -3251,7 +3252,8 @@ static void do_tpxheader(t_fileio *fio, gmx_bool bRead, t_tpxheader *tpx,
     }
     else
     {
-        gmx_fio_write_string(fio, gmx_version());
+        snprintf(buf, STRLEN, "VERSION %s", gmx_version());
+        gmx_fio_write_string(fio, buf);
         bDouble = (precision == sizeof(double));
         gmx_fio_setprecision(fio, bDouble);
         gmx_fio_do_int(fio, precision);
index 7d12ce3db8c80f00e3c75a88b6f2e0e3d137b5ab..23f66e12829e3f2df68bb175be1e7227250fcfaa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -34,6 +34,6 @@
  */
 #include "gromacs/utility/baseversion-gen.h"
 
-const char _gmx_ver_string[] = "VERSION @GMX_VERSION_STRING_FULL@";
+const char _gmx_ver_string[] = "@GMX_VERSION_STRING_FULL@";
 const char _gmx_full_git_hash[] = "@GMX_VERSION_FULL_HASH@";
 const char _gmx_central_base_hash[] = "@GMX_VERSION_CENTRAL_BASE_HASH@";
index 7d6c0eada1f1dcaf31a3e2515f684cb7b06eebc7..4bcccecbcb008571212700de7029bf42353cae07 100644 (file)
@@ -48,7 +48,8 @@
  *
  * This can be a plain version if git version info was disabled during the
  * build.
- * The returned string starts with a literal word `VERSION`.
+ * The returned string used to start with a literal word `VERSION` before
+ * \Gromacs 2016, but no longer does.
  *
  * \ingroup module_utility
  */
index 4df0c857bb1149cdd3c64f4251c22fd8ac52a65a..c997f515f4b0b0095d1e0209404b7a058416f55b 100644 (file)
@@ -348,7 +348,7 @@ void printBinaryInformation(FILE                            *fp,
         // necessary to read stuff above the copyright notice.
         // The line above the copyright notice puts the copyright notice is
         // context, though.
-        fprintf(fp, "%sGROMACS:      %s, %s%s%s\n", prefix, name,
+        fprintf(fp, "%sGROMACS:      %s, version %s%s%s\n", prefix, name,
                 gmx_version(), precisionString, suffix);
     }
     const char *const binaryPath = programContext.fullBinaryPath();
index a6fc1cf2a002f9ac2b81c28adb38e967cd0651a5..f5813c1748aedcb73580eaf9e0feca0046a6530e 100644 (file)
@@ -75,7 +75,7 @@ void printFatalErrorHeader(FILE *fp, const char *title,
     }
 
     std::fprintf(fp, "\n-------------------------------------------------------\n");
-    std::fprintf(fp, "Program:     %s, %s\n", programName, gmx_version());
+    std::fprintf(fp, "Program:     %s, version %s\n", programName, gmx_version());
     if (file != NULL)
     {
         // TODO: Check whether this works on Windows. If it doesn't, perhaps