forked from rarias/bscpkgs
Compare commits
2 Commits
551b1b9e45
...
6e5e572ddb
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e5e572ddb | |||
| 439242f669 |
@@ -20,13 +20,19 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
getSplice = target: pkg: if pkg ? "__spliced" && pkg.__spliced ? target then pkg.__spliced."${target}" else pkg;
|
||||
#getSpliceTargetTarget = pkg: if pkg ? "__spliced" && pkg.__spliced ? "targetTarget" then pkg.__spliced.targetTarget 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 +55,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;
|
||||
@@ -76,9 +82,10 @@ in wrapCCWith {
|
||||
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
||||
'' + optionalString (ompss2rt != null) ''
|
||||
echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook
|
||||
echo "export ${homevar}=${ompss2rt.__spliced.targetTarget}" >> $out/nix-support/cc-wrapper-hook
|
||||
echo "export ${homevar}=${ompss2rt}" >> $out/nix-support/cc-wrapper-hook
|
||||
'' + optionalString (ompss2rt != null && ompss2rt.pname == "nodes") ''
|
||||
echo "export NOSV_HOME=${ompss2rt.nosv.__spliced.targetTarget}" >> $out/nix-support/cc-wrapper-hook
|
||||
echo "export NOSV_HOME=${ompss2rt}" >> $out/nix-support/cc-wrapper-hook
|
||||
'';
|
||||
}
|
||||
}) // { inherit ompss2rt; }
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user