From 77f6a794fd58d99797205868c2476d6de83c46fd Mon Sep 17 00:00:00 2001 From: blenderfreaky Date: Wed, 28 Jan 2026 17:18:19 +0100 Subject: [PATCH] unified-memory-framework: fixup static linking --- .../un/unified-memory-framework/package.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/un/unified-memory-framework/package.nix b/pkgs/by-name/un/unified-memory-framework/package.nix index 648c5ea22d55..d5c3bfcb3af7 100644 --- a/pkgs/by-name/un/unified-memory-framework/package.nix +++ b/pkgs/by-name/un/unified-memory-framework/package.nix @@ -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" + + # $ 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 $)' \ + '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