bscpkgs/garlic/apps/saiph/default.nix

92 lines
2.0 KiB
Nix
Raw Normal View History

2020-06-30 18:19:36 +08:00
{
stdenv
, nanos6
, mpi
, tampi
2020-09-23 19:10:12 +08:00
, cc
2020-06-30 18:19:36 +08:00
, vtk
, boost
2020-09-21 23:30:24 +08:00
, gitBranch ? "master"
2021-02-23 18:51:07 +08:00
, gitCommit ? null
2020-09-21 23:30:24 +08:00
, numComm ? null
, manualDist ? 0
, nbgx ? null
, nbgy ? null
, nbgz ? null
, nblx ? null
, nbly ? null
, nblz ? null
, nbltotal ? null
2021-02-19 18:18:11 +08:00
, nsteps ? null
, vectFlags ? null
2021-03-12 19:37:34 +08:00
, debugFlags ? null
, asanFlags ? null
, cachelineBytes ? 64
2020-06-30 18:19:36 +08:00
}:
with stdenv.lib;
2020-06-30 18:19:36 +08:00
stdenv.mkDerivation rec {
2020-07-02 20:47:10 +08:00
name = "saiph";
2020-06-30 18:19:36 +08:00
2021-02-23 18:51:07 +08:00
inherit gitBranch gitCommit;
src = builtins.fetchGit ({
2020-12-07 20:47:17 +08:00
url = "ssh://git@bscpm03.bsc.es/DSLs/saiph.git";
2020-11-13 02:10:43 +08:00
ref = "${gitBranch}";
2021-02-23 18:51:07 +08:00
} // (if (gitCommit != null) then {
rev = gitCommit;
} else {}));
2020-06-30 18:19:36 +08:00
programPath = "/bin/Heat3D_vect";
2020-06-30 18:19:36 +08:00
2020-09-22 01:23:17 +08:00
enableParallelBuilding = true;
2020-07-02 20:47:10 +08:00
dontStrip = true;
enableDebugging = true;
2020-06-30 18:19:36 +08:00
buildInputs = [
nanos6
mpi
tampi
2020-09-23 19:10:12 +08:00
cc
2020-06-30 18:19:36 +08:00
vtk
boost
# breakpointHook
2020-06-30 18:19:36 +08:00
];
2020-09-22 01:23:17 +08:00
# Required for nanos6
hardeningDisable = [ "bindnow" ];
2020-09-21 23:30:24 +08:00
preBuild = ''
cd saiphv2/cpp/src
2020-07-02 20:47:10 +08:00
export VTK_VERSION=8.2
export VTK_HOME=${vtk}
2020-11-13 02:10:43 +08:00
make clean
'';
2020-06-30 18:19:36 +08:00
makeFlags = [
2020-12-04 01:06:51 +08:00
"-f" "Makefile.${cc.CC}"
"apps"
"APP=Heat3D_vect"
"ROW_ALIGNMENT=${toString cachelineBytes}"
] ++ optional (manualDist != 0) "DIST_SET=${toString manualDist}"
++ optional (manualDist != 0) "NBG_X=${toString nbgx}"
++ optional (manualDist != 0) "NBG_Y=${toString nbgy}"
++ optional (manualDist != 0) "NBG_Z=${toString nbgz}"
++ optional (nblx != null) "NBL_X=${toString nblx}"
++ optional (nbly != null) "NBL_Y=${toString nbly}"
++ optional (nblz != null) "NBL_Z=${toString nblz}"
2021-02-19 18:18:11 +08:00
++ optional (nsteps != null) "NSTEPS=${toString nsteps}"
++ optional (numComm != null) "NUM_COMM=${toString numComm}"
2021-03-12 19:37:34 +08:00
++ optional (vectFlags != null) "VECT_CHECKS=${toString vectFlags}"
++ optional (debugFlags != null) "DEBUG_CHECKS=${toString debugFlags}"
++ optional (asanFlags != null) "SANITIZE_CHECKS=${toString asanFlags}"
;
2020-06-30 18:19:36 +08:00
installPhase = ''
2020-07-02 20:47:10 +08:00
mkdir -p $out/lib
2020-06-30 18:19:36 +08:00
mkdir -p $out/bin
2020-07-02 20:47:10 +08:00
cp obj/libsaiphv2.so $out/lib/
cp bin/Heat3D_vect $out/bin/
2020-06-30 18:19:36 +08:00
'';
}