#
# 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.
else:
reporter.code_issue(fileobj, "does not include \"gmxpre.h\"")
includes_config_h = False
- includes_gmx_header_config_h = False
for include in includes:
includedfile = include.get_file()
if includedfile:
if includedfile.get_name() == 'config.h':
includes_config_h = True
- if includedfile.get_name() == 'gmx_header_config.h':
- includes_gmx_header_config_h = True
if includes_config_h:
if not fileobj.get_used_config_h_defines():
reporter.code_issue(fileobj,
"includes \"config.h\" unnecessarily")
- elif includes_gmx_header_config_h:
- if not fileobj.get_used_config_h_defines():
- if fileobj.get_name() != 'config.h':
- reporter.code_issue(fileobj,
- "includes \"gmx_header_config.h\" unnecessarily")
- # Hard-code logic for gmx_header_config.h contents for simplicity.
- elif len(fileobj.get_used_config_h_defines()) > 1 or \
- 'GMX_NATIVE_WINDOWS' not in fileobj.get_used_config_h_defines():
- reporter.code_issue(fileobj, "should include \"config.h\"")
else:
if fileobj.get_used_config_h_defines():
reporter.code_issue(fileobj, "should include \"config.h\"")
match = re.match(define_re, line)
if match:
self._defines.append(match.group(1))
- # Hard-code the contents of gmx_header_config.h to avoid
- # unnecessary complexity.
- self._defines.append('GMX_NATIVE_WINDOWS')
def get_defines(self):
"""Return set of possible defines from config.h.cmakein.
fileobj = self._files.get(filename)
if fileobj is not None:
if fileobj.get_name() not in ('config.h', 'config.h.cmakein',
- 'gmxpre-config.h', 'gmxpre-config.h.cmakein',
- 'gmx_header_config.h'):
+ 'gmxpre-config.h', 'gmxpre-config.h.cmakein'):
defines = re.findall(define_re, text)
fileobj.add_used_config_h_defines(defines)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,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.
elif included_file.get_name() == 'gmxpre.h':
group = IncludeGroup.pre
path = self._get_path(included_file, group, None)
- elif included_file.get_name() in ('config.h', 'gmx_header_config.h'):
+ elif included_file.get_name() == 'config.h':
group = IncludeGroup.config
path = self._get_path(included_file, group, None)
else:
#ifndef GMX_CONFIG_H
#define GMX_CONFIG_H
-#include "gromacs/utility/gmx_header_config.h"
-
/* TODO: For now, disable Doxygen warnings from here */
/*! \cond */
/* Target platform is BlueGene/Q */
#cmakedefine GMX_TARGET_BGQ
+/** Define if we are building natively on Windows */
+#cmakedefine GMX_NATIVE_WINDOWS
+
/** Define if we are building for Cygwin */
#cmakedefine GMX_CYGWIN
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
#include "gromacs/fileio/gmxfio_int.h"
#include "gromacs/fileio/md5.h"
#include "gromacs/legacyheaders/macros.h"
-#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
/* This is the new improved and thread safe version of gmxfio. */
#include "gromacs/math/units.h"
#include "gromacs/math/utilities.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
/* Structure for the names of lambda vector components */
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxomp.h"
#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
#include "geminate.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
#include "gromacs/utility/gmxmpi.h"
#include "gromacs/utility/programcontext.h"
#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
#include "gromacs/utility/sysinfo.h"
/* The source code in this file should be thread-safe.
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/datafilefinder.h"
+#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/directoryenumerator.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
static int rm_interactions(int ifunc, int nrmols, t_molinfo mols[])
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
#include "gromacs/topology/residuetypes.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
typedef struct {
#include "gromacs/topology/residuetypes.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/file.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 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.
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/snprintf.h"
#define BUFSIZE 1024
static void atom_not_found(int fatal_errno, const char *file, int line,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
#include "gromacs/topology/mtop_util.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
/* Is the signal in one simulation independent of other simulations? */
gmx_bool gs_simlocal[eglsNR] = { FALSE, FALSE, TRUE };
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/gmxmpi.h"
#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/snprintf.h"
/* DEBUG_WCYCLE adds consistency checking for the counters.
* It checks if you stop a counter different from the last
file.h
flags.h
futil.h
- gmx_header_config.h
gmxassert.h
init.h
programcontext.h
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,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.
#ifndef GMX_UTILITY_CSTRINGUTIL_H
#define GMX_UTILITY_CSTRINGUTIL_H
-#include "gromacs/utility/gmx_header_config.h"
-
#include <stdio.h>
#include "gromacs/utility/basedefinitions.h"
*/
char *gmx_step_str(gmx_int64_t i, char *buf);
-#ifdef GMX_NATIVE_WINDOWS
-#define snprintf _snprintf
-#endif
-
/*! \brief Construct an array of digits found in the input string
*
* \param[in] digitstring String that must contain only digits
--- /dev/null
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * 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
+ * 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.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+/*! \libinternal \file
+ * \brief
+ * Provides OS-specific directory-name separator
+ *
+ * \inlibraryapi
+ * \ingroup module_utility
+ */
+#ifndef GMX_UTILITY_DIR_SEPARATOR_H
+#define GMX_UTILITY_DIR_SEPARATOR_H
+
+#include "config.h"
+
+/*! \def DIR_SEPARATOR
+ * \brief
+ * Directory separator on this OS.
+ *
+ * Native Windows uses backslash path separators (but accepts also slashes).
+ * Cygwin and most other systems use slash.
+ *
+ * \todo Get rid of this (Redmine #950). It is not necessary for
+ * constructing paths on the systems that it currently supports, and
+ * is not reliable in parsing input paths either, since Windows needs
+ * to accept both instead of only DIR_SEPARATOR. At the very least, we
+ * should refactor the clients of this header so that they operate
+ * upon path objects rather than raw path strings.
+ */
+#ifdef GMX_NATIVE_WINDOWS
+#define DIR_SEPARATOR '\\'
+#else
+#define DIR_SEPARATOR '/'
+#endif
+
+#endif
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/datafilefinder.h"
+#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/path.h"
}
#endif
-#include "gromacs/utility/gmx_header_config.h"
-/*! \def DIR_SEPARATOR
- * \brief
- * Directory separator on this OS.
- *
- * Native Windows uses backslash path separators (but accepts also slashes).
- * Cygwin and most other systems use slash.
- *
- * \todo
- * Get rid of this (Redmine #950), or at least remove this from an installed
- * header. It is not necessary for constructing paths on the systems that it
- * currently supports, and is not reliable in parsing input paths either, since
- * Windows needs to accept both instead of only DIR_SEPARATOR.
- */
-#ifdef GMX_NATIVE_WINDOWS
-#define DIR_SEPARATOR '\\'
-#else
-#define DIR_SEPARATOR '/'
-#endif
-
/*! \def GMX_PATH_MAX
* \brief
* Maximum path length, if the OS provides one, otherwise a fixed constant.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,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.
#endif
#endif
+#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/stringutil.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
#include "thread_mpi/threads.h"
+#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/fatalerror.h"
#ifdef PRINT_ALLOC_KB
#include "gromacs/utility/basenetwork.h"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2012,2013,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.
* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
-/*! \file
- * \brief
- * Include file for configuration macros that affect installed headers.
+/*! \libinternal \file
+ * \brief Provide snprintf symbol on all OS (for internal Gromacs use)
*
- * This include file will be installed with GROMACS header files so that they
- * can refer to a central location for \#defines that will be available for
- * builds of projects that depend on GROMACS.
- *
- * \todo
- * It would be better to not have these defines at all in installed headers.
+ * \todo When all callers of snprintf compile as C++, perhaps use
+ * gmx::formatString() everywhere instead of snprintf.
*
* \inlibraryapi
* \ingroup module_utility
*/
+#ifndef GMX_UTILITY_SNPRINTF_H
+#define GMX_UTILITY_SNPRINTF_H
+
+#include "config.h"
+
+#include <stdio.h>
+
+#ifdef GMX_NATIVE_WINDOWS
+#define snprintf _snprintf
+#endif
-#if defined( _WIN32 ) || defined( _WIN64 )
-#define GMX_NATIVE_WINDOWS
#endif
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/legacyheaders/names.h"
#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,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.
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"