bscpkgs/garlic/saiph/default.nix
2020-10-01 17:52:50 +02:00

62 lines
930 B
Nix

{
stdenv
, nanos6
, mpi
, tampi
, cc
, vtk
, boost
, gitBranch ? "master"
, numComm ? null
}:
stdenv.mkDerivation rec {
name = "saiph";
src = builtins.fetchGit {
url = "ssh://git@bscpm02.bsc.es/DSLs/saiph.git";
ref = "${gitBranch}";
};
#src = /tmp/saiph;
programPath = "/bin/ExHeat3D";
enableParallelBuilding = true;
dontStrip = true;
enableDebugging = true;
buildInputs = [
nanos6
mpi
tampi
cc
vtk
boost
];
# Required for nanos6
hardeningDisable = [ "bindnow" ];
preBuild = ''
cd saiphv2/cpp/src
export VTK_VERSION=8.2
export VTK_HOME=${vtk}
'';
makeFlags = [
"-f" "Makefile.${cc.cc.CC}"
"apps"
"APP=ExHeat3D"
( if (numComm != null) then "NUM_COMM=${toString numComm}" else "" )
];
installPhase = ''
mkdir -p $out/lib
mkdir -p $out/bin
cp obj/libsaiphv2.so $out/lib/
cp bin/ExHeat3D $out/bin/
'';
}