diff options
author | Pjotr Prins | 2017-10-26 08:07:28 +0000 |
---|---|---|
committer | Pjotr Prins | 2017-10-26 08:07:28 +0000 |
commit | 3f2ebeba716ccc04f08e4245db4ffbc377c10206 (patch) | |
tree | 566fb7c2b5e8268ebc7d871c2fc88e1ca83c06b3 | |
parent | f9eacf6637b091c794a4692cfd0646c9a5bcf35a (diff) | |
download | pangemma-3f2ebeba716ccc04f08e4245db4ffbc377c10206.tar.gz |
VERSION now contains the GEMMA version number. A script generates a header
file named ./src/version.h. See Makefile for details.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | VERSION | 1 | ||||
-rwxr-xr-x | scripts/gen_version_info.sh | 12 | ||||
-rw-r--r-- | src/gemma.cpp | 5 |
5 files changed, 29 insertions, 7 deletions
@@ -1,6 +1,7 @@ *.o *.tar.gz src/Eigen +src/version.h example/output test/output ./output @@ -38,10 +38,12 @@ # # https://github.com/genetics-statistics/GEMMA/blob/master/INSTALL.md +GEMMA_VERSION = $(shell cat ./VERSION) + # Set this variable to either LNX or MAC SYS = LNX # LNX|MAC (Linux is the default) # Leave blank after "=" to disable; put "= 1" to enable -DIST_NAME = gemma-0.97.3 +DIST_NAME = gemma-$(GEMMA_VERSION) DEBUG = 1 # DEBUG mode, set DEBUG=0 for a release SHOW_COMPILER_WARNINGS = WITH_LAPACK = 1 @@ -132,13 +134,16 @@ ifdef WITH_LAPACK endif endif -HDR = $(wildcard src/*.h) +HDR = $(wildcard src/*.h) ./src/version.h SOURCES = $(wildcard src/*.cpp) # all OBJS = $(SOURCES:.cpp=.o) -all: $(OUTPUT) +./src/version.h: + ./scripts/gen_version_info.sh > src/version.h + +all: ./src/version.h $(OUTPUT) $(OUTPUT): $(OBJS) $(CPP) $(CPPFLAGS) $(OBJS) $(LIBS) -o $(OUTPUT) @@ -173,16 +178,18 @@ check: fast-check slow-check check-all: check lengthy-check clean: + rm $(SRC_DIR)/version.h rm -vf $(SRC_DIR)/*.o rm -vf $(SRC_DIR)/*~ rm -vf $(TEST_SRC_DIR)/*.o rm -vf $(OUTPUT) rm -vf ./bin/unittests-gemma -DIST_COMMON = COPYING.txt README.txt Makefile +DIST_COMMON = *.md LICENSE VERSION Makefile DIST_SUBDIRS = src doc example bin -tar: +tar: version all + @echo "Creating $(DIST_NAME)" mkdir -p ./$(DIST_NAME) cp $(DIST_COMMON) ./$(DIST_NAME)/ cp -r $(DIST_SUBDIRS) ./$(DIST_NAME)/ @@ -0,0 +1 @@ +0.97-pre3 diff --git a/scripts/gen_version_info.sh b/scripts/gen_version_info.sh new file mode 100755 index 0000000..8a9e38d --- /dev/null +++ b/scripts/gen_version_info.sh @@ -0,0 +1,12 @@ +#! /bin/bash +# +# Script to generate the version info of GEMMA and its environment +# in ./src/version.h + +DATE=$(date "+%Y/%m/%d") +YEAR=$(date "+%Y") + +echo // version.h generated by GEMMA $0 +echo \#define GEMMA_VERSION \"$(cat ./VERSION)\" +echo \#define GEMMA_DATE \"$DATE\" +echo \#define GEMMA_YEAR \"$YEAR\" diff --git a/src/gemma.cpp b/src/gemma.cpp index 650ba43..2c54672 100644 --- a/src/gemma.cpp +++ b/src/gemma.cpp @@ -57,10 +57,11 @@ extern "C" { #include "varcov.h" #include "vc.h" #include "debug.h" +#include "version.h" using namespace std; -GEMMA::GEMMA(void) : version("0.97.3"), date("10/10/2017"), year("2017") {} +GEMMA::GEMMA(void) : version(GEMMA_VERSION), date(GEMMA_DATE), year(GEMMA_YEAR) {} void gemma_gsl_error_handler (const char * reason, const char * file, @@ -3103,7 +3104,7 @@ void GEMMA::WriteLog(int argc, char **argv, PARAM &cPar) { } outfile << "##" << endl; - outfile << "## GEMMA Version = " << version << endl; + outfile << "## GEMMA Version = " << version << " (" << date << ")" << endl; outfile << "## GSL Version = " << GSL_VERSION << endl; outfile << "## Eigen Version = " << EIGEN_WORLD_VERSION << "." << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION << endl; #ifdef OPENBLAS |