Merge release-5-0 into master
authorDavid van der Spoel <spoel@xray.bmc.uu.se>
Wed, 17 Sep 2014 14:43:01 +0000 (16:43 +0200)
committerDavid van der Spoel <spoel@xray.bmc.uu.se>
Wed, 17 Sep 2014 15:38:07 +0000 (17:38 +0200)
Change-Id: I862e73932dea368b5bac883eb1bf5725314efd2d

1  2 
cmake/gmxCFlags.cmake
cmake/legacy_and_external.supp
src/gromacs/analysisdata/tests/analysisdata.cpp
src/gromacs/analysisdata/tests/arraydata.cpp
src/gromacs/analysisdata/tests/average.cpp
src/gromacs/analysisdata/tests/datatest.h
src/gromacs/analysisdata/tests/histogram.cpp
src/gromacs/analysisdata/tests/lifetime.cpp

diff --combined cmake/gmxCFlags.cmake
index c0eff548ba523da0122f679e4cfc7c064d125d58,aabadfbc597db6e9ecdd19eb69ac0f3d19c95e75..f6056c376cab071f0e9c3f900b59fa4111e4f16e
@@@ -64,7 -64,7 +64,7 @@@ function(gmx_set_cmake_compiler_flags
          # be set up elsewhere and passed to this function, but it is
          # inconvenient in CMake to pass more than one list, and such a
          # list is only used here.
 -        foreach(build_type RELWITHDEBUGINFO RELWITHASSERT MINSIZEREL)
 +        foreach(build_type RELWITHDEBUGINFO RELWITHASSERT MINSIZEREL PROFILE)
              set(GMXC_${language}FLAGS_${build_type} "${GMXC_${language}FLAGS_RELEASE}")
          endforeach()
          # Copy the flags that are only used by the real Release build
@@@ -110,12 -110,14 +110,12 @@@ MACRO(gmx_c_flags
          # Since 4.8 on by default. For previous version disabling is a no-op. Only disabling for Release because with assert
          # the warnings are OK.
          GMX_TEST_CFLAG(CFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CFLAGS_RELEASE_ONLY)
 -        # Since gcc 4.8 strict - false postives with old gmx_fatal. TODO: Remove in master
 -        GMX_TEST_CFLAG(CFLAGS_WARN_UNINIT "-Wno-maybe-uninitialized" GMXC_CFLAGS)
          if(CYGWIN)
              GMX_TEST_CFLAG(CFLAGS_WARN_SUBSCRIPT "-Wno-char-subscripts" GMXC_CFLAGS)
          endif()
          # new in gcc 4.5
          GMX_TEST_CFLAG(CFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CFLAGS_RELEASE)
 -        GMX_TEST_CFLAG(CFLAGS_COPT "-fomit-frame-pointer -funroll-all-loops"
 +        GMX_TEST_CFLAG(CFLAGS_COPT "-funroll-all-loops"
                         GMXC_CFLAGS_RELEASE)
          GMX_TEST_CFLAG(CFLAGS_NOINLINE "-fno-inline" GMXC_CFLAGS_DEBUG)
      endif()
          GMX_TEST_CFLAG(CXXFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CXXFLAGS_RELEASE_ONLY)
          # new in gcc 4.5
          GMX_TEST_CXXFLAG(CXXFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CXXFLAGS_RELEASE)
 -        GMX_TEST_CXXFLAG(CXXFLAGS_COPT "-fomit-frame-pointer -funroll-all-loops"
 +        GMX_TEST_CXXFLAG(CXXFLAGS_COPT "-funroll-all-loops"
                           GMXC_CXXFLAGS_RELEASE)
          GMX_TEST_CXXFLAG(CXXFLAGS_NOINLINE "-fno-inline" GMXC_CXXFLAGS_DEBUG)
      endif()
      if (CMAKE_C_COMPILER_ID MATCHES "Intel")
          if (NOT WIN32) 
              if(NOT GMX_OPENMP)
-                 GMX_TEST_CFLAG(CFLAGS_PRAGMA "-wd161" GMXC_CFLAGS)
+                 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 13.99.99)
+ # 3180: unrecognized OpenMP #pragma
+                     GMX_TEST_CFLAG(CFLAGS_PRAGMA "-wd3180" GMXC_CFLAGS)
+                 else()
+ # 161: unrecognized #pragma
+                     GMX_TEST_CFLAG(CFLAGS_PRAGMA "-wd161" GMXC_CFLAGS)
+                 endif()
              endif()
+ # 111: statement is unreachable
+ # 177: function ".." was declared but never referenced
+ # 181: argument of type ".." is incompatible with format "..", expecting argument of type ".."
+ # 193: zero used for undefined preprocessing identifier ".."
+ # 271: trailing comma is nonstandard
+ # 304: access control not specified ("public" by default)
+ # 383: value copied to temporary, reference to temporary used
+ # 424: extra ";" ignored
+ # 444: destructor for base class ".." is not virtual
+ # 522: function ".." redeclared "inline" after being called
+ # 593: variable ".." was set but never used
+ # 869: parameter ".." was never referenced
+ # 981: operands are evaluated in unspecified order
+ #1418: external function definition with no prior declaration
+ #1419: external declaration in primary source file
+ #1572: floating-point equality and inequality comparisons are unreliable
+ #1599: declaration hides variable ".."
+ #2259: non-pointer conversion from ".." to ".." may lose significant bits
+ #2415: variable ".." of static storage duration was declared but never referenced
+ #2547: ".." was specified as both a system and non-system include directory
+ #2557: comparison between signed and unsigned operands
+ #3280: declaration hides member ".."
+ #3346: dynamic exception specifications are deprecated
              GMX_TEST_CFLAG(CFLAGS_WARN "-w3 -wd111 -wd177 -wd181 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346" GMXC_CFLAGS)
              GMX_TEST_CFLAG(CFLAGS_STDGNU "-std=gnu99" GMXC_CFLAGS)
              GMX_TEST_CFLAG(CFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias" GMXC_CFLAGS_RELEASE)
+             #documented to be default but not set for ICC15. Gives remarks that inlining is not possible because of max-size setting
+             GMX_TEST_CFLAG(CFLAGS_INLINE "-no-inline-max-size -no-inline-max-total-size" GMXC_CFLAGS)
          else()
              if(NOT GMX_OPENMP)
-                 GMX_TEST_CFLAG(CFLAGS_PRAGMA "/wd161" GMXC_CFLAGS)
+                 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 13.99.99)
+                     GMX_TEST_CFLAG(CFLAGS_PRAGMA "/wd3180" GMXC_CFLAGS)
+                 else()
+                     GMX_TEST_CFLAG(CFLAGS_PRAGMA "/wd161" GMXC_CFLAGS)
+                 endif()
              endif()
              GMX_TEST_CFLAG(CFLAGS_WARN "/W3 /wd111 /wd177 /wd181 /wd193 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346" GMXC_CFLAGS)
              GMX_TEST_CFLAG(CFLAGS_OPT "/Qip" GMXC_CFLAGS_RELEASE)
      if (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
          if (NOT WIN32) 
              if(NOT GMX_OPENMP)
-                 GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-wd161" GMXC_CXXFLAGS)
+                 if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.99.99)
+                     GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-wd3180" GMXC_CXXFLAGS)
+                 else()
+                     GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-wd161" GMXC_CXXFLAGS)
+                 endif()
              endif()
-             GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3 -wd111 -wd177 -wd181 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd1782" GMXC_CXXFLAGS)
+ #All but the following warnings are identical for the C-compiler (see above)
+ #1782: #pragma once is obsolete
+ #2282: unrecognized GCC pragma
+             GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3 -wd111 -wd177 -wd181 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd1782 -wd2282" GMXC_CXXFLAGS)
              GMX_TEST_CXXFLAG(CXXFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias" GMXC_CXXFLAGS_RELEASE)
+             GMX_TEST_CXXFLAG(CXXFLAGS_INLINE "-no-inline-max-size -no-inline-max-total-size" GMXC_CXXFLAGS)
          else()
              if(NOT GMX_OPENMP)
-                 GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "/wd161" GMXC_CXXFLAGS)
+                 if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.99.99)
+                     GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "/wd3180" GMXC_CFLAGS)
+                 else()
+                     GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "/wd161" GMXC_CXXFLAGS)
+                 endif()
              endif()
