Skip to content
Snippets Groups Projects
Commit 9b63651d authored by Brad Sawatzky's avatar Brad Sawatzky
Browse files

ROOT build_dir fix/workaround

- Set the default build_dir to be under $PWD instead of $HOME
  - should work better under a group account (with different personal
    directories)

- Make the ROOT build process use a flat build directory by setting
  second arg to kTRUE in gSystem->SetBuildDir()
  - This avoids an apparent race condition in ROOT associated with child
    directory creation in the default 'kFALSE' mode.
  - The default mode will work correctly on the 2nd execution since the
    child directories are created, ROOT just doesn't notice in time.
    This would be fine for interactive use, but not great for the Farm
    environment, hence the change.
  - The flat build_dir namesapce does open a different corner-case
    of course.  However, I think this is an unlikely condition.
    Things would be pretty broken/strange for two different scripts with
    the same basename (but different internal code) to be compiled and
    loaded without some significant warnings/errors anyway (famous last
    words...)
parent b6d7f9b9
No related branches found
No related tags found
1 merge request!19ROOT build_dir fix/workaround
......@@ -7,9 +7,9 @@ void _rootlogon() {
// check if we requested a special build directory through the environment,
const char* build_dir_from_env = gSystem->Getenv("ROOT_BUILD_TMPDIR");
const std::string build_dir = build_dir_from_env ? build_dir_from_env : "$HOME/.root_build_dir";
const std::string build_dir = build_dir_from_env ? build_dir_from_env : "$PWD/.root_build_dir";
// ensure the build directory exists to avoid crashes due a directory
// ensure the build directory exists to avoid crashes due to it missing
// note: in principle this allows us to execute arbitrary code, but seeing
// as this can only be manipulated through the shell environment in the
// first place this should not be a safety concern.
......@@ -18,7 +18,12 @@ void _rootlogon() {
// Communicate what build directory we are using
std::cout << "---> Setting ACLiC build directory to: " << build_dir << "\n\n";
gSystem->SetBuildDir(build_dir.c_str());
// Make the ROOT build process use a flat build directory by setting
// second arg to kTRUE. This avoids an apparent race condition in ROOT
// associated with child directory creation in the default 'kFALSE' mode.
// The default mode will work correctly on the 2nd execution. OK for
// interactive use, but not great for the Farm environment.
gSystem->SetBuildDir(build_dir.c_str(), kTRUE);
// Ensure we have our environment setup
gROOT->ProcessLine(".include /usr/local/include/hcana");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment