bscpkgs/garlic/saiph/default.nix

71 lines
1.1 KiB
Nix
Raw Normal View History

2020-06-30 12:19:36 +02:00
{
stdenv
, nanos6
, mpi
, tampi
, mcxx
, vtk
, boost
2020-09-21 17:30:24 +02:00
, gitBranch ? "master"
, numComm ? null
2020-06-30 12:19:36 +02:00
}:
stdenv.mkDerivation rec {
2020-07-02 14:47:10 +02:00
name = "saiph";
2020-06-30 12:19:36 +02:00
src = builtins.fetchGit {
url = "ssh://git@bscpm02.bsc.es/DSLs/saiph.git";
2020-09-21 17:30:24 +02:00
ref = "${gitBranch}";
};
2020-06-30 12:19:36 +02:00
#src = /tmp/saiph;
2020-09-21 17:30:24 +02:00
programPath = "/bin/ExHeat3D";
2020-06-30 12:19:36 +02:00
2020-09-21 17:30:24 +02:00
enableParallelBuilding = false;
2020-07-02 14:47:10 +02:00
dontStrip = true;
enableDebugging = true;
2020-06-30 12:19:36 +02:00
buildInputs = [
nanos6
mpi
tampi
mcxx
vtk
boost
];
2020-09-21 17:30:24 +02:00
hardeningDisable = [ "all" ];
hardeningEnable = [ "stackprotector" ];
postPatch = ''
sed -i 's/^SANITIZE_FLAGS=/SANITIZE_FLAGS=$(DEBUG_FLAGS)/g' \
saiphv2/cpp/src/Makefile.clang
'';
preBuild = ''
2020-06-30 12:19:36 +02:00
cd saiphv2/cpp/src
2020-07-02 14:47:10 +02:00
export VTK_VERSION=8.2
export VTK_HOME=${vtk}
2020-09-21 17:30:24 +02:00
export BOOST_HOME=${boost}
2020-07-02 14:47:10 +02:00
export SAIPH_HOME=.
2020-06-30 12:19:36 +02:00
'';
makeFlags = [
"-f" "Makefile.clang"
"apps"
2020-09-21 17:30:24 +02:00
"APP=ExHeat3D"
( if (numComm != null) then "NUM_COMM=${toString numComm}" else "" )
];
2020-06-30 12:19:36 +02:00
installPhase = ''
2020-07-02 14:47:10 +02:00
mkdir -p $out/lib
2020-06-30 12:19:36 +02:00
mkdir -p $out/bin
2020-07-02 14:47:10 +02:00
cp obj/libsaiphv2.so $out/lib/
2020-09-21 17:30:24 +02:00
cp bin/ExHeat3D $out/bin/
2020-06-30 12:19:36 +02:00
'';
}