From 88d5393570663fd1db2912b9715ee215434f4d3a Mon Sep 17 00:00:00 2001 From: Olivier Cessenat Date: Mon, 23 Dec 2024 02:13:23 +0100 Subject: [PATCH] silo: variant python needs python (#48257) * silo: variant python needs python * Dependency to Python did not resolve the "Python.h" header not being found Added the -I path to Python header to the compiler. Having silo depend on python was not sufficient to get the path to python. Maybe there is a smarter way to do that, but this one works. * Update var/spack/repos/builtin/packages/silo/package.py Co-authored-by: Wouter Deconinck * Update var/spack/repos/builtin/packages/silo/package.py Co-authored-by: Wouter Deconinck * Update var/spack/repos/builtin/packages/silo/package.py Co-authored-by: Wouter Deconinck --------- Co-authored-by: Wouter Deconinck --- var/spack/repos/builtin/packages/silo/package.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/var/spack/repos/builtin/packages/silo/package.py b/var/spack/repos/builtin/packages/silo/package.py index f3c4c3f5d68..b36a23c138f 100644 --- a/var/spack/repos/builtin/packages/silo/package.py +++ b/var/spack/repos/builtin/packages/silo/package.py @@ -65,6 +65,7 @@ class Silo(AutotoolsPackage): variant("hzip", default=True, description="Enable hzip support") variant("fpzip", default=True, description="Enable fpzip support") + depends_on("python", type=("build", "link"), when="+python") depends_on("perl", type="build") depends_on("m4", type="build", when="+shared") depends_on("autoconf", type="build", when="+shared") @@ -129,6 +130,8 @@ def flag_handler(self, name, flags): if spec.satisfies("%oneapi"): flags.append("-Wno-error=int") flags.append("-Wno-error=int-conversion") + if spec.satisfies("+python"): + flags.append(f"-I {spec['python'].headers.directories[0]}") if "+hdf5" in spec: # @:4.10 can use up to the 1.10 API if "@:4.10" in spec: