Skip to content

Commit

Permalink
include submodule git versions into log files
Browse files Browse the repository at this point in the history
  • Loading branch information
shajoezhu committed Oct 16, 2018
1 parent b236861 commit c44a98c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DEPLOIDVERSION = $(shell git show HEAD | head -1 | sed -e "s/commit //g" | cat)
LASSOVERSION = $(shell git submodule status | grep DEploid-Lasso-lib | sed -e "s/ //g" -e "s/DEploid.*//" | cat)
EXTRA_DIST = bootstrap \
$(top_srcdir)/utilities/dataExplore.r \
$(top_srcdir)/utilities/interpretDEploid.r \
Expand All @@ -15,7 +16,7 @@ TESTS = unit_tests io_unit_tests
check_PROGRAMS = unit_tests dEploid_dbg dEploid_prof io_unit_tests
PROG = DEPLOID

common_flags = -std=c++0x -Isrc/ -Isrc/codeCogs/ -Isrc/random/ -Isrc/gzstream/ -Isrc/lasso/ -DDEPLOIDVERSION=\"${DEPLOIDVERSION}\" -DCOMPILEDATE=\"${COMPILEDATE}\"
common_flags = -std=c++0x -Isrc/ -Isrc/codeCogs/ -Isrc/random/ -Isrc/gzstream/ -Isrc/lasso/ -DDEPLOIDVERSION=\"${DEPLOIDVERSION}\" -DLASSOVERSION=\"${LASSOVERSION}\" -DCOMPILEDATE=\"${COMPILEDATE}\"
common_LDADD = -lz

common_src = src/random/fastfunc.cpp \
Expand Down
2 changes: 1 addition & 1 deletion src/dEploid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) {
dEploidIO.setDoUpdateProp(false);
delete ibdMcmcSample;
}
if (dEploidIO.useIbdOnly() == false){
if (dEploidIO.useIbdOnly() == false) {
McmcSample * mcmcSample = new McmcSample();
MersenneTwister rg(dEploidIO.randomSeed());

Expand Down
11 changes: 10 additions & 1 deletion src/dEploidIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ void DEploidIO::init() {
#else
dEploidGitVersion_ = "";
#endif

#ifdef DEPLOIDVERSION
lassoGitVersion_ = LASSOVERSION;
#else
lassoGitVersion_ = "";
#endif


}


Expand Down Expand Up @@ -567,7 +575,8 @@ void DEploidIO::printVersion(std::ostream& out) {
out << endl
<< "dEploid " << VERSION
<< endl
<< "Git commit: " << dEploidGitVersion_ << endl;
<< "Git commit (DEploid): " << dEploidGitVersion_ << endl
<< "Git commit (Lasso): " << lassoGitVersion_ << endl;
}

void DEploidIO::printHelp(std::ostream& out) {
Expand Down
1 change: 1 addition & 0 deletions src/dEploidIO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ class DEploidIO{

// Output stream
string dEploidGitVersion_;
string lassoGitVersion_;
string compileTime_;
string strExportLLK;
string strExportHap;
Expand Down
1 change: 1 addition & 0 deletions src/export/dEploidIOExport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ void DEploidIO::writeLog ( ostream * writeTo ){
(*writeTo) << "\n";
(*writeTo) << "Program was compiled on: " << compileTime_ << endl;
(*writeTo) << "dEploid version: " << dEploidGitVersion_ << endl;
(*writeTo) << "lasso version: " << lassoGitVersion_ << endl;
(*writeTo) << "\n";
(*writeTo) << "Input data: \n";
if (panelFileName_.size() > 0){
Expand Down

0 comments on commit c44a98c

Please sign in to comment.