Implement some PATH-setting-workaround for msr2data in order to offer an easy way to find the executables (through MUSRFITPATH)
This commit is contained in:
parent
0d4dc340ad
commit
d722b018c3
@ -39,6 +39,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
@ -500,8 +501,16 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// and do the fitting
|
// and do the fitting
|
||||||
if (!onlyInputCreation) {
|
if (!onlyInputCreation) {
|
||||||
|
// check if MUSRFITPATH is set, if not issue a warning
|
||||||
|
string path(getenv("MUSRFITPATH"));
|
||||||
|
if (path.empty()) {
|
||||||
|
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!" << endl;
|
||||||
|
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
||||||
|
} else {
|
||||||
|
path.append("/");
|
||||||
|
}
|
||||||
ostringstream oss;
|
ostringstream oss;
|
||||||
oss << "musrfit" << " " << strInfile.str() << " " << musrfitOptions;
|
oss << path << "musrfit" << " " << strInfile.str() << " " << musrfitOptions;
|
||||||
cout << endl << ">> msr2data: **INFO** Calling " << oss.str() << endl;
|
cout << endl << ">> msr2data: **INFO** Calling " << oss.str() << endl;
|
||||||
system(oss.str().c_str());
|
system(oss.str().c_str());
|
||||||
}
|
}
|
||||||
@ -572,8 +581,16 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// and do the fitting
|
// and do the fitting
|
||||||
if (!onlyInputCreation) {
|
if (!onlyInputCreation) {
|
||||||
|
// check if MUSRFITPATH is set, if not issue a warning
|
||||||
|
string path(getenv("MUSRFITPATH"));
|
||||||
|
if (path.empty()) {
|
||||||
|
cerr << endl << ">> msr2data: **WARNING** The MUSRFITPATH environment variable is not set!" << endl;
|
||||||
|
cerr << endl << ">> msr2data: **WARNING** Please set it or at least ensure that musrfit can be found on the PATH!" << endl;
|
||||||
|
} else {
|
||||||
|
path.append("/");
|
||||||
|
}
|
||||||
ostringstream oss;
|
ostringstream oss;
|
||||||
oss << "musrfit" << " " << strInfile.str() << " " << musrfitOptions;
|
oss << path << "musrfit" << " " << strInfile.str() << " " << musrfitOptions;
|
||||||
cout << endl << ">> msr2data: **INFO** Calling " << oss.str() << endl;
|
cout << endl << ">> msr2data: **INFO** Calling " << oss.str() << endl;
|
||||||
system(oss.str().c_str());
|
system(oss.str().c_str());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user