2020-07-10 16:49:39 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, nanos6
|
|
|
|
, mpi
|
2020-09-30 17:32:49 +02:00
|
|
|
, openmpi
|
|
|
|
, impi
|
2020-07-10 16:49:39 +02:00
|
|
|
, tampi
|
|
|
|
, mcxx
|
2020-10-01 16:48:35 +02:00
|
|
|
, gnuDef
|
|
|
|
, intelDef
|
2020-09-30 17:32:49 +02:00
|
|
|
, cc
|
2021-04-19 13:17:24 +02:00
|
|
|
, gitBranch ? "garlic/mpi+send+seq"
|
|
|
|
, gitCommit ? null
|
|
|
|
, garlicTools
|
2020-07-10 16:49:39 +02:00
|
|
|
}:
|
|
|
|
|
2020-09-30 17:32:49 +02:00
|
|
|
assert (mpi == impi || mpi == openmpi);
|
|
|
|
|
|
|
|
let
|
2021-04-19 13:17:24 +02:00
|
|
|
# FIXME: We should find a better way to specify the MPI implementation
|
|
|
|
# and the compiler.
|
|
|
|
mpiName = if mpi == openmpi then "OpenMPI" else "IntelMPI";
|
|
|
|
compName = if cc == intelDef then "Intel" else "GNU";
|
|
|
|
|
|
|
|
gitSource = garlicTools.fetchGarlicApp {
|
|
|
|
appName = "creams";
|
|
|
|
inherit gitCommit gitBranch;
|
|
|
|
gitTable = import ./git-table.nix;
|
2020-07-10 16:49:39 +02:00
|
|
|
};
|
2021-04-19 13:17:24 +02:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "creams";
|
2020-07-10 16:49:39 +02:00
|
|
|
|
2021-04-19 13:17:24 +02:00
|
|
|
inherit (gitSource) src gitBranch gitCommit;
|
2020-09-30 17:32:49 +02:00
|
|
|
|
2021-04-19 13:17:24 +02:00
|
|
|
programPath = "/bin/creams.exe";
|
2020-07-10 16:49:39 +02:00
|
|
|
|
2021-04-19 13:17:24 +02:00
|
|
|
buildInputs = [ nanos6 mpi cc tampi mcxx ];
|
2020-07-10 16:49:39 +02:00
|
|
|
|
2021-04-19 13:17:24 +02:00
|
|
|
configurePhase = ''
|
|
|
|
export TAMPI_HOME=${tampi}
|
2020-10-01 16:48:35 +02:00
|
|
|
|
2021-04-19 13:17:24 +02:00
|
|
|
. etc/bashrc
|
2020-09-30 17:32:49 +02:00
|
|
|
|
2021-04-19 13:17:24 +02:00
|
|
|
export FORTRAN_COMPILER=${compName}
|
|
|
|
export MPI_LIB=${mpiName}
|
2020-09-30 17:32:49 +02:00
|
|
|
|
2021-04-19 13:17:24 +02:00
|
|
|
CREAMS_UPDATE_ENVIRONMENT
|
|
|
|
'';
|
2020-07-10 16:49:39 +02:00
|
|
|
|
2021-04-19 13:17:24 +02:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -a build/* $out/bin
|
|
|
|
'';
|
2021-04-06 19:19:24 +02:00
|
|
|
|
|
|
|
hardeningDisable = [ "all" ];
|
2021-04-19 13:17:24 +02:00
|
|
|
}
|