summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Cohn <robert.s.cohn@intel.com>2024-02-11 11:23:53 -0500
committerGitHub <noreply@github.com>2024-02-11 08:23:53 -0800
commit2c6757172608a4444f9ba9ba856bb3c932c7a6d5 (patch)
tree4ec673539cf860b29d84969ecb26b605ce3c608a
parentfae6d3780fbf034390048d1fc706545ab83421f5 (diff)
downloadspack-2c6757172608a4444f9ba9ba856bb3c932c7a6d5.tar.gz
spack-2c6757172608a4444f9ba9ba856bb3c932c7a6d5.tar.bz2
spack-2c6757172608a4444f9ba9ba856bb3c932c7a6d5.tar.xz
spack-2c6757172608a4444f9ba9ba856bb3c932c7a6d5.zip
[oneapi]: make headers match oneapi vars.sh (#42614)
* [oneapi]: make headers match oneapi vars.sh * update * update
-rw-r--r--lib/spack/spack/build_systems/oneapi.py14
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-dal/package.py11
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-dnn/package.py9
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py11
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py6
5 files changed, 38 insertions, 13 deletions
diff --git a/lib/spack/spack/build_systems/oneapi.py b/lib/spack/spack/build_systems/oneapi.py
index f1e63761bc..857f712ee2 100644
--- a/lib/spack/spack/build_systems/oneapi.py
+++ b/lib/spack/spack/build_systems/oneapi.py
@@ -179,16 +179,24 @@ class IntelOneApiLibraryPackage(IntelOneApiPackage):
"""
+ # find_headers uses heuristics to determine the include directory
+ # that does not work for oneapi packages. Use explicit directories
+ # instead.
def header_directories(self, dirs):
h = HeaderList([])
h.directories = dirs
+ # trilinos passes the directories to cmake, and cmake requires
+ # that the directory exists
+ for dir in dirs:
+ if not isdir(dir):
+ raise RuntimeError(f"{dir} does not exist")
return h
@property
def headers(self):
- return self.header_directories(
- [self.component_prefix.include, self.component_prefix.include.join(self.component_dir)]
- )
+ # This should match the directories added to CPATH by
+ # env/vars.sh for the component
+ return self.header_directories([self.component_prefix.include])
@property
def libs(self):
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-dal/package.py b/var/spack/repos/builtin/packages/intel-oneapi-dal/package.py
index 1c509113d0..025a81814f 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-dal/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-dal/package.py
@@ -117,3 +117,14 @@ class IntelOneapiDal(IntelOneApiLibraryPackage):
@property
def component_dir(self):
return "dal"
+
+ @property
+ def headers(self):
+ # This should match the directories added to CPATH by
+ # env/vars.sh for the component
+ if self.v2_layout:
+ dirs = [self.component_prefix.include, self.component_prefix.include.dal]
+ else:
+ dirs = [self.component_prefix.include]
+
+ return self.header_directories(dirs)
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-dnn/package.py b/var/spack/repos/builtin/packages/intel-oneapi-dnn/package.py
index 81764743dc..80da187cd2 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-dnn/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-dnn/package.py
@@ -123,7 +123,14 @@ class IntelOneapiDnn(IntelOneApiLibraryPackage):
@property
def headers(self):
- return find_headers("dnnl", self.__target().include)
+ # This should match the directories added to CPATH by
+ # env/vars.sh for the component
+ if self.v2_layout:
+ dirs = [self.component_prefix.include]
+ else:
+ dirs = [self.component_prefix.cpu_dpcpp_gpu_dpcpp.include]
+
+ return self.header_directories(dirs)
@property
def libs(self):
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py b/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py
index 42b778222c..83a6252caf 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py
@@ -93,6 +93,11 @@ class IntelOneapiDpl(IntelOneApiLibraryPackage):
@property
def headers(self):
- return self.header_directories(
- [self.component_prefix.include, self.component_prefix.linux.include]
- )
+ # This should match the directories added to CPATH by
+ # env/vars.sh for the component
+ if self.v2_layout:
+ dirs = [self.component_prefix.include]
+ else:
+ dirs = [self.component_prefix.linux.include]
+
+ return self.header_directories(dirs)
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
index ab3c438bdf..e41d6dd21c 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
@@ -168,12 +168,6 @@ class IntelOneapiMpi(IntelOneApiLibraryPackage):
env.set("I_MPI_ROOT", self.component_prefix)
@property
- def headers(self):
- return self.header_directories(
- [self.component_prefix.include, self.component_prefix.include.ilp64]
- )
-
- @property
def libs(self):
libs = []
if "+ilp64" in self.spec: