Skip to content
Snippets Groups Projects
Commit 90778e64 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

fix: treat patch and cxxflags

parent 75f7bfa3
No related branches found
No related tags found
1 merge request!585feat: eic-spack dd4hep-pr1080
...@@ -84,20 +84,41 @@ if __name__ == '__main__': ...@@ -84,20 +84,41 @@ if __name__ == '__main__':
data_dir = '{}/share/{}'.format(prefix, det) data_dir = '{}/share/{}'.format(prefix, det)
## build and install ## build and install
print(' - {}-{}'.format(det, cfg['version'])) print(' - {}-{}'.format(det, cfg['version']))
## clone/build/install detector libraries ## cleanup
cmd = ['rm -rf /tmp/build /tmp/det', cmd = ['rm -rf /tmp/build /tmp/det']
'&&', print(' '.join(cmd))
'git clone --depth 1 -b {version} {repo_grp}/{detector}.git /tmp/det'.format( subprocess.check_call(' '.join(cmd), shell=True)
version=cfg['version'], ## clone
repo_grp=DETECTOR_REPO_GROUP, cmd = [
detector=det), 'git clone --depth 1 -b {version} {repo_grp}/{detector}.git /tmp/det'.format(
'&&', version=cfg['version'],
'cmake -B /tmp/build -S /tmp/det -DCMAKE_CXX_STANDARD=17', repo_grp=DETECTOR_REPO_GROUP,
'-DCMAKE_CXX_FLAGS="-Wno-psabi"', detector=det)
'-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache', ]
'-DCMAKE_INSTALL_PREFIX={prefix}'.format(prefix=prefix), print(' '.join(cmd))
'&&', subprocess.check_call(' '.join(cmd), shell=True)
'cmake --build /tmp/build -j$(($(($(nproc)/4))+1)) -- install'] ## patches
if cfg['patches']:
for patch in cfg['patches']:
cmd = ['curl -L {patch} | patch -p1 -d/tmp/det']
print(' '.join(cmd))
subprocess.check_call(' '.join(cmd), shell=True)
## build
cxxflags = ''
if cfg['cxxflags']:
cxxflags = cfg['cxxflags']
cmd = [
'cmake -B /tmp/build -S /tmp/det -DCMAKE_CXX_STANDARD=17',
'-DCMAKE_CXX_FLAGS="-Wno-psabi {cxxflags}"',
'-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache',
'-DCMAKE_INSTALL_PREFIX={prefix}'.format(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)) print(' '.join(cmd))
subprocess.check_call(' '.join(cmd), shell=True) subprocess.check_call(' '.join(cmd), shell=True)
## write version info to jug_info if available ## write version info to jug_info if available
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment