unified-memory-framework: fixup static linking

This commit is contained in:
blenderfreaky
2026-04-20 15:54:50 +02:00
committed by kilyanni
parent c29a1d0389
commit 77f6a794fd
@@ -43,9 +43,6 @@ stdenv.mkDerivation (finalAttrs: {
onetbb
level-zero
]
++ lib.optionals useJemalloc [
hwloc
]
++ lib.optionals cudaSupport [
cudaPackages.cuda_cudart
]
@@ -55,6 +52,10 @@ stdenv.mkDerivation (finalAttrs: {
gbenchmark
];
propagatedBuildInputs = [
hwloc
];
src = fetchFromGitHub {
owner = "oneapi-src";
repo = "unified-memory-framework";
@@ -72,6 +73,14 @@ stdenv.mkDerivation (finalAttrs: {
# causing the package to link to /build
substituteInPlace CMakeLists.txt \
--replace-fail "\''${jemalloc_targ_BINARY_DIR}" "$out/jemalloc"
# $<BUILD_INTERFACE:hwloc> only links hwloc at build time, so the installed
# cmake targets omit it. Downstream static consumers (e.g. UR adapters in
# intel-llvm) then fail to link. Export hwloc unconditionally instead.
substituteInPlace src/CMakeLists.txt \
--replace-fail \
'set(UMF_LIBS umf_utils umf_ba umf_coarse $<BUILD_INTERFACE:''${UMF_HWLOC_NAME}>)' \
'set(UMF_LIBS umf_utils umf_ba umf_coarse ''${UMF_HWLOC_NAME})'
'';
# If included, jemalloc needs to be vendored, as they don't support using a pre-built version