builtin: remove llnl.util.tty import (#50396)
* builtin: remove llnl.util.tty import * hipsycl: remove unnecessary imports
This commit is contained in:
parent
98570929aa
commit
5c918e40a6
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import llnl.util.tty as tty
|
|
||||||
|
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
from spack.util.module_cmd import get_path_args_from_module_line, module
|
from spack.util.module_cmd import get_path_args_from_module_line, module
|
||||||
|
|
||||||
|
@ -4,9 +4,6 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from os import path
|
|
||||||
|
|
||||||
from llnl.util import filesystem
|
|
||||||
|
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
@ -109,18 +106,16 @@ def cmake_args(self):
|
|||||||
]
|
]
|
||||||
# LLVM directory containing all installed CMake files
|
# LLVM directory containing all installed CMake files
|
||||||
# (e.g.: configs consumed by client projects)
|
# (e.g.: configs consumed by client projects)
|
||||||
llvm_cmake_dirs = filesystem.find(spec["llvm"].prefix, "LLVMExports.cmake")
|
llvm_cmake_dirs = find(spec["llvm"].prefix, "LLVMExports.cmake")
|
||||||
if len(llvm_cmake_dirs) != 1:
|
if len(llvm_cmake_dirs) != 1:
|
||||||
raise InstallError(
|
raise InstallError(
|
||||||
"concretized llvm dependency must provide "
|
"concretized llvm dependency must provide "
|
||||||
"a unique directory containing CMake client "
|
"a unique directory containing CMake client "
|
||||||
"files, found: {0}".format(llvm_cmake_dirs)
|
"files, found: {0}".format(llvm_cmake_dirs)
|
||||||
)
|
)
|
||||||
args.append("-DLLVM_DIR:String={0}".format(path.dirname(llvm_cmake_dirs[0])))
|
args.append("-DLLVM_DIR:String={0}".format(os.path.dirname(llvm_cmake_dirs[0])))
|
||||||
# clang internal headers directory
|
# clang internal headers directory
|
||||||
llvm_clang_include_dirs = filesystem.find(
|
llvm_clang_include_dirs = find(spec["llvm"].prefix, "__clang_cuda_runtime_wrapper.h")
|
||||||
spec["llvm"].prefix, "__clang_cuda_runtime_wrapper.h"
|
|
||||||
)
|
|
||||||
if len(llvm_clang_include_dirs) != 1:
|
if len(llvm_clang_include_dirs) != 1:
|
||||||
raise InstallError(
|
raise InstallError(
|
||||||
"concretized llvm dependency must provide a "
|
"concretized llvm dependency must provide a "
|
||||||
@ -128,11 +123,11 @@ def cmake_args(self):
|
|||||||
"headers, found: {0}".format(llvm_clang_include_dirs)
|
"headers, found: {0}".format(llvm_clang_include_dirs)
|
||||||
)
|
)
|
||||||
args.append(
|
args.append(
|
||||||
"-DCLANG_INCLUDE_PATH:String={0}".format(path.dirname(llvm_clang_include_dirs[0]))
|
"-DCLANG_INCLUDE_PATH:String={0}".format(os.path.dirname(llvm_clang_include_dirs[0]))
|
||||||
)
|
)
|
||||||
# target clang++ executable
|
# target clang++ executable
|
||||||
llvm_clang_bin = path.join(spec["llvm"].prefix.bin, "clang++")
|
llvm_clang_bin = os.path.join(spec["llvm"].prefix.bin, "clang++")
|
||||||
if not filesystem.is_exe(llvm_clang_bin):
|
if not is_exe(llvm_clang_bin):
|
||||||
raise InstallError(
|
raise InstallError(
|
||||||
"concretized llvm dependency must provide a "
|
"concretized llvm dependency must provide a "
|
||||||
"valid clang++ executable, found invalid: "
|
"valid clang++ executable, found invalid: "
|
||||||
@ -152,7 +147,7 @@ def cmake_args(self):
|
|||||||
@run_after("install")
|
@run_after("install")
|
||||||
def filter_config_file(self):
|
def filter_config_file(self):
|
||||||
def edit_config(filename, editor):
|
def edit_config(filename, editor):
|
||||||
config_file_paths = filesystem.find(self.prefix, filename)
|
config_file_paths = find(self.prefix, filename)
|
||||||
if len(config_file_paths) != 1:
|
if len(config_file_paths) != 1:
|
||||||
raise InstallError(
|
raise InstallError(
|
||||||
"installed hipSYCL must provide a unique compiler driver"
|
"installed hipSYCL must provide a unique compiler driver"
|
||||||
@ -186,7 +181,7 @@ def adjust_core_config(config):
|
|||||||
# ptx backend
|
# ptx backend
|
||||||
rpaths = set()
|
rpaths = set()
|
||||||
if self.spec.satisfies("~rocm"):
|
if self.spec.satisfies("~rocm"):
|
||||||
so_paths = filesystem.find_libraries(
|
so_paths = find_libraries(
|
||||||
"libc++", self.spec["llvm"].prefix, shared=True, recursive=True
|
"libc++", self.spec["llvm"].prefix, shared=True, recursive=True
|
||||||
)
|
)
|
||||||
if len(so_paths) != 1:
|
if len(so_paths) != 1:
|
||||||
@ -195,8 +190,8 @@ def adjust_core_config(config):
|
|||||||
"unique directory containing libc++.so, "
|
"unique directory containing libc++.so, "
|
||||||
"found: {0}".format(so_paths)
|
"found: {0}".format(so_paths)
|
||||||
)
|
)
|
||||||
rpaths.add(path.dirname(so_paths[0]))
|
rpaths.add(os.path.dirname(so_paths[0]))
|
||||||
so_paths = filesystem.find_libraries(
|
so_paths = find_libraries(
|
||||||
"libc++abi", self.spec["llvm"].prefix, shared=True, recursive=True
|
"libc++abi", self.spec["llvm"].prefix, shared=True, recursive=True
|
||||||
)
|
)
|
||||||
if len(so_paths) != 1:
|
if len(so_paths) != 1:
|
||||||
@ -205,7 +200,7 @@ def adjust_core_config(config):
|
|||||||
"unique directory containing libc++abi, "
|
"unique directory containing libc++abi, "
|
||||||
"found: {0}".format(so_paths)
|
"found: {0}".format(so_paths)
|
||||||
)
|
)
|
||||||
rpaths.add(path.dirname(so_paths[0]))
|
rpaths.add(os.path.dirname(so_paths[0]))
|
||||||
|
|
||||||
def adjust_cuda_config(config):
|
def adjust_cuda_config(config):
|
||||||
config["default-cuda-link-line"] += " " + " ".join(
|
config["default-cuda-link-line"] += " " + " ".join(
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import llnl.util.filesystem as fsys
|
import llnl.util.filesystem as fsys
|
||||||
import llnl.util.tty as tty
|
|
||||||
|
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@
|
|||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import llnl.util.tty as tty
|
|
||||||
|
|
||||||
import spack.compilers.config
|
import spack.compilers.config
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user