From 3d4de595c726abe81366eb0c58d30c72b8515e63 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck <wdconinc@gmail.com> Date: Fri, 30 Jun 2023 13:08:40 +0000 Subject: [PATCH] feat: eic-spack dd4hep-pr1080 --- containers/jug/setup_detectors.py | 49 ++++++++++++++++++++++--------- detectors.yaml | 26 ++++++++++++++++ eic-spack.sh | 2 +- 3 files changed, 62 insertions(+), 15 deletions(-) diff --git a/containers/jug/setup_detectors.py b/containers/jug/setup_detectors.py index 11beda567..c9389cc0d 100755 --- a/containers/jug/setup_detectors.py +++ b/containers/jug/setup_detectors.py @@ -84,22 +84,43 @@ if __name__ == '__main__': data_dir = '{}/share/{}'.format(prefix, det) ## build and install print(' - {}-{}'.format(det, cfg['version'])) - ## clone/build/install detector libraries - cmd = ['rm -rf /tmp/build /tmp/det', - '&&', - 'git clone --depth 1 -b {version} {repo_grp}/{detector}.git /tmp/det'.format( - version=cfg['version'], - repo_grp=DETECTOR_REPO_GROUP, - detector=det), - '&&', - 'cmake -B /tmp/build -S /tmp/det -DCMAKE_CXX_STANDARD=17', - '-DCMAKE_CXX_FLAGS="-Wno-psabi"', - '-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache', - '-DCMAKE_INSTALL_PREFIX={prefix}'.format(prefix=prefix), - '&&', - 'cmake --build /tmp/build -j$(($(($(nproc)/4))+1)) -- install'] + ## cleanup + cmd = ['rm -rf /tmp/build /tmp/det'] + print(' '.join(cmd)) + subprocess.check_call(' '.join(cmd), shell=True) + ## clone + cmd = [ + 'git clone --depth 1 -b {version} {repo_grp}/{detector}.git /tmp/det'.format( + version=cfg['version'], + repo_grp=DETECTOR_REPO_GROUP, + detector=det) + ] print(' '.join(cmd)) subprocess.check_call(' '.join(cmd), shell=True) + ## patches + if cfg.get('patches'): + for patch in cfg['patches']: + cmd = [f'curl -L {patch} | patch -p1 -d/tmp/det'] + print(' '.join(cmd)) + subprocess.check_call(' '.join(cmd), shell=True) + ## build + cxxflags = '' + if cfg.get('cxxflags'): + cxxflags = cfg['cxxflags'] + cmd = [ + f'cmake -B /tmp/build -S /tmp/det -DCMAKE_CXX_STANDARD=17', + f'-DCMAKE_CXX_FLAGS="-Wno-psabi {cxxflags}"', + f'-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache', + f'-DCMAKE_INSTALL_PREFIX={prefix}' + ] + print(' '.join(cmd)) + subprocess.check_call(' '.join(cmd), shell=True) + ## install + cmd = [ + 'cmake --build /tmp/build -j$(($(($(nproc)/4))+1)) -- install' + ] + print(' '.join(cmd)) + subprocess.check_output(' '.join(cmd), shell=True) ## write version info to jug_info if available if os.path.exists('/etc/jug_info'): cmd = ['cd /tmp/det', diff --git a/detectors.yaml b/detectors.yaml index 460193d89..c9082d961 100644 --- a/detectors.yaml +++ b/detectors.yaml @@ -3,21 +3,47 @@ detectors: nightly: default: true version: main + cxxflags: -DDD4HEP_FIELD_TYPE_OVERRIDE=field_type main: version: main + cxxflags: -DDD4HEP_FIELD_TYPE_OVERRIDE=field_type 22.12.0: version: 22.12.0 + patches: + - https://github.com/eic/epic/pull/449.patch + cxxflags: -DDD4HEP_FIELD_TYPE_OVERRIDE=field_type 23.01.0: version: 23.01.0 + patches: + - https://github.com/eic/epic/pull/449.patch + cxxflags: -DDD4HEP_FIELD_TYPE_OVERRIDE=field_type 23.03.0: version: 23.03.0 + patches: + - https://github.com/eic/epic/pull/449.patch + cxxflags: -DDD4HEP_FIELD_TYPE_OVERRIDE=field_type 23.05.0: version: 23.05.0 + patches: + - https://github.com/eic/epic/pull/449.patch + cxxflags: -DDD4HEP_FIELD_TYPE_OVERRIDE=field_type 23.05.1: version: 23.05.1 + patches: + - https://github.com/eic/epic/pull/449.patch + cxxflags: -DDD4HEP_FIELD_TYPE_OVERRIDE=field_type 23.05.2: version: 23.05.2 + patches: + - https://github.com/eic/epic/pull/449.patch + cxxflags: -DDD4HEP_FIELD_TYPE_OVERRIDE=field_type 23.06.0: version: 23.06.0 + patches: + - https://github.com/eic/epic/pull/449.patch + cxxflags: -DDD4HEP_FIELD_TYPE_OVERRIDE=field_type 23.06.1: version: 23.06.1 + patches: + - https://github.com/eic/epic/pull/449.patch + cxxflags: -DDD4HEP_FIELD_TYPE_OVERRIDE=field_type diff --git a/eic-spack.sh b/eic-spack.sh index 587b52fec..5408667df 100644 --- a/eic-spack.sh +++ b/eic-spack.sh @@ -3,7 +3,7 @@ EICSPACK_ORGREPO="eic/eic-spack" ## EIC spack github version, e.g. v0.19.7 or commit hash ## note: nightly builds will use e.g. releases/v0.19 -EICSPACK_VERSION="v0.20.3" +EICSPACK_VERSION="v0.20.4" ## Space-separated list of eic-spack cherry-picks read -r -d '' EICSPACK_CHERRYPICKS <<- \ -- GitLab