diff --git a/benchmarks/dis/config.yml b/benchmarks/dis/config.yml index fedc4229ca7da86e898e46d06e6a2e81a59391f2..6331fd56f4bde5000a7108c53c1296ccf7df4831 100644 --- a/benchmarks/dis/config.yml +++ b/benchmarks/dis/config.yml @@ -20,6 +20,7 @@ dis:process: needs: ["detector", "dis:generate"] timeout: 1 hour script: + - source options/env.sh - ./util/compile_analyses.py dis - ./benchmarks/dis/dis.sh --config barrel --ebeam 18 --pbeam 275 artifacts: diff --git a/benchmarks/dvmp/config.yml b/benchmarks/dvmp/config.yml index c3056c05a4d12c7ac39032cbaae28fb91a930be8..941bafd42481774bee08e8d6017051b5777926ce 100644 --- a/benchmarks/dvmp/config.yml +++ b/benchmarks/dvmp/config.yml @@ -26,6 +26,7 @@ dvmp:process: needs: ["detector", "dvmp:generate"] timeout: 1 hour script: + - source options/env.sh - ./util/compile_analyses.py dvmp - ./util/run_many.py ./benchmarks/dvmp/dvmp.sh -c jpsi_barrel diff --git a/util/compile_analyses.py b/util/compile_analyses.py index d24783c7efc28dd23489cce5380d19d09ad345f1..153f2ea2f61429b6864a21b3ad625e6b53373ba3 100755 --- a/util/compile_analyses.py +++ b/util/compile_analyses.py @@ -73,7 +73,7 @@ def compile_analyses(benchmark): print("Compiling all analyis scripts for '{}'".format(benchmark)) ## Ensure our build directory exists - _init_build_dir() + _init_build_dir(benchmark) ## Get a list of all analysis scripts _compile_all(benchmark) @@ -81,13 +81,16 @@ def compile_analyses(benchmark): ## All done! print('All analyses for', benchmark, 'compiled successfully') -def _init_build_dir(): +def _init_build_dir(benchmark): '''Initialize our ROOT build directory (if using one).''' print(' --> Initializing ROOT build directory ...') - build_dir = os.getenv('ROOT_BUILD_DIR') - if build_dir is None: + build_prefix = os.getenv('ROOT_BUILD_DIR') + if build_prefix is None: print(' --> ROOT_BUILD_DIR not set, no action needed.') return + ## deduce the root build directory + pwd = os.getenv('PWD') + build_dir = '{}/{}/{}'.format(build_prefix, pwd, ANALYSIS_PATH.format(benchmark)) print(" --> Ensuring directory '{}' exists".format(build_dir)) os.system('mkdir -p {}'.format(build_dir)) @@ -109,7 +112,7 @@ def _compile_all(benchmark): def _compile_cmd(file): '''Return a one-line shell command to compile an analysis script.''' - return r'bash -c "source options/env.sh && root -q -b -e \".L {}+\""'.format(file) + return r'bash -c "root -q -b -e \".L {}+\""'.format(file) if __name__ == "__main__": args = parser.parse_args()