Export proper OmpSs-2 runtime home variable

This commit is contained in:
Rodrigo Arias 2023-05-22 12:30:23 +02:00
parent a34e619333
commit 3f4f3e1105
2 changed files with 13 additions and 5 deletions

View File

@ -1,7 +1,7 @@
{ {
stdenv stdenv
, gcc , gcc
, nanos6 , rt
, clangOmpss2Unwrapped , clangOmpss2Unwrapped
, wrapCCWith , wrapCCWith
, llvmPackages , llvmPackages
@ -20,8 +20,14 @@ let
bintools = bintools-unwrapped; bintools = bintools-unwrapped;
}; };
homevar = if rt.pname == "nanos6"
then
"NANOS6_HOME"
else
"NODES_HOME";
targetConfig = stdenv.targetPlatform.config; targetConfig = stdenv.targetPlatform.config;
inherit gcc nanos6; inherit gcc;
cc = clangOmpss2Unwrapped; cc = clangOmpss2Unwrapped;
in wrapCCWith { in wrapCCWith {
inherit cc bintools; inherit cc bintools;
@ -40,8 +46,8 @@ in wrapCCWith {
echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags echo "--gcc-toolchain=${gcc}" >> $out/nix-support/cc-cflags
echo "# Hack to include NANOS6_HOME" >> $out/nix-support/setup-hook # Setup NANOS6_HOME or NODES_HOME, based on the runtime.
echo "export NANOS6_HOME=${nanos6}" >> $out/nix-support/setup-hook echo "export ${homevar}=${rt}" >> $out/nix-support/setup-hook
wrap clang++ $wrapper $ccPath/clang++ wrap clang++ $wrapper $ccPath/clang++
''; '';

View File

@ -105,12 +105,14 @@ let
clangOmpss2 = appendPasstru ( clangOmpss2 = appendPasstru (
callPackage ./bsc/llvm-ompss2/default.nix { callPackage ./bsc/llvm-ompss2/default.nix {
rt = bsc.nanos6;
llvmPackages = bsc.llvmPackages; llvmPackages = bsc.llvmPackages;
clangOmpss2Unwrapped = bsc.clangOmpss2Unwrapped; clangOmpss2Unwrapped = bsc.clangOmpss2Unwrapped;
}) { CC = "clang"; CXX = "clang++"; }; }) { CC = "clang"; CXX = "clang++"; };
clangOmpss2Git = appendPasstru ( clangOmpss2Git = appendPasstru (
callPackage ./bsc/llvm-ompss2/default.nix { callPackage ./bsc/llvm-ompss2/default.nix {
rt = bsc.nanos6;
llvmPackages = bsc.llvmPackages; llvmPackages = bsc.llvmPackages;
clangOmpss2Unwrapped = bsc.clangOmpss2UnwrappedGit; clangOmpss2Unwrapped = bsc.clangOmpss2UnwrappedGit;
}) { CC = "clang"; CXX = "clang++"; }; }) { CC = "clang"; CXX = "clang++"; };
@ -121,7 +123,7 @@ let
}; };
clangNodes = bsc.clangOmpss2.override { clangNodes = bsc.clangOmpss2.override {
nanos6 = bsc.nodes; rt = bsc.nodes;
}; };
stdenvClangNodes = self.stdenv.override { stdenvClangNodes = self.stdenv.override {
cc = bsc.clangNodes; cc = bsc.clangNodes;