From acc848a0f8d4d4798ebfb6c8927d74e30f5f8681 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Wed, 10 Aug 2022 05:11:13 -0500 Subject: gaudi: disentangle variant 'optional' (#31801) --- var/spack/repos/builtin/packages/gaudi/package.py | 61 ++++++++++++----------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/var/spack/repos/builtin/packages/gaudi/package.py b/var/spack/repos/builtin/packages/gaudi/package.py index 1a33a4a1e1..6d11599e05 100644 --- a/var/spack/repos/builtin/packages/gaudi/package.py +++ b/var/spack/repos/builtin/packages/gaudi/package.py @@ -35,11 +35,18 @@ class Gaudi(CMakePackage): maintainers = ["drbenmorgan", "vvolkl"] - variant("optional", default=False, description="Build most optional components and tests") + variant("aida", default=False, description="Build AIDA interfaces support") + variant("cppunit", default=False, description="Build with CppUnit unit testing") variant("docs", default=False, description="Build documentation with Doxygen") + variant("examples", default=False, description="Build examples") + variant("gperftools", default=False, description="Build with Google PerfTools support") + variant("heppdt", default=False, description="Build with HEP Particle Data Table support") + variant("jemalloc", default=False, description="Build with jemalloc allocator support") + variant("unwind", default=False, description="Build with unwind call-chains") variant("vtune", default=False, description="Build with Intel VTune profiler support") + variant("xercesc", default=False, description="Build with Xerces-C XML support") - # only build subdirectory GaudiExamples when +optional + # only build subdirectory GaudiExamples when +examples patch("build_testing.patch", when="@:34") # fixes for the cmake config which could not find newer boost versions patch("link_target_fixes.patch", when="@33.0:34") @@ -63,6 +70,9 @@ class Gaudi(CMakePackage): depends_on("python", type=("build", "run")) depends_on("python@:3.7", when="@32.2:34", type=("build", "run")) depends_on("python@:2", when="@:32.1", type=("build", "run")) + depends_on("py-networkx@:2.2", when="^python@:2.7") + depends_on("py-networkx", when="^python@3.0.0:") + depends_on("py-nose", type="test") depends_on("py-setuptools@:45", when="^python@:2.7", type="build") depends_on("py-six", type=("build", "run")) depends_on("py-xenv@1:", when="@:34.9", type=("build", "run")) @@ -70,27 +80,20 @@ class Gaudi(CMakePackage): depends_on("root +python +root7 +ssl +tbb +threads") depends_on("zlib") - # todo: this should be a test dependency only, - depends_on("py-nose", when="@35.0:36.1", type=("build", "run")) - depends_on("py-pytest", when="@36.2:", type=("build", "run")) - # Adding these dependencies triggers the build of most optional components - depends_on("cppgsl", when="+optional") - depends_on("cppunit", when="+optional") + depends_on("cppgsl", when="+cppunit") + depends_on("cppunit", when="+cppunit") depends_on("doxygen +graphviz", when="+docs") - depends_on("gperftools", when="+optional") - depends_on("gdb", when="+optional") - depends_on("gsl", when="+optional") - depends_on("heppdt@:2", when="+optional") - depends_on("jemalloc", when="+optional") - depends_on("libpng", when="+optional") - depends_on("libunwind", when="+optional") - depends_on("py-networkx@:2.2", when="+optional ^python@:2.7") - depends_on("py-networkx", when="+optional ^python@3.0.0:") - depends_on("py-setuptools", when="+optional") - depends_on("py-nose", when="+optional") - depends_on("relax", when="@:33 +optional") - depends_on("xerces-c", when="+optional") + depends_on("gperftools", when="+gperftools") + depends_on("gdb") + depends_on("gsl", when="@:31 +examples") + depends_on("heppdt", when="@:34 +examples") + depends_on("heppdt", when="+heppdt") + depends_on("jemalloc", when="+jemalloc") + depends_on("libpng", when="@:34 +examples") + depends_on("libunwind", when="+unwind") + depends_on("relax", when="@:34 +examples") + depends_on("xerces-c", when="+xercesc") # NOTE: pocl cannot be added as a minimal OpenCL implementation because # ROOT does not like being exposed to LLVM symbols. @@ -99,20 +102,20 @@ class Gaudi(CMakePackage): def cmake_args(self): args = [ - self.define_from_variant("BUILD_TESTING", "optional"), - self.define_from_variant("GAUDI_USE_AIDA", "optional"), - self.define_from_variant("GAUDI_USE_CPPUNIT", "optional"), - self.define_from_variant("GAUDI_USE_HEPPDT", "optional"), - self.define_from_variant("GAUDI_USE_JEMALLOC", "optional"), - self.define_from_variant("GAUDI_USE_UNWIND", "optional"), - self.define_from_variant("GAUDI_USE_XERCESC", "optional"), + self.define("BUILD_TESTING", self.run_tests or self.spec.satisfies("+examples")), + self.define_from_variant("GAUDI_USE_AIDA", "aida"), + self.define_from_variant("GAUDI_USE_CPPUNIT", "cppunit"), + self.define_from_variant("GAUDI_USE_GPERFTOOLS", "gperftools"), + self.define_from_variant("GAUDI_USE_HEPPDT", "heppdt"), + self.define_from_variant("GAUDI_USE_JEMALLOC", "jemalloc"), + self.define_from_variant("GAUDI_USE_UNWIND", "unwind"), + self.define_from_variant("GAUDI_USE_XERCESC", "xercesc"), self.define_from_variant("GAUDI_USE_DOXYGEN", "docs"), # needed to build core services like rndmsvc self.define("GAUDI_USE_CLHEP", True), self.define("GAUDI_USE_PYTHON_MAJOR", str(self.spec["python"].version.up_to(1))), # todo: self.define("GAUDI_USE_INTELAMPLIFIER", False), - self.define("GAUDI_USE_GPERFTOOLS", False), ] # this is not really used in spack builds, but needs to be set if self.spec.version < Version("34"): -- cgit v1.2.3-70-g09d2