-             GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/W3 /wd111 /wd177 /wd181 /wd193 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346 /wd1782" GMXC_CXXFLAGS)
+             GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/W3 /wd111 /wd177 /wd181 /wd193 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346 /wd1782 /wd2282" GMXC_CXXFLAGS)
              GMX_TEST_CXXFLAG(CXXFLAGS_OPT "/Qip" GMXC_CXXFLAGS_RELEASE)
          endif()
      endif()
index dc893678343103c1b20e5cbd683f2a115cbe299e,0e84ddeabacfda268e761e70646f004fa45d0cd7..082fcc14ae51c18e905299c884f0b73a6880a677
     fun:gmx_fio_fopen
  }
  {
 -   new_symbuf
 +   put_symtab
     Memcheck:Leak
     ...
 -   fun:new_symbuf
 +   fun:put_symtab
  }
  {
     bTimeSet/tMPI_Thread_mutex_init_once
     fun:__vfprintf
  }
  
+ {
+    printf
+    Memcheck:Leak
+    fun:malloc
+    ...
+    fun:vfprintf_l
+ }
  {
     strtof
     Memcheck:Leak
index 7cdd8baffa67df33e607a06d0a96e06c14e94cd3,6891bcef401e112d60e04fec3aa3c8d1f0b96142..c1f94697bac778e339a42512283d33c70c010963
   * \author Teemu Murtola <teemu.murtola@gmail.com>
   * \ingroup module_analysisdata
   */
 +#include "gmxpre.h"
 +
 +#include "gromacs/analysisdata/analysisdata.h"
 +
  #include <gmock/gmock.h>
  #include <gtest/gtest.h>
  
 -#include "gromacs/analysisdata/analysisdata.h"
  #include "gromacs/analysisdata/paralleloptions.h"
  #include "gromacs/utility/exceptions.h"
  
@@@ -154,7 -151,7 +154,7 @@@ class SimpleInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static SimpleInputData singleton;
              return singleton.data_;
  #else
@@@ -181,7 -178,7 +181,7 @@@ class DataSetsInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static DataSetsInputData singleton;
              return singleton.data_;
  #else
@@@ -216,7 -213,7 +216,7 @@@ class MultipointInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static MultipointInputData singleton;
              return singleton.data_;
  #else
@@@ -253,7 -250,7 +253,7 @@@ class MultipointDataSetsInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static MultipointDataSetsInputData singleton;
              return singleton.data_;
  #else
index 56b73ecedfd6c48c7578e9c09e4beacdce48f22a,184a0ef631f53a15b79f00342a41efcf848479c7..a1d2755bf48e0f57de17e8d7411f7d498f253d62
   * \author Teemu Murtola <teemu.murtola@gmail.com>
   * \ingroup module_analysisdata
   */
 -#include <gtest/gtest.h>
 +#include "gmxpre.h"
  
  #include "gromacs/analysisdata/arraydata.h"
  
 +#include <gtest/gtest.h>
 +
  #include "gromacs/analysisdata/tests/datatest.h"
  #include "testutils/testasserts.h"
  
@@@ -71,7 -69,7 +71,7 @@@ class SimpleInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static SimpleInputData singleton;
              return singleton.data_;
  #else
index cbfc91cd2aa5e8523104ade246b20d579889b1dd,7ee8b775dc3567a87e7757b9fbfa4550d298534f..cdeabbb77d0fa160f0761b1df16d4ba0e9b563b6
   * \author Teemu Murtola <teemu.murtola@gmail.com>
   * \ingroup module_analysisdata
   */
 +#include "gmxpre.h"
 +
 +#include "gromacs/analysisdata/modules/average.h"
 +
  #include <gtest/gtest.h>
  
  #include "gromacs/analysisdata/analysisdata.h"
 -#include "gromacs/analysisdata/modules/average.h"
  
  #include "gromacs/analysisdata/tests/datatest.h"
  #include "testutils/testasserts.h"
@@@ -68,7 -65,7 +68,7 @@@ class SimpleInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static SimpleInputData singleton;
              return singleton.data_;
  #else
@@@ -95,7 -92,7 +95,7 @@@ class MultipointInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static MultipointInputData singleton;
              return singleton.data_;
  #else
@@@ -129,7 -126,7 +129,7 @@@ class MultiDataSetInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static MultiDataSetInputData singleton;
              return singleton.data_;
  #else
index e0ead05854fefac7035d5e10b518682a72ab6ec1,09f41274706c6bc50863b15062b313f33706cdb2..6d85dd6b05c080827daef2ca26cb912b77ab9b2b
  
  #include <gtest/gtest.h>
  
 -#include "gromacs/legacyheaders/types/simple.h"
 -
  #include "gromacs/analysisdata/dataframe.h"
  #include "gromacs/utility/gmxassert.h"
 +#include "gromacs/utility/real.h"
  
  #include "testutils/refdata.h"
  
  // currently the bug manifests itself only in AbstractAnalysisData testing
- #if (defined __ICL && __ICL >= 1400) || (defined __ICC & __ICC >= 1400)
- #define INTEL_STATIC_ANON_NAMESPACE_BUG //see #1558 for details
+ #if (defined __ICL && __ICL >= 1400) || (defined __ICC && __ICC >= 1400) || (defined __PATHSCALE__)
+ #define STATIC_ANON_NAMESPACE_BUG //see #1558 for details
  #endif
  
  namespace gmx
index 491568b49f84ef21bc5ce8924de779e728ef9272,8a4cdacd1dfeee5937bda5630b8dcaaeeae8209b..f210b4b7adba43a839c4afec591959ef1063674f
   * \author Teemu Murtola <teemu.murtola@gmail.com>
   * \ingroup module_analysisdata
   */
 +#include "gmxpre.h"
 +
 +#include "gromacs/analysisdata/modules/histogram.h"
 +
  #include <gtest/gtest.h>
  
  #include "gromacs/analysisdata/analysisdata.h"
 -#include "gromacs/analysisdata/modules/histogram.h"
  
  #include "gromacs/analysisdata/tests/datatest.h"
  #include "testutils/testasserts.h"
@@@ -160,7 -157,7 +160,7 @@@ class SimpleInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static SimpleInputData singleton;
              return singleton.data_;
  #else
@@@ -246,7 -243,7 +246,7 @@@ class WeightedSimpleInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static WeightedSimpleInputData singleton;
              return singleton.data_;
  #else
@@@ -283,7 -280,7 +283,7 @@@ class WeightedDataSetInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static WeightedDataSetInputData singleton;
              return singleton.data_;
  #else
@@@ -455,7 -452,7 +455,7 @@@ class AverageInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static AverageInputData singleton;
              return singleton.data_;
  #else
index 7364b1c7d587211a193a180d36b6429923a6cfb8,52a29833af5b00da307da147e773d97079baac4e..1549d2a89ad54ce65cfa3018c0e23ec2faaa9412
   * \author Teemu Murtola <teemu.murtola@gmail.com>
   * \ingroup module_analysisdata
   */
 +#include "gmxpre.h"
 +
 +#include "gromacs/analysisdata/modules/lifetime.h"
 +
  #include <gtest/gtest.h>
  
  #include "gromacs/analysisdata/analysisdata.h"
 -#include "gromacs/analysisdata/modules/lifetime.h"
  
  #include "gromacs/analysisdata/tests/datatest.h"
  #include "testutils/testasserts.h"
@@@ -67,7 -64,7 +67,7 @@@ class SimpleInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static SimpleInputData singleton;
              return singleton.data_;
  #else
@@@ -94,7 -91,7 +94,7 @@@ class MultiDataSetInputDat
      public:
          static const AnalysisDataTestInput &get()
          {
- #ifndef INTEL_STATIC_ANON_NAMESPACE_BUG
+ #ifndef STATIC_ANON_NAMESPACE_BUG
              static MultiDataSetInputData singleton;
              return singleton.data_;
  #else