From fd25d0cf2e2de6a9ad78ff22b90c2dbf01d9b493 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Sun, 14 May 2023 16:58:55 +0200 Subject: [PATCH] added git version string access in the code --- .gitignore | 1 + Makefile.am | 10 ++++++++-- get_git_version | 14 ++++++++++++++ la.h | 1 + t.cc | 11 ++++++----- version.h | 3 +++ 6 files changed, 33 insertions(+), 7 deletions(-) create mode 100755 get_git_version create mode 100644 version.h diff --git a/.gitignore b/.gitignore index 09e61b9..556c524 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ config.log .libs *.lo libla.la +version.cc t test tX diff --git a/Makefile.am b/Makefile.am index 76e99b7..06a6515 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,13 +1,16 @@ lib_LTLIBRARIES = libla.la -include_HEADERS = simple.h vecmat3.h quaternion.h fortran.h cuda_la.h auxstorage.h davidson.h laerror.h mat.h qsort.h vec.h bisection.h diis.h la.h noncblas.h smat.h bitvector.h fourindex.h la_traits.h nonclass.h sparsemat.h sparsesmat.h csrmat.h conjgrad.h gmres.h matexp.h permutation.h polynomial.h contfrac.h +include_HEADERS = version.h simple.h vecmat3.h quaternion.h fortran.h cuda_la.h auxstorage.h davidson.h laerror.h mat.h qsort.h vec.h bisection.h diis.h la.h noncblas.h smat.h bitvector.h fourindex.h la_traits.h nonclass.h sparsemat.h sparsesmat.h csrmat.h conjgrad.h gmres.h matexp.h permutation.h polynomial.h contfrac.h libla_la_SOURCES = simple.cc quaternion.cc vecmat3.cc vec.cc mat.cc smat.cc sparsemat.cc sparsesmat.cc csrmat.cc laerror.cc noncblas.cc bitvector.cc strassen.cc nonclass.cc cuda_la.cc fourindex.cc permutation.cc polynomial.cc contfrac.cc check_PROGRAMS = t test tX t_SOURCES = t.cc t2.cc +nodist_t_SOURCES = version.cc test_SOURCES = test.cc tX_SOURCES = tX.cc LDADD = .libs/libla.a ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = LICENSE doxygen.cfg aminclude.am acinclude.m4 footer.html +EXTRA_DIST = get_git_version LICENSE doxygen.cfg aminclude.am acinclude.m4 footer.html +CLEANFILES = version.cc +#noinst_PROGRAMS = .cu.o: $(NVCC) -o $@ -c $< $(NVCCFLAGS) @@ -34,4 +37,7 @@ AM_LDFLAGS += $(CUDALIBS) tX_LDFLAGS = $(AM_LDFLAGS) -lX11 -lm +version.cc: + ./get_git_version >>version.cc + include $(top_srcdir)/aminclude.am diff --git a/get_git_version b/get_git_version new file mode 100755 index 0000000..bac42e9 --- /dev/null +++ b/get_git_version @@ -0,0 +1,14 @@ +#!/bin/csh -f +cat < NRIMat; diff --git a/t.cc b/t.cc index 6e00ecb..525164d 100644 --- a/t.cc +++ b/t.cc @@ -132,16 +132,17 @@ sigtraceback(SIGABRT,1); sigtraceback(SIGBUS,1); sigtraceback(SIGFPE,1); - -NRVec x(1.,10); -NRVec y(2.,10); -NRVec z(-2.,10); - //cout.setf(ios::scientific); cc:cout.setf(ios::fixed); cout.precision(10); cin.exceptions ( ifstream::eofbit | ifstream::failbit | ifstream::badbit ); +cout <<"LA version = "< x(1.,10); +NRVec y(2.,10); +NRVec z(-2.,10); + if(0) test(x); diff --git a/version.h b/version.h new file mode 100644 index 0000000..49e07c4 --- /dev/null +++ b/version.h @@ -0,0 +1,3 @@ +namespace LA { +extern const char version[]; +}