diff options
author | Robert Cohn <robert.s.cohn@intel.com> | 2023-05-10 06:25:00 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-10 06:25:00 -0400 |
commit | a2ea30aceb6b09d48d4a0c76bbadaf9bff1a5437 (patch) | |
tree | e0bc116566ea80880c5ff55f5626f275f0ac15b0 /lib | |
parent | 9a37c8fcb16f8e1f7e228991f0dc61102d8ccc7e (diff) | |
download | spack-a2ea30aceb6b09d48d4a0c76bbadaf9bff1a5437.tar.gz spack-a2ea30aceb6b09d48d4a0c76bbadaf9bff1a5437.tar.bz2 spack-a2ea30aceb6b09d48d4a0c76bbadaf9bff1a5437.tar.xz spack-a2ea30aceb6b09d48d4a0c76bbadaf9bff1a5437.zip |
Create include/lib in prefix for oneapi packages (#37552)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/build_systems/oneapi.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/spack/spack/build_systems/oneapi.py b/lib/spack/spack/build_systems/oneapi.py index a6f96d45eb..a8b03689f4 100644 --- a/lib/spack/spack/build_systems/oneapi.py +++ b/lib/spack/spack/build_systems/oneapi.py @@ -4,13 +4,16 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) """Common utilities for managing intel oneapi packages.""" import getpass +import os import platform import shutil from os.path import basename, dirname, isdir from llnl.util.filesystem import find_headers, find_libraries, join_path +from llnl.util.link_tree import LinkTree from spack.directives import conflicts, variant +from spack.package import mkdirp from spack.util.environment import EnvironmentModifications from spack.util.executable import Executable @@ -125,6 +128,31 @@ class IntelOneApiPackage(Package): ) ) + def symlink_dir(self, src, dest): + # Taken from: https://github.com/spack/spack/pull/31285/files + # oneapi bin/lib directories are 2 or 3 levels below the + # prefix, but it is more typical to have them directly in the + # prefix. The location has changed over time. Rather than make + # every package that needs to know where include/lib are + # located be aware of this, put in symlinks to conform. This + # is good enough for some, but not all packages. + + # If we symlink top-level directories directly, files won't + # show up in views Create real dirs and symlink files instead + + # Create a real directory at dest + mkdirp(dest) + + # Symlink all files in src to dest keeping directories as dirs + for entry in os.listdir(src): + src_path = join_path(src, entry) + dest_path = join_path(dest, entry) + if isdir(src_path) and os.access(src_path, os.X_OK): + link_tree = LinkTree(src_path) + link_tree.merge(dest_path) + else: + os.symlink(src_path, dest_path) + class IntelOneApiLibraryPackage(IntelOneApiPackage): """Base class for Intel oneAPI library packages. |