diff --git a/pkgs/llvm-ompss2/default.nix b/pkgs/llvm-ompss2/default.nix index d7442e4..41b5a50 100644 --- a/pkgs/llvm-ompss2/default.nix +++ b/pkgs/llvm-ompss2/default.nix @@ -20,13 +20,18 @@ with lib; let + getSplice = target: pkg: if pkg ? "__spliced" && pkg.__spliced ? "${target}" then pkg.__spliced."${target}" else pkg; + getSpliceTargetTarget = getSplice "targetTarget"; omp = if useOpenmp then openmp else if useOpenmpV then openmpv else null; - ompss2rt = if useNanos6 then nanos6 else if useNodes then nodes else null; + ompss2rtUnspliced = if useNanos6 then nanos6 else if useNodes then nodes else null; + ompss2rt = getSpliceTargetTarget ompss2rtUnspliced; usingNodesAndOmpv = (omp.pname == "openmp-v" && ompss2rt.pname == "nodes"); - sameNosv = omp.nosv == ompss2rt.nosv; + sameNosvUnspliced = omp.nosv == ompss2rtUnspliced.nosv; + sameNosvSpliced = (getSpliceTargetTarget omp.nosv) == ompss2rt.nosv; in -assert assertMsg (usingNodesAndOmpv -> sameNosv) "OpenMP-V and NODES must share the same nOS-V"; +assert assertMsg (usingNodesAndOmpv -> sameNosvUnspliced) "OpenMP-V and NODES must share the same nOS-V before splice"; +assert assertMsg (usingNodesAndOmpv -> sameNosvSpliced) "OpenMP-V and NODES must share the same nOS-V after splice"; assert assertMsg (useOpenmp -> !useOpenmpV) "Either OpenMP or OpenMP-V may be enabled, but not both"; assert assertMsg (useNanos6 -> !useNodes) "Either Nanos6 or NODES may be enabled, but not both"; @@ -49,7 +54,7 @@ let inherit gcc; cc = clangOmpss2Unwrapped; gccVersion = with versions; let v = gcc.version; in concatStringsSep "." [(major v) (minor v) (patch v)]; -in wrapCCWith { +in (wrapCCWith { inherit cc bintools; # extraPackages adds packages to depsTargetTargetPropagated extraPackages = optional (omp != null) omp; @@ -80,5 +85,4 @@ in wrapCCWith { '' + optionalString (ompss2rt != null && ompss2rt.pname == "nodes") '' echo "export NOSV_HOME=${ompss2rt.nosv}" >> $out/nix-support/cc-wrapper-hook ''; -} - +}) // { inherit ompss2rt; }