added git version string access in the code
This commit is contained in:
parent
e1757c6d30
commit
fd25d0cf2e
1
.gitignore
vendored
1
.gitignore
vendored
@ -49,6 +49,7 @@ config.log
|
|||||||
.libs
|
.libs
|
||||||
*.lo
|
*.lo
|
||||||
libla.la
|
libla.la
|
||||||
|
version.cc
|
||||||
t
|
t
|
||||||
test
|
test
|
||||||
tX
|
tX
|
||||||
|
10
Makefile.am
10
Makefile.am
@ -1,13 +1,16 @@
|
|||||||
lib_LTLIBRARIES = libla.la
|
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
|
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
|
check_PROGRAMS = t test tX
|
||||||
t_SOURCES = t.cc t2.cc
|
t_SOURCES = t.cc t2.cc
|
||||||
|
nodist_t_SOURCES = version.cc
|
||||||
test_SOURCES = test.cc
|
test_SOURCES = test.cc
|
||||||
tX_SOURCES = tX.cc
|
tX_SOURCES = tX.cc
|
||||||
LDADD = .libs/libla.a
|
LDADD = .libs/libla.a
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
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:
|
.cu.o:
|
||||||
$(NVCC) -o $@ -c $< $(NVCCFLAGS)
|
$(NVCC) -o $@ -c $< $(NVCCFLAGS)
|
||||||
@ -34,4 +37,7 @@ AM_LDFLAGS += $(CUDALIBS)
|
|||||||
|
|
||||||
tX_LDFLAGS = $(AM_LDFLAGS) -lX11 -lm
|
tX_LDFLAGS = $(AM_LDFLAGS) -lX11 -lm
|
||||||
|
|
||||||
|
version.cc:
|
||||||
|
./get_git_version >>version.cc
|
||||||
|
|
||||||
include $(top_srcdir)/aminclude.am
|
include $(top_srcdir)/aminclude.am
|
||||||
|
14
get_git_version
Executable file
14
get_git_version
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/csh -f
|
||||||
|
cat <<!
|
||||||
|
#include "version.h"
|
||||||
|
const char LA::version[] =
|
||||||
|
!
|
||||||
|
echo -n '"'
|
||||||
|
echo -n `git describe`
|
||||||
|
echo -n ' HEAD commit = '
|
||||||
|
set head=`git rev-parse HEAD`
|
||||||
|
echo -n $head
|
||||||
|
echo -n ' dated '
|
||||||
|
echo -n `git show -s --format=%ci $head`
|
||||||
|
echo -n '"'
|
||||||
|
echo ';'
|
1
la.h
1
la.h
@ -43,6 +43,7 @@
|
|||||||
#include "vec.h"
|
#include "vec.h"
|
||||||
#include "polynomial.h"
|
#include "polynomial.h"
|
||||||
#include "contfrac.h"
|
#include "contfrac.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
using namespace LA;
|
using namespace LA;
|
||||||
typedef NRMat<int> NRIMat;
|
typedef NRMat<int> NRIMat;
|
||||||
|
11
t.cc
11
t.cc
@ -132,16 +132,17 @@ sigtraceback(SIGABRT,1);
|
|||||||
sigtraceback(SIGBUS,1);
|
sigtraceback(SIGBUS,1);
|
||||||
sigtraceback(SIGFPE,1);
|
sigtraceback(SIGFPE,1);
|
||||||
|
|
||||||
|
|
||||||
NRVec<double> x(1.,10);
|
|
||||||
NRVec<double> y(2.,10);
|
|
||||||
NRVec<double> z(-2.,10);
|
|
||||||
|
|
||||||
//cout.setf(ios::scientific);
|
//cout.setf(ios::scientific);
|
||||||
cc:cout.setf(ios::fixed);
|
cc:cout.setf(ios::fixed);
|
||||||
cout.precision(10);
|
cout.precision(10);
|
||||||
cin.exceptions ( ifstream::eofbit | ifstream::failbit | ifstream::badbit );
|
cin.exceptions ( ifstream::eofbit | ifstream::failbit | ifstream::badbit );
|
||||||
|
|
||||||
|
cout <<"LA version = "<<LA::version<<endl;
|
||||||
|
|
||||||
|
NRVec<double> x(1.,10);
|
||||||
|
NRVec<double> y(2.,10);
|
||||||
|
NRVec<double> z(-2.,10);
|
||||||
|
|
||||||
|
|
||||||
if(0) test(x);
|
if(0) test(x);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user