summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Abraham <Mark.J.Abraham@gmail.com>2023-11-17 15:59:04 +0100
committerGitHub <noreply@github.com>2023-11-17 14:59:04 +0000
commitec8bd38c4e79646af4683659266e1ba2e886e9a9 (patch)
treeabce2a934089d28539e7cd7e4fbec162c888e502
parent81e73b4dd4ea0bf6c6947359d3cee9d4270df13d (diff)
downloadspack-ec8bd38c4e79646af4683659266e1ba2e886e9a9.tar.gz
spack-ec8bd38c4e79646af4683659266e1ba2e886e9a9.tar.bz2
spack-ec8bd38c4e79646af4683659266e1ba2e886e9a9.tar.xz
spack-ec8bd38c4e79646af4683659266e1ba2e886e9a9.zip
Permit packages that depend on Intel oneAPI packages to access sdk (#41117)
* Permit packages that depend on Intel oneAPI packages to access sdk * Implement and use IntelOneapiLibraryPackageWithSdk * Restore libs property to IntelOneapiLibraryPackage * Conform to style * Provide new class to infrastructure * Treat sdk/include as the main include
-rw-r--r--lib/spack/spack/build_systems/oneapi.py29
-rw-r--r--lib/spack/spack/package.py1
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-advisor/package.py2
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-inspector/package.py2
-rw-r--r--var/spack/repos/builtin/packages/intel-oneapi-vtune/package.py2
5 files changed, 33 insertions, 3 deletions
diff --git a/lib/spack/spack/build_systems/oneapi.py b/lib/spack/spack/build_systems/oneapi.py
index 4c432c0cac..f90312f579 100644
--- a/lib/spack/spack/build_systems/oneapi.py
+++ b/lib/spack/spack/build_systems/oneapi.py
@@ -179,6 +179,35 @@ class IntelOneApiLibraryPackage(IntelOneApiPackage):
return find_libraries("*", root=lib_path, shared=True, recursive=True)
+class IntelOneApiLibraryPackageWithSdk(IntelOneApiPackage):
+ """Base class for Intel oneAPI library packages with SDK components.
+
+ Contains some convenient default implementations for libraries
+ that expose functionality in sdk subdirectories.
+ Implement the method directly in the package if something
+ different is needed.
+
+ """
+
+ @property
+ def include(self):
+ return join_path(self.component_prefix, "sdk", "include")
+
+ @property
+ def headers(self):
+ return find_headers("*", self.include, recursive=True)
+
+ @property
+ def lib(self):
+ lib_path = join_path(self.component_prefix, "sdk", "lib64")
+ lib_path = lib_path if isdir(lib_path) else dirname(lib_path)
+ return lib_path
+
+ @property
+ def libs(self):
+ return find_libraries("*", root=self.lib, shared=True, recursive=True)
+
+
class IntelOneApiStaticLibraryList:
"""Provides ld_flags when static linking is needed
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 79df48cd17..f38ebec299 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -52,6 +52,7 @@ from spack.build_systems.octave import OctavePackage
from spack.build_systems.oneapi import (
INTEL_MATH_LIBRARIES,
IntelOneApiLibraryPackage,
+ IntelOneApiLibraryPackageWithSdk,
IntelOneApiPackage,
IntelOneApiStaticLibraryList,
)
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-advisor/package.py b/var/spack/repos/builtin/packages/intel-oneapi-advisor/package.py
index fe2b7f3438..01410cd18d 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-advisor/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-advisor/package.py
@@ -7,7 +7,7 @@ from spack.package import *
@IntelOneApiPackage.update_description
-class IntelOneapiAdvisor(IntelOneApiPackage):
+class IntelOneapiAdvisor(IntelOneApiLibraryPackageWithSdk):
"""Intel Advisor is a design and analysis tool for developing
performant code. The tool supports C, C++, Fortran, SYCL, OpenMP,
OpenCL code, and Python. It helps with the following: Performant
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-inspector/package.py b/var/spack/repos/builtin/packages/intel-oneapi-inspector/package.py
index 0c1e0f79ab..9f376cffc7 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-inspector/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-inspector/package.py
@@ -7,7 +7,7 @@ from spack.package import *
@IntelOneApiPackage.update_description
-class IntelOneapiInspector(IntelOneApiPackage):
+class IntelOneapiInspector(IntelOneApiLibraryPackageWithSdk):
"""Intel Inspector is a dynamic memory and threading error debugger
for C, C++, and Fortran applications that run on Windows and Linux
operating systems. Save money: locate the root cause of memory,
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-vtune/package.py b/var/spack/repos/builtin/packages/intel-oneapi-vtune/package.py
index c2ed3f164e..f9ab11eef7 100644
--- a/var/spack/repos/builtin/packages/intel-oneapi-vtune/package.py
+++ b/var/spack/repos/builtin/packages/intel-oneapi-vtune/package.py
@@ -7,7 +7,7 @@ from spack.package import *
@IntelOneApiPackage.update_description
-class IntelOneapiVtune(IntelOneApiPackage):
+class IntelOneapiVtune(IntelOneApiLibraryPackageWithSdk):
"""Intel VTune Profiler is a profiler to optimize application
performance, system performance, and system configuration for HPC,
cloud, IoT, media, storage, and more. CPU, GPU, and FPGA: Tune