bscpkgs/garlic/apps/creams/default.nix

58 lines
1.0 KiB
Nix
Raw Normal View History

2020-07-10 22:49:39 +08:00
{
stdenv
, nanos6
, mpi
, openmpi
, impi
2020-07-10 22:49:39 +08:00
, tampi
, mcxx
, gnuDef
, intelDef
, cc
2021-04-19 19:17:24 +08:00
, gitBranch ? "garlic/mpi+send+seq"
, gitCommit ? null
, garlicTools
2020-07-10 22:49:39 +08:00
}:
assert (mpi == impi || mpi == openmpi);
let
2021-04-19 19:17:24 +08: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 22:49:39 +08:00
};
2021-04-19 19:17:24 +08:00
in
stdenv.mkDerivation rec {
name = "creams";
2020-07-10 22:49:39 +08:00
2021-04-19 19:17:24 +08:00
inherit (gitSource) src gitBranch gitCommit;
2021-04-19 19:17:24 +08:00
programPath = "/bin/creams.exe";
2020-07-10 22:49:39 +08:00
2021-04-19 19:17:24 +08:00
buildInputs = [ nanos6 mpi cc tampi mcxx ];
2020-07-10 22:49:39 +08:00
2021-04-19 19:17:24 +08:00
configurePhase = ''
export TAMPI_HOME=${tampi}
2021-04-19 19:17:24 +08:00
. etc/bashrc
2021-04-19 19:17:24 +08:00
export FORTRAN_COMPILER=${compName}
export MPI_LIB=${mpiName}
2021-04-19 19:17:24 +08:00
CREAMS_UPDATE_ENVIRONMENT
'';
2020-07-10 22:49:39 +08:00
2021-04-19 19:17:24 +08:00
installPhase = ''
mkdir -p $out/bin
cp -a build/* $out/bin
'';
hardeningDisable = [ "all" ];
2021-04-19 19:17:24 +08:00
}