diff --git a/bsc/llvm-ompss2/default.nix b/bsc/llvm-ompss2/default.nix index f57c450..c613a10 100644 --- a/bsc/llvm-ompss2/default.nix +++ b/bsc/llvm-ompss2/default.nix @@ -1,7 +1,7 @@ { stdenv , gcc -, nanos6 +, rt , clangOmpss2Unwrapped , wrapCCWith , llvmPackages @@ -20,8 +20,14 @@ let bintools = bintools-unwrapped; }; + homevar = if rt.pname == "nanos6" + then + "NANOS6_HOME" + else + "NODES_HOME"; + targetConfig = stdenv.targetPlatform.config; - inherit gcc nanos6; + inherit gcc; cc = clangOmpss2Unwrapped; in wrapCCWith { inherit cc bintools; @@ -40,8 +46,8 @@ in wrapCCWith { echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags - echo "# Hack to include NANOS6_HOME" >> $out/nix-support/setup-hook - echo "export NANOS6_HOME=${nanos6}" >> $out/nix-support/setup-hook + # Setup NANOS6_HOME or NODES_HOME, based on the runtime. + echo "export ${homevar}=${rt}" >> $out/nix-support/setup-hook wrap clang++ $wrapper $ccPath/clang++ ''; diff --git a/overlay.nix b/overlay.nix index e10f007..7c9075f 100644 --- a/overlay.nix +++ b/overlay.nix @@ -105,12 +105,14 @@ let clangOmpss2 = appendPasstru ( callPackage ./bsc/llvm-ompss2/default.nix { + rt = bsc.nanos6; llvmPackages = bsc.llvmPackages; clangOmpss2Unwrapped = bsc.clangOmpss2Unwrapped; }) { CC = "clang"; CXX = "clang++"; }; clangOmpss2Git = appendPasstru ( callPackage ./bsc/llvm-ompss2/default.nix { + rt = bsc.nanos6; llvmPackages = bsc.llvmPackages; clangOmpss2Unwrapped = bsc.clangOmpss2UnwrappedGit; }) { CC = "clang"; CXX = "clang++"; }; @@ -121,7 +123,7 @@ let }; clangNodes = bsc.clangOmpss2.override { - nanos6 = bsc.nodes; + rt = bsc.nodes; }; stdenvClangNodes = self.stdenv.override { cc = bsc.clangNodes;