# REGRESSIONTEST_MD5SUM
# The MD5 checksum of the regressiontest tarball. Only used when building
# from a source package.
+# GMX_SOURCE_DOI_ID
+# ID collected from Zenodo connected to the doi for a released version
+# used to identify the source when building an official released version.
+# This ID is used for the source code tarball.
+# GMX_MANUAL_DOI_ID
+# Same as above, but for the reference manual.
+# Setting and retrieving of those variables is handled in gmxCheckReleaseDOI.cmake
# 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
# tree is a git, but can be disabled with
# GMX_GIT_VERSION_INFO Advanced CMake variable to disable git
# version info generation.
+# If the version generation is disabled, then the source and manual doi
+# will be based on the stored values for the ID.
# The main interface to this machinery is the gmx_configure_version_file()
# CMake function. The signature is
# gmx_configure_version_file(<input> <output>
return()
endif()
+# Set those values only in release versions, after getting the identifiers
+# from Zenodo for the manual and source code
+# Has to be done by hand before every final release
+# Use force to override anything given as a cmake command line input
+set(GMX_MANUAL_DOI "" CACHE INTERNAL "reserved doi for GROMACS manual" FORCE)
+set(GMX_SOURCE_DOI "" CACHE INTERNAL "reserved doi for GROMACS source code" FORCE)
+
#####################################################################
# git version info management
include(SphinxMacros.cmake)
gmx_init_sphinx_setup(${SPHINX_INPUT_DIR})
+ # set temporary variables for doi inclusion
+ # into the manual, plain string + some wrapping
+ # for release builds, and dummy string for non-release
+ # builds
+ if("${GMX_MANUAL_DOI}" STREQUAL "")
+ # empty string means no doi, set dummy text
+ set(GMX_MANUAL_DOI_STRING "This is not a release build of GROMACS, so please reference")
+ set(GMX_MANUAL_DOI_STRING "${GMX_MANUAL_DOI_STRING} one of the GROMACS papers and the base release of the manual.")
+ else()
+ # release version, set plain old boring string
+ set(GMX_MANUAL_DOI_STRING "Please reference this documentation as https://doi.org/${GMX_MANUAL_DOI}.")
+ endif()
+ # same for source doi, but modify the text
+ if("${GMX_SOURCE_DOI}" STREQUAL "")
+ # empty string means no release build
+ set(GMX_SOURCE_DOI_STRING "This is not a release build of GROMACS. Please reference one of the")
+ set(GMX_SOURCE_DOI_STRING "${GMX_SOURCE_DOI_STRING} GROMACS papers, as well as the base release that this version is built from.")
+ set(GMX_SOURCE_DOI_STRING "${GMX_SOURCE_DOI_STRING} Also, please state what modifcations have been performed or where the version")
+ set(GMX_SOURCE_DOI_STRING "${GMX_SOURCE_DOI_STRING} was sourced from.")
+ else()
+ # release version, give them a doi url string
+ set(GMX_SOURCE_DOI_STRING "To cite the source code for this release, please cite")
+ set(GMX_SOURCE_DOI_STRING "${GMX_SOURCE_DOI_STRING} https://doi.org/${GMX_SOURCE_DOI}.")
+ endif()
+
set(SPHINX_CONFIG_VARS_FILE ${SPHINX_INPUT_DIR}/conf-vars.py)
gmx_configure_version_file(conf-vars.py.cmakein ${SPHINX_CONFIG_VARS_FILE}
EXTRA_VARS
SOURCE_MD5SUM REGRESSIONTEST_MD5SUM_STRING
GMX_TNG_MINIMUM_REQUIRED_VERSION
GMX_LMFIT_REQUIRED_VERSION
+ GMX_MANUAL_DOI_STRING
+ GMX_SOURCE_DOI_STRING
COMMENT "Configuring Sphinx configuration file")
gmx_add_sphinx_input_file(${SPHINX_CONFIG_VARS_FILE})
gmx_add_sphinx_source_files(FILES ${SPHINX_SOURCE_FILES})
('SOURCE_MD5SUM', '@SOURCE_MD5SUM@'),
('REGRESSIONTEST_MD5SUM', '@REGRESSIONTEST_MD5SUM_STRING@'),
('GMX_TNG_MINIMUM_REQUIRED_VERSION', '@GMX_TNG_MINIMUM_REQUIRED_VERSION@'),
- ('GMX_LMFIT_REQUIRED_VERSION', '@GMX_LMFIT_REQUIRED_VERSION@')
+ ('GMX_LMFIT_REQUIRED_VERSION', '@GMX_LMFIT_REQUIRED_VERSION@'),
+ ('GMX_MANUAL_DOI_STRING', '@GMX_MANUAL_DOI_STRING@'),
+ ('GMX_SOURCE_DOI_STRING', '@GMX_SOURCE_DOI_STRING@')
]
Downloads
=========
+|GMX_MANUAL_DOI_STRING|
+
+|GMX_SOURCE_DOI_STRING|
+
Source code
-----------
* |gmx-source-package-ftp|
For background on algorithms and implementations, see the
`reference manual`_.
+|GMX_MANUAL_DOI_STRING|
+
+|GMX_SOURCE_DOI_STRING|
+
.. _reference manual: gmx-manual-parent-dir_
.. toctree::
For background on algorithms and implementations, see the
:ref:`reference manual part <gmx-reference-manual-rst>` of the documentation.
+|GMX_MANUAL_DOI_STRING|
+
+|GMX_SOURCE_DOI_STRING|
+
.. TODO This is going to require more organization now that
we are getting more content available.
set(GENERATED_VERSION_FILE utility/baseversion-gen.cpp)
gmx_configure_version_file(
utility/baseversion-gen.cpp.cmakein ${GENERATED_VERSION_FILE}
- REMOTE_HASH)
+ REMOTE_HASH
+ EXTRA_VARS
+ GMX_SOURCE_DOI
+ )
list(APPEND LIBGROMACS_SOURCES ${GENERATED_VERSION_FILE}
$<TARGET_OBJECTS:libgromacs_external>
$<TARGET_OBJECTS:libgromacs_generated>)
please_cite(fplog, "Spoel2005a");
please_cite(fplog, "Lindahl2001a");
please_cite(fplog, "Berendsen95a");
+ writeSourceDoi(fplog);
}
std::unique_ptr<t_state> globalState;
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@";
+const char gmxSourceDoiString[] = "@GMX_SOURCE_DOI@";
extern const char _gmx_full_git_hash[];
//! Full git hash of the latest commit in a central \Gromacs repository.
extern const char _gmx_central_base_hash[];
+/*! \brief
+ * DOI string for the \Gromacs source code populated by CMake.
+ *
+ * The variable is populated with the generated DOI string
+ * by CMake when the build of a release version is
+ * requested by Jenkins. Allows identification and
+ * referencing of different \Gromacs releases.
+ */
+extern const char gmxSourceDoiString[];
//! \}
//! \endcond
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2018, 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.
return _gmx_central_base_hash;
}
+const char *gmxDOI()
+{
+ return gmxSourceDoiString;
+}
+
#if GMX_DOUBLE
void gmx_is_double_precision()
{
/*! \brief Return a string describing what kind of GPU suport was configured in the build. */
const char *getGpuImplementationString();
+/*! \brief
+ * DOI string, or empty when not a release build.
+ */
+const char *gmxDOI();
+
#endif
#include <cstring>
#include "gromacs/utility/arraysize.h"
+#include "gromacs/utility/baseversion.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/smalloc.h"
fprintf(fp, "-------- -------- --- Thank You --- -------- --------\n\n");
fflush(fp);
}
+
+void
+writeSourceDoi(FILE *fp)
+{
+ /* Check if we are in release mode or not.
+ * TODO The check should properly target something else than
+ * the string being empty
+ */
+ if (strlen(gmxDOI()) == 0)
+ {
+ /* Not a release build, return without printing anything */
+ return;
+ }
+
+ const char *doiString = wrap_lines(gmxDOI(), LINE_WIDTH, 0, FALSE);
+
+ if (fp == nullptr)
+ {
+ return;
+ }
+ fprintf(fp, "\n++++ PLEASE CITE THE DOI FOR THIS VERSION OF GROMACS ++++\n");
+ fprintf(fp, "%s%s\n", "https://doi.org/", doiString);
+ fprintf(fp, "-------- -------- --- Thank You --- -------- --------\n\n");
+ fflush(fp);
+}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018, 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.
/*! \libinternal \file
* \brief
* Declares please_cite() for printing out literature references.
+ * Declares writeSourceDoi for printing of source code DOI.
*
* \inlibraryapi
* \ingroup module_utility
void
please_cite(FILE *fp, const char *key);
+//! Write a message to \c fp to request citation also of the source-code DOI.
+void
+writeSourceDoi(FILE *fp);
+
#endif