python: fix clingo bootstrapping on Apple M1/M2 (#31792)
This commit is contained in:
parent
ae3c039908
commit
90dbfea895
@ -74,8 +74,8 @@ def cmake_python_hints(self):
|
|||||||
"""
|
"""
|
||||||
python = self.spec["python"]
|
python = self.spec["python"]
|
||||||
return [
|
return [
|
||||||
self.define("Python_EXECUTABLE", str(python.command)),
|
self.define("Python_EXECUTABLE", python.command),
|
||||||
self.define("Python_INCLUDE_DIR", python.package.config_vars["include"]),
|
self.define("Python_INCLUDE_DIR", python.headers.directories[0]),
|
||||||
]
|
]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -961,6 +961,7 @@ def config_vars(self):
|
|||||||
# get_config_vars
|
# get_config_vars
|
||||||
"BINDIR": self.prefix.bin,
|
"BINDIR": self.prefix.bin,
|
||||||
"CC": "cc",
|
"CC": "cc",
|
||||||
|
"CONFINCLUDEPY": self.prefix.include.join("python{}").format(version),
|
||||||
"CXX": "c++",
|
"CXX": "c++",
|
||||||
"INCLUDEPY": self.prefix.include.join("python{}").format(version),
|
"INCLUDEPY": self.prefix.include.join("python{}").format(version),
|
||||||
"LIBDEST": self.prefix.lib.join("python{}").format(version),
|
"LIBDEST": self.prefix.lib.join("python{}").format(version),
|
||||||
@ -1098,15 +1099,17 @@ def libs(self):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def headers(self):
|
def headers(self):
|
||||||
directory = self.config_vars["include"]
|
# Location where pyconfig.h is _supposed_ to be
|
||||||
config_h = self.config_vars["config_h_filename"]
|
config_h = self.config_vars["config_h_filename"]
|
||||||
|
|
||||||
if os.path.exists(config_h):
|
if os.path.exists(config_h):
|
||||||
headers = HeaderList(config_h)
|
headers = HeaderList(config_h)
|
||||||
else:
|
else:
|
||||||
headers = find_headers("pyconfig", directory)
|
# If not, one of these config vars should contain the right directory
|
||||||
if headers:
|
for var in ["INCLUDEPY", "CONFINCLUDEPY"]:
|
||||||
config_h = headers[0]
|
headers = find_headers("pyconfig", self.config_vars[var])
|
||||||
|
if headers:
|
||||||
|
config_h = headers[0]
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
msg = "Unable to locate {} headers in {}"
|
msg = "Unable to locate {} headers in {}"
|
||||||
raise spack.error.NoHeadersError(msg.format(self.name, directory))
|
raise spack.error.NoHeadersError(msg.format(self.name, directory))
|
||||||
|
Loading…
Reference in New Issue
Block a user