bscpkgs/garlic/apps/ifsker/default.nix

61 lines
1.1 KiB
Nix
Raw Normal View History

2020-12-03 18:49:28 +01:00
{
stdenv
2022-09-01 16:27:29 +02:00
, lib
2020-12-03 18:49:28 +01:00
, mpi
, gfortran
, tampi
, nanos6
, mcxx
2021-03-21 17:54:37 +01:00
, gitBranch ? "garlic/mpi+isend+seq"
2021-04-20 18:20:27 +02:00
, gitCommit ? null
, garlicTools
2020-12-03 18:49:28 +01:00
}:
2022-09-01 16:27:29 +02:00
with lib;
2020-12-03 18:49:28 +01:00
2021-04-20 18:20:27 +02:00
let
gitSource = garlicTools.fetchGarlicApp {
appName = "ifsker";
inherit gitCommit gitBranch;
gitTable = import ./git-table.nix;
2020-12-03 18:49:28 +01:00
};
2021-04-20 18:20:27 +02:00
in
stdenv.mkDerivation rec {
name = "ifsker";
inherit (gitSource) src gitBranch gitCommit;
2020-12-03 18:49:28 +01:00
2021-04-20 18:20:27 +02:00
buildInputs = [ tampi mpi nanos6 mcxx gfortran ];
2020-12-03 18:49:28 +01:00
2021-04-20 18:20:27 +02:00
# Mercurium seems to fail when building with fortran in parallel
enableParallelBuilding = false;
2020-12-03 18:49:28 +01:00
2021-04-20 18:20:27 +02:00
# FIXME: Patch mcxx to use other directory than $HOME for the lock
# files.
preConfigure = ''
export TAMPI_HOME=${tampi}
2020-12-03 18:49:28 +01:00
2021-04-20 18:20:27 +02:00
# $HOME is required for the lock files by mcxx to compile fortran.
# So we use the $TMPDIR to store them.
export HOME=$TMPDIR
'';
2020-12-03 18:49:28 +01:00
2021-04-20 18:20:27 +02:00
makeFlags = [
"-f" "Makefile.gcc"
];
2020-12-03 18:49:28 +01:00
2021-04-20 18:20:27 +02:00
installPhase = ''
mkdir -p $out/bin
cp ${name} $out/bin/
2021-03-21 17:54:37 +01:00
2021-04-20 18:20:27 +02:00
mkdir -p $out/etc
cp -r data $out/etc/
cp nanos6.toml $out/etc
'';
2020-12-03 18:49:28 +01:00
2021-04-20 18:20:27 +02:00
programPath = "/bin/${name}";
2020-12-03 18:49:28 +01:00
hardeningDisable = [ "all" ];
2021-04-20 18:20:27 +02:00
}