diff --git a/src/musrfit.cpp b/src/musrfit.cpp index ad2897f4..e76f6290 100644 --- a/src/musrfit.cpp +++ b/src/musrfit.cpp @@ -91,12 +91,13 @@ void musrfit_syntax() cout << endl << "usage: musrfit [ [-k, --keep-mn2-ouput] [-c, --chisq-only] [-t, --title-from-data-file]"; cout << endl << " [-e, --estimateN0] [-p, --per-run-block-chisq]"; cout << endl << " [--dump ] [--timeout ] |"; - cout << endl << " --nexus-support | --version | --help"; + cout << endl << " --nexus-support | --show-dynamic-path | --version | --help"; cout << endl << " : msr input file"; cout << endl << " 'musrfit ' will execute musrfit"; cout << endl << " 'musrfit' or 'musrfit --help' will show this help"; cout << endl << " 'musrfit --version' will print the musrfit version"; cout << endl << " 'musrfit --nexus-support' will print if NeXus support is available."; + cout << endl << " 'musrfit --show-dynamic-path' will print the internal dynamic library search paths."; cout << endl << " -k, --keep-mn2-output: will rename the files MINUIT2.OUTPUT and "; cout << endl << " MINUIT2.root to -mn2.output and -mn2.root,"; cout << endl << " respectively,"; @@ -457,6 +458,11 @@ int main(int argc, char *argv[]) return PMUSR_WRONG_STARTUP_SYNTAX; } + // add default shared library path /usr/local/lib if not already persent + const char *dsp = gSystem->GetDynamicPath(); + if (strstr(dsp, "/usr/local/lib") == NULL) + gSystem->AddDynamicPath("/usr/local/lib"); + if (argc == 2) { if (!strcmp(argv[1], "--version")) { #ifdef HAVE_CONFIG_H @@ -469,9 +475,13 @@ int main(int argc, char *argv[]) #ifdef PNEXUS_ENABLED cout << endl << ">> musrfit: NeXus support enabled." << endl << endl; #else - cout << endl << ">> musrfit: NeXus support NOT enabled." << endl << endl; + cout << endl << "musrfit: NeXus support NOT enabled." << endl << endl; #endif return PMUSR_SUCCESS; + } else if (!strcmp(argv[1], "--show-dynamic-path")) { + cout << endl << "musrfit: internal dynamic search paths for shared libraries/root dictionaries:"; + cout << endl << " '" << gSystem->GetDynamicPath() << "'" << endl << endl; + return PMUSR_SUCCESS; } else if (!strcmp(argv[1], "--help")) { show_syntax = true; } diff --git a/src/musrt0.cpp b/src/musrt0.cpp index dab51fa7..c260c0fe 100644 --- a/src/musrt0.cpp +++ b/src/musrt0.cpp @@ -57,7 +57,7 @@ using namespace std; void musrt0_syntax() { cout << endl << "usage: musrt0 [{--getT0FromPromptPeak | -g} []]"; - cout << endl << " [--timeout ] | --version | --help"; + cout << endl << " [--timeout ] | --show-dynamic-path | --version | --help"; cout << endl << " : msr input file"; cout << endl << " --getT0FromPromptPeak, -g with :"; cout << endl << " will, in non-interactive mode estimate the t0's from the prompt peak"; @@ -72,6 +72,7 @@ void musrt0_syntax() cout << endl << " 180 sec if not already done so."; cout << endl << " 'musrt0' or 'musrt0 --help' will show this help"; cout << endl << " 'musrt0 --version' will print the musrt0 version"; + cout << endl << " 'musrt0 --show-dynamic-path' dumps the dynamic search paths and exit."; cout << endl << endl; } @@ -228,6 +229,11 @@ Int_t main(Int_t argc, Char_t *argv[]) return PMUSR_SUCCESS; } + // add default shared library path /usr/local/lib if not already persent + const char *dsp = gSystem->GetDynamicPath(); + if (strstr(dsp, "/usr/local/lib") == NULL) + gSystem->AddDynamicPath("/usr/local/lib"); + memset(filename, '\0', sizeof(filename)); for (int i=1; iGetDynamicPath() << "'" << endl << endl; + return PMUSR_SUCCESS; } else if (strstr(argv[i], ".msr")) { // check for filename if (strlen(filename) == 0) { strcpy(filename, argv[i]); diff --git a/src/musrview.cpp b/src/musrview.cpp index 2e0919df..61ad87c7 100644 --- a/src/musrview.cpp +++ b/src/musrview.cpp @@ -62,6 +62,7 @@ void musrview_syntax() cout << endl << " Options:"; cout << endl << " --help : display this help and exit."; cout << endl << " --version : output version information and exit."; + cout << endl << " --show-dynamic-path : dumps the dynamic search paths and exit."; cout << endl << " -f, --fourier: will directly present the Fourier transform of the ."; cout << endl << " -a, --avg: will directly present the averaged data/Fourier of the ."; cout << endl << " --: "; @@ -111,6 +112,11 @@ int main(int argc, char *argv[]) memset(fileName, '\0', sizeof(fileName)); + // add default shared library path /usr/local/lib if not already persent + const char *dsp = gSystem->GetDynamicPath(); + if (strstr(dsp, "/usr/local/lib") == NULL) + gSystem->AddDynamicPath("/usr/local/lib"); + // check input arguments if (argc == 1) { musrview_syntax(); @@ -132,6 +138,10 @@ int main(int argc, char *argv[]) cout << endl << "musrview git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << endl << endl; #endif return PMUSR_SUCCESS; + } else if (!strcmp(argv[i], "--show-dynamic-path")) { + cout << endl << "musrview: internal dynamic search paths for shared libraries/root dictionaries:"; + cout << endl << " '" << gSystem->GetDynamicPath() << "'" << endl << endl; + return PMUSR_SUCCESS; } else if (!strcmp(argv[i], "--help")) { show_syntax = true; break;