dd4hep: add version 0.19 and variants for subpackages (#27717)

* dd4hep: add version 0.19 and variants for subpackages

* dd4hep: deprecate old versions, add tbb variant
This commit is contained in:
Valentin Volkl 2021-12-08 14:04:43 +01:00 committed by GitHub
parent 39e6f987bb
commit 4ccfe5108c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,21 +24,25 @@ class Dd4hep(CMakePackage):
tags = ['hep'] tags = ['hep']
version('master', branch='master') version('master', branch='master')
version('1.19', sha256='d2eccf5e8402ba7dab2e1d7236e12ee4db9b1c5e4253c40a140bf35580db1d9b')
version('1.18', sha256='1e909a42b969dfd966224fa8ab1eca5aa05136baf3c00a140f2f6d812b497152') version('1.18', sha256='1e909a42b969dfd966224fa8ab1eca5aa05136baf3c00a140f2f6d812b497152')
version('1.17', sha256='036a9908aaf1e13eaf5f2f43b6f5f4a8bdda8183ddc5befa77a4448dbb485826') version('1.17', sha256='036a9908aaf1e13eaf5f2f43b6f5f4a8bdda8183ddc5befa77a4448dbb485826')
version('1.16.1', sha256='c8b1312aa88283986f89cc008d317b3476027fd146fdb586f9f1fbbb47763f1a') version('1.16.1', sha256='c8b1312aa88283986f89cc008d317b3476027fd146fdb586f9f1fbbb47763f1a')
version('1.16', sha256='ea9755cd255cf1b058e0e3cd743101ca9ca5ff79f4c60be89f9ba72b1ae5ec69') # versions older than 1.16.1 are no longer supported
version('1.15', sha256='992a24bd4b3dfaffecec9d1c09e8cde2c7f89d38756879a47b23208242f4e352') # (they need several patches like https://github.com/AIDASoft/DD4hep/pull/796)
version('1.14.1', sha256='5b5742f1e23c2b36d3174cca95f810ce909c0eb66f3d6d7acb0ba657819e6717') version('1.16', sha256='ea9755cd255cf1b058e0e3cd743101ca9ca5ff79f4c60be89f9ba72b1ae5ec69', deprecated=True)
version('1.14', sha256='b603aa3c0db8dda392253aa71fa4a0f0c3c9715d47df0b895d45c1e8849f4895') version('1.15', sha256='992a24bd4b3dfaffecec9d1c09e8cde2c7f89d38756879a47b23208242f4e352', deprecated=True)
version('1.13.1', sha256='83fa70cd74ce93b2f52f098388dff58d179f05ace5b50aea3f408bb8abf7cb73') version('1.14.1', sha256='5b5742f1e23c2b36d3174cca95f810ce909c0eb66f3d6d7acb0ba657819e6717', deprecated=True)
version('1.13', sha256='0b1f9d902ebe21a9178c1e41204c066b29f68c8836fd1d03a9ce979811ddb295') version('1.14', sha256='b603aa3c0db8dda392253aa71fa4a0f0c3c9715d47df0b895d45c1e8849f4895', deprecated=True)
version('1.12.1', sha256='85e8c775ec03c499ce10911e228342e757c81ce9ef2a9195cb253b85175a2e93') version('1.13.1', sha256='83fa70cd74ce93b2f52f098388dff58d179f05ace5b50aea3f408bb8abf7cb73', deprecated=True)
version('1.12', sha256='133a1fb8ce0466d2482f3ebb03e60b3bebb9b2d3e33d14ba15c8fbb91706b398') version('1.13', sha256='0b1f9d902ebe21a9178c1e41204c066b29f68c8836fd1d03a9ce979811ddb295', deprecated=True)
version('1.11.2', sha256='96a53dd26cb8df11c6dae54669fbc9cc3c90dd47c67e07b24be9a1341c95abc4') version('1.12.1', sha256='85e8c775ec03c499ce10911e228342e757c81ce9ef2a9195cb253b85175a2e93', deprecated=True)
version('1.11.1', sha256='d7902dd7f6744bbda92f6e303ad5a3410eec4a0d2195cdc86f6c1167e72893f0') # these version won't build with +ddcad as the subpackage doesn't exit yet
version('1.11', sha256='25643296f15f9d11ad4ad550b7c3b92e8974fc56f1ee8e4455501010789ae7b6') version('1.12', sha256='133a1fb8ce0466d2482f3ebb03e60b3bebb9b2d3e33d14ba15c8fbb91706b398', deprecated=True)
version('1.10', sha256='1d6b5d1c368dc8bcedd9c61b7c7e1a44bad427f8bd34932516aff47c88a31d95') version('1.11.2', sha256='96a53dd26cb8df11c6dae54669fbc9cc3c90dd47c67e07b24be9a1341c95abc4', deprecated=True)
version('1.11.1', sha256='d7902dd7f6744bbda92f6e303ad5a3410eec4a0d2195cdc86f6c1167e72893f0', deprecated=True)
version('1.11', sha256='25643296f15f9d11ad4ad550b7c3b92e8974fc56f1ee8e4455501010789ae7b6', deprecated=True)
version('1.10', sha256='1d6b5d1c368dc8bcedd9c61b7c7e1a44bad427f8bd34932516aff47c88a31d95', deprecated=True)
generator = 'Ninja' generator = 'Ninja'
@ -50,13 +54,25 @@ class Dd4hep(CMakePackage):
# See https://github.com/spack/spack/issues/24232 # See https://github.com/spack/spack/issues/24232
patch('cmake_language.patch', when='@:1.17') patch('cmake_language.patch', when='@:1.17')
# variants for subpackages
variant('ddcad', default=True, description="Enable CAD interface based on Assimp")
variant('ddg4', default=True, description="Enable the simulation part based on Geant4")
variant('ddg4', default=True, description="Enable the simulation part based on Geant4")
variant('ddrec', default=True, description="Build DDRec subpackage.")
variant('dddetectors', default=True, description="Build DDDetectors subpackage.")
variant('ddcond', default=True, description="Build DDCond subpackage.")
variant('ddalign', default=True, description="Build DDAlign subpackage.")
variant('dddigi', default=True, description="Build DDDigi subpackage.")
variant('ddeve', default=True, description="Build DDEve subpackage.")
variant('utilityapps', default=True, description='Build UtilityApps subpackage.')
# variants for other build options
variant('xercesc', default=False, description="Enable 'Detector Builders' based on XercesC") variant('xercesc', default=False, description="Enable 'Detector Builders' based on XercesC")
variant('geant4', default=False, description="Enable the simulation part based on Geant4")
variant('assimp', default=False, description="Enable CAD interface based on Assimp")
variant('hepmc3', default=False, description="Enable build with hepmc3") variant('hepmc3', default=False, description="Enable build with hepmc3")
variant('lcio', default=False, description="Enable build with lcio") variant('lcio', default=False, description="Enable build with lcio")
variant('edm4hep', default=True, description="Enable build with edm4hep") variant('edm4hep', default=True, description="Enable build with edm4hep")
variant('geant4units', default=False, description="Use geant4 units throughout") variant('geant4units', default=False, description="Use geant4 units throughout")
variant('tbb', default=False, description="Enable build with tbb")
variant('debug', default=False, variant('debug', default=False,
description="Enable debug build flag - adds extra info in" description="Enable debug build flag - adds extra info in"
" some places in addtion to the debug build type") " some places in addtion to the debug build type")
@ -64,12 +80,14 @@ class Dd4hep(CMakePackage):
depends_on('cmake @3.12:', type='build') depends_on('cmake @3.12:', type='build')
depends_on('ninja', type='build') depends_on('ninja', type='build')
depends_on('boost @1.49:') depends_on('boost @1.49:')
depends_on('root @6.08: +gdml +math +opengl +python +x') depends_on('root @6.08: +gdml +math +python')
depends_on('root @6.08: +gdml +math +python +x +opengl', when="+ddeve")
extends('python') extends('python')
depends_on('xerces-c', when='+xercesc') depends_on('xerces-c', when='+xercesc')
depends_on('geant4@10.2.2:', when='+geant4') depends_on('geant4@10.2.2:', when='+ddg4')
depends_on('assimp@5.0.2:', when='+assimp') depends_on('assimp@5.0.2:', when='+ddcad')
depends_on('hepmc3', when="+hepmc3") depends_on('hepmc3', when="+hepmc3")
depends_on('intel-tbb', when='+tbb')
depends_on('lcio', when="+lcio") depends_on('lcio', when="+lcio")
depends_on('edm4hep', when="+edm4hep") depends_on('edm4hep', when="+edm4hep")
depends_on('py-pytest', type="test") depends_on('py-pytest', type="test")
@ -77,6 +95,7 @@ class Dd4hep(CMakePackage):
# See https://github.com/AIDASoft/DD4hep/pull/771 # See https://github.com/AIDASoft/DD4hep/pull/771
conflicts('^cmake@3.16:3.17.0', when='@1.15', conflicts('^cmake@3.16:3.17.0', when='@1.15',
msg='cmake version with buggy FindPython breaks dd4hep cmake config') msg='cmake version with buggy FindPython breaks dd4hep cmake config')
conflicts('~ddrec+dddetectors', msg="Need to enable +ddrec to build +dddetectors.")
def cmake_args(self): def cmake_args(self):
spec = self.spec spec = self.spec
@ -87,7 +106,8 @@ def cmake_args(self):
args = [ args = [
self.define_from_variant('DD4HEP_USE_EDM4HEP', 'edm4hep'), self.define_from_variant('DD4HEP_USE_EDM4HEP', 'edm4hep'),
self.define_from_variant('DD4HEP_USE_XERCESC', 'xercesc'), self.define_from_variant('DD4HEP_USE_XERCESC', 'xercesc'),
self.define_from_variant('DD4HEP_USE_GEANT4', 'geant4'), self.define_from_variant('DD4HEP_USE_TBB', 'tbb'),
self.define_from_variant('DD4HEP_USE_GEANT4', 'ddg4'),
self.define_from_variant('DD4HEP_USE_LCIO', 'lcio'), self.define_from_variant('DD4HEP_USE_LCIO', 'lcio'),
self.define_from_variant('DD4HEP_USE_HEPMC3', 'hepmc3'), self.define_from_variant('DD4HEP_USE_HEPMC3', 'hepmc3'),
self.define_from_variant('DD4HEP_USE_GEANT4_UNITS', 'geant4units'), self.define_from_variant('DD4HEP_USE_GEANT4_UNITS', 'geant4units'),
@ -102,6 +122,27 @@ def cmake_args(self):
"-DBoost_NO_BOOST_CMAKE=ON", "-DBoost_NO_BOOST_CMAKE=ON",
"-DPYTHON_EXECUTABLE={0}".format(spec['python'].command.path), "-DPYTHON_EXECUTABLE={0}".format(spec['python'].command.path),
] ]
subpackages = []
if spec.satisfies('+ddg4'):
subpackages += ['DDG4']
if spec.satisfies('+ddcond'):
subpackages += ['DDCond']
if spec.satisfies('+ddcad'):
subpackages += ['DDCAD']
if spec.satisfies('+ddrec'):
subpackages += ['DDRec']
if spec.satisfies('+dddetectors'):
subpackages += ['DDDetectors']
if spec.satisfies('+ddalign'):
subpackages += ['DDAlign']
if spec.satisfies('+dddigi'):
subpackages += ['DDDigi']
if spec.satisfies('+ddeve'):
subpackages += ['DDEve']
if spec.satisfies('+utilityapps'):
subpackages += ['UtilityApps']
subpackages = ' '.join(subpackages)
args += [self.define('DD4HEP_BUILD_PACKAGES', subpackages)]
return args return args
def setup_run_environment(self, env): def setup_run_environment(self, env):