Switch remaining main() functions and copyrite.c to C++.
authorTeemu Murtola <teemu.murtola@gmail.com>
Sat, 29 Jun 2013 04:59:18 +0000 (07:59 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 3 Jul 2013 17:51:16 +0000 (19:51 +0200)
Required to be able to use gmx::ProgramInfo from these (done in
separate commit), and simplifies the compilation of mdrun as well.

Resolved compiler/cppcheck/clang warnings that were present in these
files.  Some include file clean-up, motivated by the fact that force.h
causes warnings when included in C++ files, and fixing that requires
fixing #1294, where the solution is not yet decided on.

Change-Id: I69f4200c1c1783340d88381a6aca82151d1230cb

17 files changed:
src/gromacs/gmxana/gmx_pme_error.cpp [moved from src/gromacs/gmxana/gmx_pme_error.c with 96% similarity]
src/gromacs/gmxlib/copyrite.cpp [moved from src/gromacs/gmxlib/copyrite.c with 99% similarity]
src/gromacs/gmxlib/cuda_tools/copyrite_gpu.cu
src/gromacs/gmxpreprocess/topdirs.c
src/gromacs/legacyheaders/grompp.h
src/gromacs/legacyheaders/mdrun.h
src/gromacs/legacyheaders/update.h
src/gromacs/mdlib/shellfc.c
src/gromacs/utility/gitversion.h
src/ngmx/CMakeLists.txt
src/ngmx/g_xrama.cpp [moved from src/ngmx/g_xrama.c with 98% similarity]
src/ngmx/ngmx.cpp [moved from src/ngmx/ngmx.c with 99% similarity]
src/programs/main.cpp [deleted file]
src/programs/mdrun/CMakeLists.txt
src/programs/mdrun/mdrun.cpp [moved from src/programs/mdrun/mdrun.c with 98% similarity]
src/programs/mdrun/runner.c
tests/CppCheck.cmake

similarity index 96%
rename from src/gromacs/gmxana/gmx_pme_error.c
rename to src/gromacs/gmxana/gmx_pme_error.cpp
index fd9aeb3191be64dcfe1b70234f0a3cf61dadbcf0..a27ed7ed662520edfa17907afdd1d7d6f4aff3f6 100644 (file)
@@ -30,6 +30,8 @@
  * And Hey:
  * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
  */
+#include <algorithm>
+
 #include "statutil.h"
 #include "typedefs.h"
 #include "smalloc.h"
@@ -71,21 +73,6 @@ enum {
 };
 
 
-typedef struct
-{
-    int    nPMEnodes;     /* number of PME only nodes used in this test */
-    int    nx, ny, nz;    /* DD grid */
-    int    guessPME;      /* if nPMEnodes == -1, this is the guessed number of PME nodes */
-    float *Gcycles;       /* This can contain more than one value if doing multiple tests */
-    float  Gcycles_Av;
-    float *ns_per_day;
-    float  ns_per_day_Av;
-    float *PME_f_load;     /* PME mesh/force load average*/
-    float  PME_f_load_Av;  /* Average average ;) ... */
-    char  *mdrun_cmd_line; /* Mdrun command line used for this test */
-} t_perf;
-
-
 typedef struct
 {
     gmx_large_int_t orig_sim_steps;  /* Number of steps to be done in the real simulation  */
@@ -135,7 +122,6 @@ static void calc_q2all(
     real            q2_all = 0;  /* Sum of squared charges */
     int             nrq_mol;     /* Number of charges in a single molecule */
     int             nrq_all;     /* Total number of charges in the MD system */
-    real            nrq_all_r;   /* No of charges in real format */
     real            qi, q2_mol;
     gmx_moltype_t  *molecule;
     gmx_molblock_t *molblock;
@@ -169,7 +155,6 @@ static void calc_q2all(
                 imol, molblock->natoms_mol, q2_mol, nrq_mol, molblock->nmol, q2_all, nrq_all);
 #endif
     }
-    nrq_all_r = nrq_all;
 
     *q2all   = q2_all;
     *q2allnr = nrq_all;
@@ -256,14 +241,14 @@ static inline real eps_poly2(
     {
         tmp  = m / K + i;
         tmp *= 2.0*M_PI;
-        nom += pow( tmp, -2.0*n );
+        nom += pow( tmp, -2*n );
     }
 
     for (i = SUMORDER; i > 0; i--)
     {
         tmp  = m / K + i;
         tmp *= 2.0*M_PI;
-        nom += pow( tmp, -2.0*n );
+        nom += pow( tmp, -2*n );
     }
 
     for (i = -SUMORDER; i < SUMORDER+1; i++)
@@ -296,14 +281,14 @@ static inline real eps_poly3(
     {
         tmp  = m / K + i;
         tmp *= 2.0*M_PI;
-        nom += i * pow( tmp, -2.0*n );
+        nom += i * pow( tmp, -2*n );
     }
 
     for (i = SUMORDER; i > 0; i--)
     {
         tmp  = m / K + i;
         tmp *= 2.0*M_PI;
-        nom += i * pow( tmp, -2.0*n );
+        nom += i * pow( tmp, -2*n );
     }
 
     for (i = -SUMORDER; i < SUMORDER+1; i++)
@@ -336,14 +321,14 @@ static inline real eps_poly4(
     {
         tmp  = m / K + i;
         tmp *= 2.0*M_PI;
-        nom += i * i * pow( tmp, -2.0*n );
+        nom += i * i * pow( tmp, -2*n );
     }
 
     for (i = SUMORDER; i > 0; i--)
     {
         tmp  = m / K + i;
         tmp *= 2.0*M_PI;
-        nom += i * i * pow( tmp, -2.0*n );
+        nom += i * i * pow( tmp, -2*n );
     }
 
     for (i = -SUMORDER; i < SUMORDER+1; i++)
@@ -385,7 +370,7 @@ static inline real eps_self(
     {
         tmp    = -sin(2.0 * M_PI * i * K * rcoord);
         tmp1   = 2.0 * M_PI * m / K + 2.0 * M_PI * i;
-        tmp2   = pow(tmp1, -1.0*n);
+        tmp2   = pow(tmp1, -n);
         nom   += tmp * tmp2 * i;
         denom += tmp2;
     }
@@ -394,14 +379,14 @@ static inline real eps_self(
     {
         tmp    = -sin(2.0 * M_PI * i * K * rcoord);
         tmp1   = 2.0 * M_PI * m / K + 2.0 * M_PI * i;
-        tmp2   = pow(tmp1, -1.0*n);
+        tmp2   = pow(tmp1, -n);
         nom   += tmp * tmp2 * i;
         denom += tmp2;
     }
 
 
     tmp    = 2.0 * M_PI * m / K;
-    tmp1   = pow(tmp, -1.0*n);
+    tmp1   = pow(tmp, -n);
     denom += tmp1;
 
     return 2.0 * M_PI * nom / denom * K;
@@ -499,7 +484,7 @@ static real estimate_reciprocal(
     xtot        = stopglobal*2+1;
     if (PAR(cr))
     {
-        x_per_core = ceil((real)xtot / (real)cr->nnodes);
+        x_per_core = static_cast<int>(ceil(static_cast<real>(xtot) / cr->nnodes));
         startlocal = startglobal + x_per_core*cr->nodeid;
         stoplocal  = startlocal + x_per_core -1;
         if (stoplocal > stopglobal)
@@ -645,18 +630,18 @@ static real estimate_reciprocal(
         /* Here xtot is the number of samples taken for the Monte Carlo calculation
          * of the average of term IV of equation 35 in Wang2010. Round up to a
          * number of samples that is divisible by the number of nodes */
-        x_per_core  = ceil(info->fracself * nr / (real)cr->nnodes);
+        x_per_core  = static_cast<int>(ceil(info->fracself * nr / cr->nnodes));
         xtot        = x_per_core * cr->nnodes;
     }
     else
     {
         /* In this case we use all nr particle positions */
         xtot       = nr;
-        x_per_core = ceil( (real)xtot / (real)cr->nnodes );
+        x_per_core = static_cast<int>(ceil(static_cast<real>(xtot) / cr->nnodes));
     }
 
     startlocal = x_per_core *  cr->nodeid;
-    stoplocal  = min(startlocal + x_per_core, xtot);  /* min needed if xtot == nr */
+    stoplocal  = std::min(startlocal + x_per_core, xtot);  /* min needed if xtot == nr */
 
     if (bFraction)
     {
@@ -668,7 +653,7 @@ static real estimate_reciprocal(
         {
             for (i = 0; i < xtot; i++)
             {
-                numbers[i] = floor(gmx_rng_uniform_real(rng) * nr );
+                numbers[i] = static_cast<int>(floor(gmx_rng_uniform_real(rng) * nr));
             }
         }
         /* Broadcast the random number array to the other nodes */
@@ -1031,7 +1016,7 @@ static void estimate_PME_error(t_inputinfo *info, t_state *state,
         edir = info->e_dir[0];
         erec = info->e_rec[0];
         derr = edir-erec;
-        while (fabs(derr/min(erec, edir)) > 1e-4)
+        while (fabs(derr/std::min(erec, edir)) > 1e-4)
         {
 
             beta                = info->ewald_beta[0];
similarity index 99%
rename from src/gromacs/gmxlib/copyrite.c
rename to src/gromacs/gmxlib/copyrite.cpp
index 81369c25d9ed4a0e084e2832e6eb34d7bfec1a27..d25544bda659b6b66c6147af9b33b14fb11a25e3 100644 (file)
@@ -116,7 +116,7 @@ static void pukeit(const char *db, const char *defstring, char *retstring,
         /* for libraries we can use the low-level close routines */
         ffclose(fp);
         seed   = time(NULL);
-        *cqnum = nhlp*rando(&seed);
+        *cqnum = static_cast<int>(nhlp*rando(&seed));
         if (strlen(help[*cqnum]) >= STRLEN)
         {
             help[*cqnum][STRLEN-1] = '\0';
@@ -130,6 +130,7 @@ static void pukeit(const char *db, const char *defstring, char *retstring,
     }
     else
     {
+        *cqnum = -1;
         strncpy(retstring, defstring, retsize);
     }
 }
@@ -146,7 +147,7 @@ void bromacs(char *retstring, int retsize)
 void cool_quote(char *retstring, int retsize, int *cqnum)
 {
     char *tmpstr;
-    char *s, *ptr;
+    char *ptr;
     int   tmpcq, *p;
 
     if (cqnum != NULL)
@@ -263,12 +264,12 @@ void CopyRight(FILE *out, const char *szProgram)
 void gmx_thanx(FILE *fp)
 {
     char cq[1024];
-    int  cqnum;
+    int  cqnum = -1;
 
     /* protect the audience from suggestive discussions */
     cool_quote(cq, 1023, &cqnum);
 
-    if (be_cool())
+    if (cqnum >= 0)
     {
         fprintf(fp, "\ngcq#%d: %s\n\n", cqnum, cq);
     }
@@ -573,7 +574,7 @@ void please_cite(FILE *fp, const char *key)
     };
 #define NSTR (int)asize(citedb)
 
-    int   j, index;
+    int   index;
     char *author;
     char *title;
 #define LINE_WIDTH 79
index 001ca53fc2c33920c85610471651c36651dcec01..8c33a7e32474675d5996ae6271453d2f4adeb4ac 100644 (file)
@@ -46,7 +46,7 @@
 
 #include "buildinfo.h"
 
-extern "C" void gmx_print_version_info_gpu(FILE *fp) 
+void gmx_print_version_info_gpu(FILE *fp)
 {
     int cuda_driver,cuda_runtime;
     fprintf(fp, "CUDA compiler:      %s\n",CUDA_NVCC_COMPILER_INFO);
index b501a733bc242a4756f3bf3ce74364aff5a34e23..00bfb9e9af095a694535646cb6de819f82ebff98 100644 (file)
 #include "gmx_fatal.h"
 #include "topdirs.h"
 
+/* Must correspond to the directive enum in grompp.h */
+static const char *directive_names[d_maxdir+1] = {
+    "defaults",
+    "atomtypes",
+    "bondtypes",
+    "constrainttypes",
+    "pairtypes",
+    "angletypes",
+    "dihedraltypes",
+    "nonbond_params",
+    "implicit_genborn_params",
+    "implicit_surface_params",
+    "cmaptypes",
+    /* All the directives above can not appear after moleculetype */
+    "moleculetype",
+    "atoms",
+    "virtual_sites2",
+    "virtual_sites3",
+    "virtual_sites4",
+    "virtual_sitesn",
+    "bonds",
+    "exclusions",
+    "pairs",
+    "pairs_nb",
+    "angles",
+    "dihedrals",
+    "constraints",
+    "settles",
+    "polarization",
+    "water_polarization",
+    "thole_polarization",
+    "system",
+    "molecules",
+    "position_restraints",
+    "angle_restraints",
+    "angle_restraints_z",
+    "distance_restraints",
+    "orientation_restraints",
+    "dihedral_restraints",
+    "cmap",
+    "invalid"
+};
+
 int ifunc_index(directive d, int type)
 {
     switch (d)
@@ -248,11 +291,11 @@ const char *dir2str (directive d)
 {
     if (d < d_maxdir)
     {
-        return ds[d];
+        return directive_names[d];
     }
     else
     {
-        return ds[d_maxdir];
+        return directive_names[d_maxdir];
     }
 }
 
index ad06edf71c636ca7cdb4a6d1d6aef7f9057aee04..63f7c93ce8473e9c7832ec2150517f1dcbc60379 100644 (file)
@@ -103,6 +103,7 @@ typedef struct {
 gmx_bool is_int(double x);
 /* Returns TRUE when x is integer */
 
+/* Must correspond to strings in topdirs.c */
 typedef enum {
     d_defaults,
     d_atomtypes,
@@ -146,48 +147,6 @@ typedef enum {
     d_none
 } directive;
 
-static const char *ds[d_maxdir+1] = {
-    "defaults",
-    "atomtypes",
-    "bondtypes",
-    "constrainttypes",
-    "pairtypes",
-    "angletypes",
-    "dihedraltypes",
-    "nonbond_params",
-    "implicit_genborn_params",
-    "implicit_surface_params",
-    "cmaptypes",
-    /* All the directives above can not appear after moleculetype */
-    "moleculetype",
-    "atoms",
-    "virtual_sites2",
-    "virtual_sites3",
-    "virtual_sites4",
-    "virtual_sitesn",
-    "bonds",
-    "exclusions",
-    "pairs",
-    "pairs_nb",
-    "angles",
-    "dihedrals",
-    "constraints",
-    "settles",
-    "polarization",
-    "water_polarization",
-    "thole_polarization",
-    "system",
-    "molecules",
-    "position_restraints",
-    "angle_restraints",
-    "angle_restraints_z",
-    "distance_restraints",
-    "orientation_restraints",
-    "dihedral_restraints",
-    "cmap",
-    "invalid"
-};
-
 #ifdef __cplusplus
 }
 #endif
index 8b8f697544a88c0dc73e9457eafda7b2de16a03e..ca932063a3aeb51fc0bbec9fa40bc1b09cc44159 100644 (file)
@@ -44,7 +44,6 @@
 #include "tgroup.h"
 #include "filenm.h"
 #include "mshift.h"
-#include "force.h"
 #include "edsam.h"
 #include "mdebin.h"
 #include "vcm.h"
index 0797c688d57b6e9dfc12c357d7e7d167c7f0c68d..a3d68de006ad62544ecf6a4947956046dde7330b 100644 (file)
@@ -40,7 +40,6 @@
 #include "mshift.h"
 #include "tgroup.h"
 #include "network.h"
-#include "force.h"
 #include "pull.h"
 #include "gmx_random.h"
 #include "maths.h"
index 8469a259eebcefbf490907e6f195c6bddb99d9ad..97a9c12503dd5092691c643d788fdd9ade5c835d 100644 (file)
@@ -41,6 +41,7 @@
 #include "gmx_fatal.h"
 #include "vec.h"
 #include "txtdump.h"
+#include "force.h"
 #include "mdrun.h"
 #include "partdec.h"
 #include "mdatoms.h"
index b78e51aac1124d922eb42cb4be47e0d636dce3cc..828d749355b41a33f829ef1695c119039f4030d5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2012, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2013, by the GROMACS development team, led by
  * David van der Spoel, Berk Hess, 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_GITVERSION_H
 #define GMX_UTILITY_GITVERSION_H
 
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
 extern const char _gmx_ver_string[];
 extern const char _gmx_full_git_hash[];
 extern const char _gmx_central_base_hash[];
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 791061d39084f6c74e3687992cd8fd19a6173db6..10e3f09a6ba4c8629c4a202b538675df92d689aa 100644 (file)
@@ -14,15 +14,15 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 # List of programs with single corresponding *.c source file,
 # used to create build rules automatically.
 #
-set(NGMX_PROGRAMS 
+set(NGMX_PROGRAMS
     ngmx g_xrama)
 
 foreach(PROG ${NGMX_PROGRAMS})
-        add_executable(${PROG} ${PROG}.c ${NGMX_COMMON_SOURCE})
+        add_executable(${PROG} ${PROG}.cpp ${NGMX_COMMON_SOURCE})
         target_link_libraries(${PROG} libgromacs ${GMX_EXTRA_LIBRARIES})
         gmx_add_man_page(${PROG})
         set_target_properties(${PROG} PROPERTIES OUTPUT_NAME "${PROG}${GMX_BINARY_SUFFIX}")
-endforeach(PROG) 
+endforeach(PROG)
 
 install(TARGETS ${NGMX_PROGRAMS}
         COMPONENT ngmx
similarity index 98%
rename from src/ngmx/g_xrama.c
rename to src/ngmx/g_xrama.cpp
index b1807ea23f63b91d4b5b03c71dc21af76a810649..ecc0c6a83780b04fa27ad338fc4fee92cdefc2e6 100644 (file)
@@ -351,7 +351,6 @@ int main(int argc, char *argv[])
 
     output_env_t oenv;
     t_x11       *x11;
-    t_topology  *ramatop;
     t_app       *app;
     t_filenm     fnm[] = {
         { efTRX, "-f", NULL, ffREAD },
@@ -372,8 +371,8 @@ int main(int argc, char *argv[])
     XSetForeground(x11->disp, x11->gc, x11->fg);
     app = init_app(x11, argc, argv);
 
-    ramatop = init_rama(oenv, ftp2fn(efTRX, NFILE, fnm), ftp2fn(efTPX, NFILE, fnm),
-                        app->xr, 3);
+    init_rama(oenv, ftp2fn(efTRX, NFILE, fnm), ftp2fn(efTPX, NFILE, fnm),
+              app->xr, 3);
     mk_gly(app);
 
     XMapWindow(x11->disp, app->wd.self);
similarity index 99%
rename from src/ngmx/ngmx.c
rename to src/ngmx/ngmx.cpp
index e731111679f13dfe3feafe041bf132e0231a2509..b428c0b0df650e07332547e886b7a6f6fd417577 100644 (file)
@@ -63,7 +63,6 @@ void init_gmx(t_x11 *x11, char *program, int nfile, t_filenm fnm[],
 static void dump_xw(char *dispname, Window w, char *fn)
 {
     char comm[256];
-    int  rc;
 
     sprintf(comm, "xwd -id %d -display %s > %s", (int)w, dispname, fn);
 
@@ -71,7 +70,7 @@ static void dump_xw(char *dispname, Window w, char *fn)
     printf("Warning-- No calls to system(3) supported on this platform.");
     printf("Warning-- Skipping execution of 'system(\"%s\")'.", buf);
 #else
-    rc = system(comm);
+    (void)system(comm);
 #endif
 }
 
@@ -364,7 +363,7 @@ void init_gmx(t_x11 *x11, char *program, int nfile, t_filenm fnm[],
     t_gmx                *gmx;
     XSizeHints            hints;
     int                   w0, h0;
-    int                   natom, nre, natom_trx;
+    int                   natom, natom_trx;
     t_topology            top;
     int                   ePBC;
     matrix                box;
diff --git a/src/programs/main.cpp b/src/programs/main.cpp
deleted file mode 100644 (file)
index c521c97..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- * Copyright (c) 2001-2012, The GROMACS Development Team
- *
- * Gromacs is a library for molecular simulation and trajectory analysis,
- * written by Erik Lindahl, David van der Spoel, Berk Hess, and others - for
- * a full list of developers and information, check out http://www.gromacs.org
- *
- * This program 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 of the License, or (at your option) any
- * later version.
- *
- * To help fund GROMACS development, we humbly ask that you cite
- * the papers people have written on it - you can find them on the website.
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-int cmain(int argc, char *argv[]);
-#ifdef __cplusplus
-}
-#endif
-int main(int argc, char *argv[])
-{
-    return cmain(argc, argv);
-}
index e3cb576f79b124b13ff7df284ceca5a8007b70e9..090710ff61783b9bb163ba0eae14f9321c1dfac5 100644 (file)
@@ -2,9 +2,8 @@ include_directories(${CMAKE_SOURCE_DIR}/src/gromacs/gmxpreprocess)
 
 set(MDRUN_SOURCES
     do_gct.c      gctio.c       genalg.c    ionize.c
-    md.c          mdrun.c     membed.c
-    pme_loadbal.c repl_ex.c     runner.c    xutils.c
-    ../main.cpp)
+    md.c          mdrun.cpp     membed.c
+    pme_loadbal.c repl_ex.c     runner.c    xutils.c)
 
 if(GMX_OPENMM)
     # Even though the OpenMM build has "moved to contrib", many things
similarity index 98%
rename from src/programs/mdrun/mdrun.c
rename to src/programs/mdrun/mdrun.cpp
index 2b23ce799b06a1bf198db92766ced956eb1e38e5..9c6fff96b38e166cb54d21b69aa980d9a66c4cc1 100644 (file)
  * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
  */
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
 #endif
 
-#include "typedefs.h"
-#include "macros.h"
-#include "copyrite.h"
-#include "main.h"
-#include "statutil.h"
-#include "smalloc.h"
-#include "futil.h"
-#include "smalloc.h"
-#include "edsam.h"
-#include "mdrun.h"
-#include "xmdrun.h"
-#include "checkpoint.h"
-#ifdef GMX_THREAD_MPI
-#include "thread_mpi.h"
-#endif
-
-/* afm stuf */
-#include "pull.h"
-
-int cmain(int argc, char *argv[])
+#include <stdio.h>
+
+#include "gromacs/legacyheaders/checkpoint.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/filenm.h"
+#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/main.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/readinp.h"
+#include "gromacs/legacyheaders/statutil.h"
+#include "gromacs/legacyheaders/typedefs.h"
+
+int main(int argc, char *argv[])
 {
     const char   *desc[] = {
         "The [TT]mdrun[tt] program is the main computational chemistry engine",
@@ -406,8 +401,6 @@ int cmain(int argc, char *argv[])
 #define NFILE asize(fnm)
 
     /* Command line options ! */
-    gmx_bool      bCart         = FALSE;
-    gmx_bool      bPPPME        = FALSE;
     gmx_bool      bPartDec      = FALSE;
     gmx_bool      bDDBondCheck  = TRUE;
     gmx_bool      bDDBondComm   = TRUE;
@@ -544,7 +537,6 @@ int cmain(int argc, char *argv[])
         { "-resethway", FALSE, etBOOL, {&bResetCountersHalfWay},
           "HIDDENReset the cycle counters after half the number of steps or halfway [TT]-maxh[tt]" }
     };
-    gmx_edsam_t   ed;
     unsigned long Flags, PCA_Flags;
     ivec          ddxyz;
     int           dd_node_order;
@@ -594,7 +586,6 @@ int cmain(int argc, char *argv[])
     /* now check the -multi and -multidir option */
     if (opt2bSet("-multidir", NFILE, fnm))
     {
-        int i;
         if (nmultisim > 0)
         {
             gmx_fatal(FARGS, "mdrun -multi and -multidir options are mutually exclusive.");
index c820938cf63660e708919cd9ebf0ca99e42acc11..74443871a5c99f267592c7a19db102263d680c53 100644 (file)
@@ -48,6 +48,7 @@
 #include "smalloc.h"
 #include "sysstuff.h"
 #include "statutil.h"
+#include "force.h"
 #include "mdrun.h"
 #include "md_logging.h"
 #include "md_support.h"
index c2cf88c16261cae72e772c50f4096d5bd7f2a25e..98a3ca4e3a653de8802fe0376f188eeedf4dd72f 100644 (file)
@@ -73,7 +73,7 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         ${_outputopt})
     set(_c_flags
         -I src/gromacs/gmxpreprocess
-        -I src/programs/mdrun -I src/programs/pdb2gmx
+        -I src/programs/mdrun
         --suppress=variableScope
         --suppress=unusedVariable
         --suppress=unreadVariable