From 0fb84fa34b11ef81dd4bef25661420e0a088dbef Mon Sep 17 00:00:00 2001 From: Dan H Date: Mon, 12 Mar 2018 17:03:48 -0400 Subject: [PATCH] Make compilation faster by moving print of git hash. --- lib/util/Init.cc | 7 +------ lib/util/Init.h | 1 + lib/util/version.cc | 12 ++++++++++++ 3 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 lib/util/version.cc diff --git a/lib/util/Init.cc b/lib/util/Init.cc index b4ac14b7..45a37a02 100644 --- a/lib/util/Init.cc +++ b/lib/util/Init.cc @@ -289,12 +289,7 @@ void Grid_init(int *argc,char ***argv) std::cout << "but WITHOUT ANY WARRANTY; without even the implied warranty of"< &simd, std::vector &mpi); + void printHash(void); }; #endif diff --git a/lib/util/version.cc b/lib/util/version.cc new file mode 100644 index 00000000..19759274 --- /dev/null +++ b/lib/util/version.cc @@ -0,0 +1,12 @@ +#include +#include +namespace Grid { + void printHash(){ +#ifdef GITHASH + std::cout << "Current Grid git commit hash=" << GITHASH << std::endl; +#else + std::cout << "Current Grid git commit hash is undefined. Check makefile." << std::endl; +#endif +#undef GITHASH +} +}