Compare commits
2 Commits
93d9c770e8
...
169ec60e71
| Author | SHA1 | Date | |
|---|---|---|---|
| 169ec60e71 | |||
| b72fef45ff |
@ -9,12 +9,14 @@
|
|||||||
, ompss2rt ? null
|
, ompss2rt ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
usingNodesAndOmpv = (openmp.pname == "openmp-v" && ompss2rt.pname == "nodes");
|
usingNodesAndOmpv = (openmp.pname == "openmp-v" && ompss2rt.pname == "nodes");
|
||||||
sameNosv = openmp.nosv == ompss2rt.nosv;
|
sameNosv = openmp.nosv == ompss2rt.nosv;
|
||||||
in
|
in
|
||||||
|
|
||||||
assert lib.assertMsg (usingNodesAndOmpv -> sameNosv) "OpenMP-V and NODES must share the same nOS-V";
|
assert assertMsg (usingNodesAndOmpv -> sameNosv) "OpenMP-V and NODES must share the same nOS-V";
|
||||||
|
|
||||||
let
|
let
|
||||||
homevar = if ompss2rt.pname == "nanos6" then "NANOS6_HOME" else "NODES_HOME";
|
homevar = if ompss2rt.pname == "nanos6" then "NANOS6_HOME" else "NODES_HOME";
|
||||||
@ -34,11 +36,11 @@ let
|
|||||||
targetConfig = stdenv.targetPlatform.config;
|
targetConfig = stdenv.targetPlatform.config;
|
||||||
inherit gcc;
|
inherit gcc;
|
||||||
cc = clangOmpss2Unwrapped;
|
cc = clangOmpss2Unwrapped;
|
||||||
gccVersion = lib.strings.concatStringsSep "." [(lib.versions.major gcc.version) (lib.versions.minor gcc.version) (lib.versions.patch gcc.version)];
|
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 = lib.optional (openmp != null) openmp;
|
extraPackages = optional (openmp != null) openmp;
|
||||||
extraBuildCommands = ''
|
extraBuildCommands = ''
|
||||||
echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
|
echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
|
||||||
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gccVersion}" >> $out/nix-support/cc-cflags
|
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gccVersion}" >> $out/nix-support/cc-cflags
|
||||||
@ -56,12 +58,12 @@ in wrapCCWith {
|
|||||||
|
|
||||||
wrap clang++ $wrapper $ccPath/clang++
|
wrap clang++ $wrapper $ccPath/clang++
|
||||||
|
|
||||||
'' + lib.optionalString (openmp != null) ''
|
'' + optionalString (openmp != null) ''
|
||||||
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
echo "export OPENMP_RUNTIME=${ompname}" >> $out/nix-support/cc-wrapper-hook
|
||||||
'' + lib.optionalString (ompss2rt != null) ''
|
'' + optionalString (ompss2rt != null) ''
|
||||||
echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook
|
echo "export OMPSS2_RUNTIME=${rtname}" >> $out/nix-support/cc-wrapper-hook
|
||||||
echo "export ${homevar}=${ompss2rt}" >> $out/nix-support/cc-wrapper-hook
|
echo "export ${homevar}=${ompss2rt}" >> $out/nix-support/cc-wrapper-hook
|
||||||
'' + lib.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
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user