Provenance.h 988 Bytes
Newer Older
Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
1
2
#ifndef PROVENANCE_H
#define PROVENANCE_H
Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
3
4
#include "../../PsimagLite/src/Version.h"
#include "../Version.h"
Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
5
#include "AllocatorCpu.h"
6
#include <iostream>
Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
7
#include "AnsiColors.h"
8
#include <sstream>
9
#include "../GitRevision.h"
Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
10
11
12
13
14

class Provenance {

public:

Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
15
16
17
	static PsimagLite::String logo(PsimagLite::String appName)
	{
		PsimagLite::OstringStream msg;
Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
18
19
		msg<<appName<<"\x1b[38;5;240m";
		msg<<" [master "<<DMRGPP_VERSION<<"] "<<PsimagLite::AnsiColor::reset;
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
		PsimagLite::String ctOpts("");
#ifdef USE_LONG
		ctOpts += "LONG ";
#endif
#ifdef USE_FLOAT
		ctOpts += "FLOAT ";
#endif
#ifdef USE_SIGNALS
		ctOpts += "SIGNALS ";
#endif
#ifdef USE_GSL
		ctOpts += "GSL ";
#endif
#ifdef USE_BOOST
		ctOpts += "BOOST ";
#endif
Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
36
#ifdef PLUGIN_SC
37
		ctOpts += "PLUGIN_SC ";
Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
38
#endif
39
40
41
42
43
44
#ifndef NDEBUG
		ctOpts += "DEBUG ";
#endif

		if (ctOpts != "")
			msg<<"["<<ctOpts<<"]";
Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
45
46
47

		return msg.str();
	}
Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
48
49
}; // Provenance

50
std::ostream& operator<<(std::ostream& os,const Provenance&);
Alvarez, Gonzalo's avatar
Alvarez, Gonzalo committed
51
52

#endif // PROVENANCE_H
53