bscpkgs/garlic/apps/creams/default.nix

58 lines
1.0 KiB
Nix
Raw Normal View History

2020-07-10 16:49:39 +02:00
{
stdenv
, nanos6
, mpi
, openmpi
, impi
2020-07-10 16:49:39 +02:00
, tampi
, mcxx
, gnuDef
, intelDef
, 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
}:
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;
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
hardeningDisable = [ "all" ];
2021-04-19 13:17:24 +02:00
configurePhase = ''
export TAMPI_HOME=${tampi}
2021-04-19 13:17:24 +02:00
. etc/bashrc
2021-04-19 13:17:24 +02:00
export FORTRAN_COMPILER=${compName}
export MPI_LIB=${mpiName}
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
'';
}