Skip to content
Snippets Groups Projects
Commit 75b9fafa authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

fix root build dir initialization

parent 75cf7538
Branches
No related tags found
1 merge request!10Update dis
This commit is part of merge request !10. Comments created here will be created in the context of that merge request.
...@@ -20,6 +20,7 @@ dis:process: ...@@ -20,6 +20,7 @@ dis:process:
needs: ["detector", "dis:generate"] needs: ["detector", "dis:generate"]
timeout: 1 hour timeout: 1 hour
script: script:
- source options/env.sh
- ./util/compile_analyses.py dis - ./util/compile_analyses.py dis
- ./benchmarks/dis/dis.sh --config barrel --ebeam 18 --pbeam 275 - ./benchmarks/dis/dis.sh --config barrel --ebeam 18 --pbeam 275
artifacts: artifacts:
......
...@@ -26,6 +26,7 @@ dvmp:process: ...@@ -26,6 +26,7 @@ dvmp:process:
needs: ["detector", "dvmp:generate"] needs: ["detector", "dvmp:generate"]
timeout: 1 hour timeout: 1 hour
script: script:
- source options/env.sh
- ./util/compile_analyses.py dvmp - ./util/compile_analyses.py dvmp
- ./util/run_many.py ./benchmarks/dvmp/dvmp.sh - ./util/run_many.py ./benchmarks/dvmp/dvmp.sh
-c jpsi_barrel -c jpsi_barrel
......
...@@ -73,7 +73,7 @@ def compile_analyses(benchmark): ...@@ -73,7 +73,7 @@ def compile_analyses(benchmark):
print("Compiling all analyis scripts for '{}'".format(benchmark)) print("Compiling all analyis scripts for '{}'".format(benchmark))
## Ensure our build directory exists ## Ensure our build directory exists
_init_build_dir() _init_build_dir(benchmark)
## Get a list of all analysis scripts ## Get a list of all analysis scripts
_compile_all(benchmark) _compile_all(benchmark)
...@@ -81,13 +81,16 @@ def compile_analyses(benchmark): ...@@ -81,13 +81,16 @@ def compile_analyses(benchmark):
## All done! ## All done!
print('All analyses for', benchmark, 'compiled successfully') print('All analyses for', benchmark, 'compiled successfully')
def _init_build_dir(): def _init_build_dir(benchmark):
'''Initialize our ROOT build directory (if using one).''' '''Initialize our ROOT build directory (if using one).'''
print(' --> Initializing ROOT build directory ...') print(' --> Initializing ROOT build directory ...')
build_dir = os.getenv('ROOT_BUILD_DIR') build_prefix = os.getenv('ROOT_BUILD_DIR')
if build_dir is None: if build_prefix is None:
print(' --> ROOT_BUILD_DIR not set, no action needed.') print(' --> ROOT_BUILD_DIR not set, no action needed.')
return 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)) print(" --> Ensuring directory '{}' exists".format(build_dir))
os.system('mkdir -p {}'.format(build_dir)) os.system('mkdir -p {}'.format(build_dir))
...@@ -109,7 +112,7 @@ def _compile_all(benchmark): ...@@ -109,7 +112,7 @@ def _compile_all(benchmark):
def _compile_cmd(file): def _compile_cmd(file):
'''Return a one-line shell command to compile an analysis script.''' '''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__": if __name__ == "__main__":
args = parser.parse_args() args = parser.parse_args()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment