Add grompp check for usage of "define" field in mdp
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / topio.cpp
index 57759a93b31c758e79ae1a2628c273fd3f51fb7e..459f771cd0a21f7ca65c20353cf4c174beee04e9 100644 (file)
@@ -48,6 +48,7 @@
 
 #include <algorithm>
 
+#include <unordered_set>
 #include <sys/types.h>
 
 #include "gromacs/fileio/gmxfio.h"
@@ -892,6 +893,14 @@ static char **read_topol(const char *infile, const char *outfile,
         }
     }
     while (!done);
+
+    // Check that all strings defined with -D were used when processing topology
+    std::string unusedDefineWarning = checkAndWarnForUnusedDefines(*handle);
+    if (!unusedDefineWarning.empty())
+    {
+        warning(wi, unusedDefineWarning);
+    }
+
     sfree(cpp_opts_return);
 
     if (out)