-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathConfigure.cc
executable file
·117 lines (81 loc) · 3.01 KB
/
Configure.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
//**.****|****.****|****.****|****.****|****.****|****.****|****.****|****.****|
// * Configure.cc * galprop package * 4/14/2000
//**"****!****"****!****"****!****"****!****"****!****"****!****"****!****"****|
#include <Configure.h>
#include <ErrorLogger.h>
#include <config.h>
#include <iostream>
#include <string>
using namespace std;
using namespace gp;
int Configure::init(const string& galdefDirectory,
const string& fitsDataDirectory,
const string& outputDirectory,
const string& outputPrefix) {
INFO("Entry");
#ifdef VERSION
const string fullVersion = VERSION;
#else
const string fullVersion = "54.0.0";
#endif
ostringstream bufV;
bufV << "This is Galprop version " << fullVersion;
INFO(bufV.str());
// pre-r151
// char version[]="53"; //AWS 20070820
// for changes from r151, new version defined at r158
//char version[]="54"; //AWS 20080618
const string majorVersion = fullVersion.substr(0, fullVersion.find_first_of("."));
const string tmpVer = fullVersion.substr(fullVersion.find_first_of(".")+1, fullVersion.size()-1);
const string minorVersion = tmpVer.substr(0, tmpVer.find_first_of("."));
const string revision = tmpVer.substr(tmpVer.find_first_of(".")+1, tmpVer.size()-1);
//cout << majorVersion << " " << minorVersion << " " << revision << endl;
// Check for overrides. Otherwise grab whatever comes from the
// autoconfiguration, and if that fails use the stupid defaults we've
// always had
string galdefDir = galdefDirectory, fitsDir = fitsDataDirectory, outputDir = outputDirectory;
if (galdefDir.empty()) {
#ifdef HAVE_GALDEF
galdefDir = GALDEF_PATH;
#else
galdefDir = "../GALDEF";
#endif
}
if (fitsDir.empty()) {
#ifdef HAVE_FITSDATA
fitsDir = FITSDATA_PATH;
#else
fitsDir = "../FITS";
#endif
}
if (outputDir.empty()) {
#ifdef HAVE_FITSDATA
outputDir = FITSDATA_PATH;
#else
outputDir = "../FITS"; // *sigh*
#endif
}
//directory_length=100;
//galdef_directory=new char[directory_length];
//fits_directory=new char[directory_length];
//adjunct_directory=new char[directory_length];
//strcpy(galdef_directory, "../GALDEF/");
//strcpy( fits_directory, "../FITS/" );
//strcpy(adjunct_directory,"../adjunct/" );
fGaldefDirectory = galdefDir + "/";
fFITSDataDirectory = fitsDir + "/";
fOutputDirectory = outputDir + "/";
fOutputPrefix = outputPrefix;
fVersion = majorVersion;
fGlobalDataPath = DATA_PATH;
//cout << fFITSDataDirectory << " " << fOutputDirectory << " " << fOutputPrefix << " " << fGaldefDirectory << " " << fGlobalDataPath << endl;
//galdef_directory = galdefDirectory;//"../GALDEF/";
//fits_directory = fitsDataDirectory;//"../FITS/";
//adjunct_directory = "../adjunct/";
//cout<<"Configure: galdef_directory: "<< galdef_directory<<endl;
//cout<<"Configure: fits_directory: "<< fits_directory<<endl;
//cout<<"Configure:adjunct_directory: "<<adjunct_directory<<endl;
//cout<<"<<<<Configure"<<endl;
INFO("Exit");
return 0;
}