From ea9aef7baaa62f2ccbe60fb7620fd786a60a92b6 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Tue, 2 May 2017 18:26:11 +0100 Subject: [PATCH 1/5] New header for standard headers (was an issue with Remez.h and external compilation) --- lib/GridCore.h | 23 +---------------------- lib/GridStd.h | 27 +++++++++++++++++++++++++++ lib/algorithms/approx/Remez.h | 2 +- 3 files changed, 29 insertions(+), 23 deletions(-) create mode 100644 lib/GridStd.h diff --git a/lib/GridCore.h b/lib/GridCore.h index 26fbc1b9..55396a37 100644 --- a/lib/GridCore.h +++ b/lib/GridCore.h @@ -38,28 +38,7 @@ Author: paboyle #ifndef GRID_BASE_H #define GRID_BASE_H -/////////////////// -// Std C++ dependencies -/////////////////// -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////// -// Grid headers -/////////////////// -#include "Config.h" +#include #include #include diff --git a/lib/GridStd.h b/lib/GridStd.h new file mode 100644 index 00000000..fb5e5b21 --- /dev/null +++ b/lib/GridStd.h @@ -0,0 +1,27 @@ +#ifndef GRID_STD_H +#define GRID_STD_H + +/////////////////// +// Std C++ dependencies +/////////////////// +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////// +// Grid config +/////////////////// +#include "Config.h" + +#endif /* GRID_STD_H */ diff --git a/lib/algorithms/approx/Remez.h b/lib/algorithms/approx/Remez.h index 31938779..71b1093b 100644 --- a/lib/algorithms/approx/Remez.h +++ b/lib/algorithms/approx/Remez.h @@ -16,7 +16,7 @@ #define INCLUDED_ALG_REMEZ_H #include -#include +#include #ifdef HAVE_LIBGMP #include "bigfloat.h" From 89c430136ded04442c4ea5328564dc27ca1d4e3d Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Tue, 2 May 2017 19:13:13 +0100 Subject: [PATCH 2/5] grid-config program --- Makefile.am | 2 ++ configure.ac | 13 ++++++++- grid-config.in | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100755 grid-config.in diff --git a/Makefile.am b/Makefile.am index d3401c48..1a75f2eb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,8 @@ SUBDIRS = lib benchmarks tests extras include $(top_srcdir)/doxygen.inc +bin_SCRIPTS=grid-config + tests: all $(MAKE) -C tests tests diff --git a/configure.ac b/configure.ac index 81d38ae9..997aac6d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.63]) -AC_INIT([Grid], [0.6.0], [https://github.com/paboyle/Grid], [Grid]) +AC_INIT([Grid], [0.6.0-dev], [https://github.com/paboyle/Grid], [Grid]) AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET @@ -403,12 +403,23 @@ DX_INIT_DOXYGEN([$PACKAGE_NAME], [doxygen.cfg]) ############### Ouput cwd=`pwd -P`; cd ${srcdir}; abs_srcdir=`pwd -P`; cd ${cwd} +GRID_CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS" +GRID_LDFLAGS="$AM_LDFLAGS $LDFLAGS" +GRID_LIBS=$LIBS +GRID_SHA=`git rev-parse HEAD` +GRID_BRANCH=`git rev-parse --abbrev-ref HEAD` AM_CXXFLAGS="-I${abs_srcdir}/include $AM_CXXFLAGS" AM_CFLAGS="-I${abs_srcdir}/include $AM_CFLAGS" AM_LDFLAGS="-L${cwd}/lib $AM_LDFLAGS" AC_SUBST([AM_CFLAGS]) AC_SUBST([AM_CXXFLAGS]) AC_SUBST([AM_LDFLAGS]) +AC_SUBST([GRID_CXXFLAGS]) +AC_SUBST([GRID_LDFLAGS]) +AC_SUBST([GRID_LIBS]) +AC_SUBST([GRID_SHA]) +AC_SUBST([GRID_BRANCH]) +AC_CONFIG_FILES([grid-config], [chmod +x grid-config]) AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(lib/Makefile) AC_CONFIG_FILES(tests/Makefile) diff --git a/grid-config.in b/grid-config.in new file mode 100755 index 00000000..2f90cad0 --- /dev/null +++ b/grid-config.in @@ -0,0 +1,74 @@ +#! /bin/sh + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ + +usage() +{ + cat < Date: Tue, 2 May 2017 19:40:47 +0100 Subject: [PATCH 3/5] Config summary saved in git-config --- configure.ac | 40 +++++++++++++++++++++++----------------- grid-config.in | 7 +++++++ 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index 997aac6d..d05d6e9c 100644 --- a/configure.ac +++ b/configure.ac @@ -419,23 +419,6 @@ AC_SUBST([GRID_LDFLAGS]) AC_SUBST([GRID_LIBS]) AC_SUBST([GRID_SHA]) AC_SUBST([GRID_BRANCH]) -AC_CONFIG_FILES([grid-config], [chmod +x grid-config]) -AC_CONFIG_FILES(Makefile) -AC_CONFIG_FILES(lib/Makefile) -AC_CONFIG_FILES(tests/Makefile) -AC_CONFIG_FILES(tests/IO/Makefile) -AC_CONFIG_FILES(tests/core/Makefile) -AC_CONFIG_FILES(tests/debug/Makefile) -AC_CONFIG_FILES(tests/forces/Makefile) -AC_CONFIG_FILES(tests/hadrons/Makefile) -AC_CONFIG_FILES(tests/hmc/Makefile) -AC_CONFIG_FILES(tests/solver/Makefile) -AC_CONFIG_FILES(tests/qdpxx/Makefile) -AC_CONFIG_FILES(tests/testu01/Makefile) -AC_CONFIG_FILES(benchmarks/Makefile) -AC_CONFIG_FILES(extras/Makefile) -AC_CONFIG_FILES(extras/Hadrons/Makefile) -AC_OUTPUT echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Summary of configuration for $PACKAGE v$VERSION @@ -467,6 +450,29 @@ LDFLAGS: LIBS: `echo ${LIBS} | tr ' ' '\n' | sed 's/^-/ -/g'` -------------------------------------------------------" > config.summary + +GRID_SUMMARY="`cat config.summary`" +AM_SUBST_NOTMAKE([GRID_SUMMARY]) +AC_SUBST([GRID_SUMMARY]) + +AC_CONFIG_FILES([grid-config], [chmod +x grid-config]) +AC_CONFIG_FILES(Makefile) +AC_CONFIG_FILES(lib/Makefile) +AC_CONFIG_FILES(tests/Makefile) +AC_CONFIG_FILES(tests/IO/Makefile) +AC_CONFIG_FILES(tests/core/Makefile) +AC_CONFIG_FILES(tests/debug/Makefile) +AC_CONFIG_FILES(tests/forces/Makefile) +AC_CONFIG_FILES(tests/hadrons/Makefile) +AC_CONFIG_FILES(tests/hmc/Makefile) +AC_CONFIG_FILES(tests/solver/Makefile) +AC_CONFIG_FILES(tests/qdpxx/Makefile) +AC_CONFIG_FILES(tests/testu01/Makefile) +AC_CONFIG_FILES(benchmarks/Makefile) +AC_CONFIG_FILES(extras/Makefile) +AC_CONFIG_FILES(extras/Hadrons/Makefile) +AC_OUTPUT + echo "" cat config.summary echo "" diff --git a/grid-config.in b/grid-config.in index 2f90cad0..45779c43 100755 --- a/grid-config.in +++ b/grid-config.in @@ -15,6 +15,7 @@ Known values for OPTION are: --cxxflags print pre-processor and compiler flags --ldflags print library linking flags --libs print library linking information + --summary full build summary --help display this help and exit --version output version information @@ -63,6 +64,12 @@ while test $# -gt 0; do echo @GRID_LIBS@ ;; + --summary) + echo "" + echo "@GRID_SUMMARY@" + echo "" + ;; + *) usage exit 1 From 124bf4d829dbd72cafe0bbbd58169767893c57c8 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Tue, 2 May 2017 19:41:01 +0100 Subject: [PATCH 4/5] git ref in config summary --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.ac b/configure.ac index d05d6e9c..b1f3e69d 100644 --- a/configure.ac +++ b/configure.ac @@ -406,6 +406,7 @@ cwd=`pwd -P`; cd ${srcdir}; abs_srcdir=`pwd -P`; cd ${cwd} GRID_CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS" GRID_LDFLAGS="$AM_LDFLAGS $LDFLAGS" GRID_LIBS=$LIBS +GRID_SHORT_SHA=`git rev-parse --short HEAD` GRID_SHA=`git rev-parse HEAD` GRID_BRANCH=`git rev-parse --abbrev-ref HEAD` AM_CXXFLAGS="-I${abs_srcdir}/include $AM_CXXFLAGS" @@ -423,6 +424,7 @@ AC_SUBST([GRID_BRANCH]) echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Summary of configuration for $PACKAGE v$VERSION ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +git: $GRID_BRANCH $GRID_SHORT_SHA ----- PLATFORM ---------------------------------------- architecture (build) : $build_cpu os (build) : $build_os From 58299b8ba29e568411bdebac23f7fb80dd58aeff Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Tue, 2 May 2017 20:04:41 +0100 Subject: [PATCH 5/5] Git info separated from version in git-config --- grid-config.in | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/grid-config.in b/grid-config.in index 45779c43..bd340846 100755 --- a/grid-config.in +++ b/grid-config.in @@ -15,9 +15,10 @@ Known values for OPTION are: --cxxflags print pre-processor and compiler flags --ldflags print library linking flags --libs print library linking information - --summary full build summary + --summary print full build summary --help display this help and exit --version output version information + --git print git revision EOF @@ -43,8 +44,12 @@ while test $# -gt 0; do ;; --version) - echo v@VERSION@ - echo "(@GRID_BRANCH@ @GRID_SHA@)" + echo @VERSION@ + exit 0 + ;; + + --git) + echo "@GRID_BRANCH@ @GRID_SHA@" exit 0 ;; @@ -65,7 +70,7 @@ while test $# -gt 0; do ;; --summary) - echo "" + echo "" echo "@GRID_SUMMARY@" echo "" ;;