mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2025-12-13 00:10:04 +03:00
Noticed in sci-ml/torchvision: 1) compilation failed on multilib (Gentoo-related) 2) compilation failed with Clang-libc++ (patch should be in upstream) Bug: https://bugs.gentoo.org/959589 Signed-off-by: Sv. Lockal <lockalsash@gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/42891 Signed-off-by: Alfredo Tupone <tupone@gentoo.org>
26 lines
1.1 KiB
Diff
26 lines
1.1 KiB
Diff
Fixes multilib (%LIB_DIR% should be replaced in ebuild)
|
|
--- a/torch/utils/cpp_extension.py
|
|
+++ b/torch/utils/cpp_extension.py
|
|
@@ -1478,10 +1477,10 @@ def library_paths(device_type: str = "cpu") -> list[str]:
|
|
paths = [TORCH_LIB_PATH]
|
|
|
|
if device_type == "cuda" and IS_HIP_EXTENSION:
|
|
- lib_dir = 'lib'
|
|
+ lib_dir = '%LIB_DIR%'
|
|
paths.append(_join_rocm_home(lib_dir))
|
|
if HIP_HOME is not None:
|
|
- paths.append(os.path.join(HIP_HOME, 'lib'))
|
|
+ paths.append(os.path.join(HIP_HOME, '%LIB_DIR%'))
|
|
elif device_type == "cuda":
|
|
if IS_WINDOWS:
|
|
lib_dir = os.path.join('lib', 'x64')
|
|
@@ -2295,7 +2294,7 @@ def _prepare_ldflags(extra_ldflags, with_cuda, verbose, is_standalone):
|
|
if CUDNN_HOME is not None:
|
|
extra_ldflags.append(f'-L{os.path.join(CUDNN_HOME, "lib64")}')
|
|
elif IS_HIP_EXTENSION:
|
|
- extra_ldflags.append(f'-L{_join_rocm_home("lib")}')
|
|
+ extra_ldflags.append(f'-L{_join_rocm_home("%LIB_DIR%")}')
|
|
extra_ldflags.append('-lamdhip64')
|
|
return extra_ldflags
|
|
|