From: Teemu Murtola Date: Thu, 17 Dec 2015 10:44:07 +0000 (+0200) Subject: Update versioning for new scheme X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=22dc636d9f8cf56af4322b455ae0c5652a5f60bd;p=alexxy%2Fgromacs.git Update versioning for new scheme 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 --- diff --git a/cmake/VersionInfo.cmake.cmakein b/cmake/VersionInfo.cmake.cmakein index b3f81b4ae1..4eefad669e 100644 --- a/cmake/VersionInfo.cmake.cmakein +++ b/cmake/VersionInfo.cmake.cmakein @@ -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@") diff --git a/cmake/gmxCPackUtilities.cmake b/cmake/gmxCPackUtilities.cmake index 805aeb6f7e..c780bc7a3f 100644 --- a/cmake/gmxCPackUtilities.cmake +++ b/cmake/gmxCPackUtilities.cmake @@ -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. diff --git a/cmake/gmxVersionInfo.cmake b/cmake/gmxVersionInfo.cmake index 282dcefa60..56ca2feeb9 100644 --- a/cmake/gmxVersionInfo.cmake +++ b/cmake/gmxVersionInfo.cmake @@ -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 @@ -77,10 +76,10 @@ # 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}) ##################################################################### diff --git a/src/gromacs/fileio/checkpoint.cpp b/src/gromacs/fileio/checkpoint.cpp index 3f5c0ecf99..24acc553db 100644 --- a/src/gromacs/fileio/checkpoint.cpp +++ b/src/gromacs/fileio/checkpoint.cpp @@ -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" diff --git a/src/gromacs/fileio/tngio.cpp b/src/gromacs/fileio/tngio.cpp index 5981310ff6..603c47c41b 100644 --- a/src/gromacs/fileio/tngio.cpp +++ b/src/gromacs/fileio/tngio.cpp @@ -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') diff --git a/src/gromacs/fileio/tpxio.cpp b/src/gromacs/fileio/tpxio.cpp index 9887855567..79bb915431 100644 --- a/src/gromacs/fileio/tpxio.cpp +++ b/src/gromacs/fileio/tpxio.cpp @@ -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); diff --git a/src/gromacs/utility/baseversion-gen.c.cmakein b/src/gromacs/utility/baseversion-gen.c.cmakein index 7d12ce3db8..23f66e1282 100644 --- a/src/gromacs/utility/baseversion-gen.c.cmakein +++ b/src/gromacs/utility/baseversion-gen.c.cmakein @@ -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@"; diff --git a/src/gromacs/utility/baseversion.h b/src/gromacs/utility/baseversion.h index 7d6c0eada1..4bcccecbcb 100644 --- a/src/gromacs/utility/baseversion.h +++ b/src/gromacs/utility/baseversion.h @@ -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 */ diff --git a/src/gromacs/utility/binaryinformation.cpp b/src/gromacs/utility/binaryinformation.cpp index 4df0c857bb..c997f515f4 100644 --- a/src/gromacs/utility/binaryinformation.cpp +++ b/src/gromacs/utility/binaryinformation.cpp @@ -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(); diff --git a/src/gromacs/utility/errorformat.cpp b/src/gromacs/utility/errorformat.cpp index a6fc1cf2a0..f5813c1748 100644 --- a/src/gromacs/utility/errorformat.cpp +++ b/src/gromacs/utility/errorformat.cpp @@ -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