From 2439999ec85e082a2f3b30c9d7afe624717779a1 Mon Sep 17 00:00:00 2001 From: paboyle Date: Sat, 6 May 2017 14:44:49 +0100 Subject: [PATCH] Warning elimination; drop to -O2 on G++ bad versions --- configure.ac | 7 ++++++- lib/Grid_Eigen_Dense.h | 9 +++++++++ lib/algorithms/iterative/ConjugateGradient.h | 2 -- lib/lattice/Lattice_reduction.h | 2 +- lib/perfmon/PerfCount.h | 5 ++--- lib/qcd/action/fermion/CayleyFermion5D.cc | 2 +- lib/qcd/action/fermion/CayleyFermion5Ddense.cc | 2 +- lib/stencil/Stencil.h | 1 - 8 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 lib/Grid_Eigen_Dense.h diff --git a/configure.ac b/configure.ac index 8f569c57..07c25473 100644 --- a/configure.ac +++ b/configure.ac @@ -14,7 +14,6 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) #AC_REVISION([m4_esyscmd_s([./scripts/configure.commit])]) ############### Checks for programs -CXXFLAGS="-O3 $CXXFLAGS" AC_PROG_CXX AC_PROG_RANLIB @@ -28,6 +27,12 @@ AX_GXX_VERSION AC_DEFINE_UNQUOTED([GXX_VERSION],["$GXX_VERSION"], [version of g++ that will compile the code]) +CXXFLAGS="-O3 $CXXFLAGS" +case ${GXX_VERSION} in + 6.0.0|6.1.0|6.2.0|5.4.1|5.4.0|5.3.0|5.2.0|5.1.0|5.0.0) + CXXFLAGS="-O3 $CXXFLAGS" + ;; +esac ############### Checks for typedefs, structures, and compiler characteristics AC_TYPE_SIZE_T AC_TYPE_UINT32_T diff --git a/lib/Grid_Eigen_Dense.h b/lib/Grid_Eigen_Dense.h new file mode 100644 index 00000000..4fb5b831 --- /dev/null +++ b/lib/Grid_Eigen_Dense.h @@ -0,0 +1,9 @@ +#pragma once +#if defined __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif +#include +#if defined __GNUC__ +#pragma GCC diagnostic pop +#endif diff --git a/lib/algorithms/iterative/ConjugateGradient.h b/lib/algorithms/iterative/ConjugateGradient.h index 704e9e0c..ed453161 100644 --- a/lib/algorithms/iterative/ConjugateGradient.h +++ b/lib/algorithms/iterative/ConjugateGradient.h @@ -135,8 +135,6 @@ class ConjugateGradient : public OperatorFunction { Linop.HermOpAndNorm(psi, mmp, d, qq); p = mmp - src; - RealD mmpnorm = sqrt(norm2(mmp)); - RealD psinorm = sqrt(norm2(psi)); RealD srcnorm = sqrt(norm2(src)); RealD resnorm = sqrt(norm2(p)); RealD true_residual = resnorm / srcnorm; diff --git a/lib/lattice/Lattice_reduction.h b/lib/lattice/Lattice_reduction.h index 1adb229b..7720e97f 100644 --- a/lib/lattice/Lattice_reduction.h +++ b/lib/lattice/Lattice_reduction.h @@ -22,7 +22,7 @@ Author: paboyle #ifndef GRID_LATTICE_REDUCTION_H #define GRID_LATTICE_REDUCTION_H -#include +#include namespace Grid { #ifdef GRID_WARN_SUBOPTIMAL diff --git a/lib/perfmon/PerfCount.h b/lib/perfmon/PerfCount.h index fca80b8d..5e8cb4d0 100644 --- a/lib/perfmon/PerfCount.h +++ b/lib/perfmon/PerfCount.h @@ -205,13 +205,12 @@ public: void Stop(void) { count=0; cycles=0; - size_t ign; #ifdef __linux__ if ( fd!= -1) { ::ioctl(fd, PERF_EVENT_IOC_DISABLE, 0); ::ioctl(cyclefd, PERF_EVENT_IOC_DISABLE, 0); - ign=::read(fd, &count, sizeof(long long)); - ign=::read(cyclefd, &cycles, sizeof(long long)); + ::read(fd, &count, sizeof(long long)); + ::read(cyclefd, &cycles, sizeof(long long)); } elapsed = cyclecount() - begin; #else diff --git a/lib/qcd/action/fermion/CayleyFermion5D.cc b/lib/qcd/action/fermion/CayleyFermion5D.cc index ff814eb6..46ba3793 100644 --- a/lib/qcd/action/fermion/CayleyFermion5D.cc +++ b/lib/qcd/action/fermion/CayleyFermion5D.cc @@ -29,7 +29,7 @@ Author: paboyle *************************************************************************************/ /* END LEGAL */ -#include +#include #include #include diff --git a/lib/qcd/action/fermion/CayleyFermion5Ddense.cc b/lib/qcd/action/fermion/CayleyFermion5Ddense.cc index 6b53d540..4014675a 100644 --- a/lib/qcd/action/fermion/CayleyFermion5Ddense.cc +++ b/lib/qcd/action/fermion/CayleyFermion5Ddense.cc @@ -29,7 +29,7 @@ Author: paboyle *************************************************************************************/ /* END LEGAL */ -#include +#include #include #include diff --git a/lib/stencil/Stencil.h b/lib/stencil/Stencil.h index d1c28e78..05a531fe 100644 --- a/lib/stencil/Stencil.h +++ b/lib/stencil/Stencil.h @@ -106,7 +106,6 @@ class CartesianStencil { // Stencil runs along coordinate axes only; NO diagonal public: typedef CartesianCommunicator::CommsRequest_t CommsRequest_t; - typedef uint32_t StencilInteger; typedef typename cobj::vector_type vector_type; typedef typename cobj::scalar_type scalar_type; typedef typename cobj::scalar_object scalar_object;