forked from rarias/bscpkgs
Use explicit splicing in clang wrapper
This commit is contained in:
@@ -20,13 +20,18 @@
|
|||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
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;
|
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");
|
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
|
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 (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";
|
assert assertMsg (useNanos6 -> !useNodes) "Either Nanos6 or NODES may be enabled, but not both";
|
||||||
|
|
||||||
@@ -49,7 +54,7 @@ let
|
|||||||
inherit gcc;
|
inherit gcc;
|
||||||
cc = clangOmpss2Unwrapped;
|
cc = clangOmpss2Unwrapped;
|
||||||
gccVersion = with versions; let v = gcc.version; in concatStringsSep "." [(major v) (minor v) (patch v)];
|
gccVersion = with versions; let v = gcc.version; in concatStringsSep "." [(major v) (minor v) (patch v)];
|
||||||
in wrapCCWith {
|
in (wrapCCWith {
|
||||||
inherit cc bintools;
|
inherit cc bintools;
|
||||||
# extraPackages adds packages to depsTargetTargetPropagated
|
# extraPackages adds packages to depsTargetTargetPropagated
|
||||||
extraPackages = optional (omp != null) omp;
|
extraPackages = optional (omp != null) omp;
|
||||||
@@ -80,5 +85,4 @@ in wrapCCWith {
|
|||||||
'' + optionalString (ompss2rt != null && ompss2rt.pname == "nodes") ''
|
'' + optionalString (ompss2rt != null && ompss2rt.pname == "nodes") ''
|
||||||
echo "export NOSV_HOME=${ompss2rt.nosv}" >> $out/nix-support/cc-wrapper-hook
|
echo "export NOSV_HOME=${ompss2rt.nosv}" >> $out/nix-support/cc-wrapper-hook
|
||||||
'';
|
'';
|
||||||
}
|
}) // { inherit ompss2rt; }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user