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
This commit is contained in:
Mark Abraham 2023-11-17 15:59:04 +01:00 committed by GitHub
parent 81e73b4dd4
commit ec8bd38c4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 3 deletions

View File

@ -179,6 +179,35 @@ def libs(self):
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

View File

@ -52,6 +52,7 @@
from spack.build_systems.oneapi import (
INTEL_MATH_LIBRARIES,
IntelOneApiLibraryPackage,
IntelOneApiLibraryPackageWithSdk,
IntelOneApiPackage,
IntelOneApiStaticLibraryList,
)

View File

@ -7,7 +7,7 @@
@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

View File

@ -7,7 +7,7 @@
@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,

View File

@ -7,7 +7,7 @@
@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