From 552ebdbedebb87f712ff9f56acaba71bcbb21523 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Thu, 28 Sep 2023 09:14:36 +0200 Subject: [PATCH] Export the runtime home for clang if given --- bsc/llvm-ompss2/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bsc/llvm-ompss2/default.nix b/bsc/llvm-ompss2/default.nix index 711f1b0..07f6c9d 100644 --- a/bsc/llvm-ompss2/default.nix +++ b/bsc/llvm-ompss2/default.nix @@ -1,13 +1,17 @@ { stdenv +, lib , gcc , clangOmpss2Unwrapped , wrapCCWith , llvmPackages_latest +, ompss2rt ? null }: let + homevar = if ompss2rt.pname == "nanos6" then "NANOS6_HOME" else "NODES_HOME"; + rtname = if ompss2rt.pname == "nanos6" then "libnanos6" else "libnodes"; # We need to replace the lld linker from bintools with our linker just built, # otherwise we run into incompatibility issues when mixing compiler and linker @@ -39,5 +43,8 @@ in wrapCCWith { echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags wrap clang++ $wrapper $ccPath/clang++ + '' + lib.optionalString (ompss2rt != null) '' + echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook + echo "export ${homevar}=${ompss2rt}" >> $out/nix-support/cc-wrapper-hook ''; }