bscpkgs/garlic/apps/creams/default.nix

68 lines
929 B
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
, gitBranch
2020-07-10 16:49:39 +02:00
}:
assert (mpi == impi || mpi == openmpi);
let
mpiName = (if mpi == openmpi then
"OpenMPI"
else
"IntelMPI");
compName = (if cc == intelDef then
"Intel"
else
"GNU");
in
2020-07-10 16:49:39 +02:00
stdenv.mkDerivation rec {
name = "creams";
# src = /home/Computational/pmartin1/creams-simplified;
2020-07-10 16:49:39 +02:00
src = builtins.fetchGit {
2020-12-07 13:47:17 +01:00
url = "ssh://git@bscpm03.bsc.es/pmartin1/creams-simplified.git";
ref = "${gitBranch}";
2020-07-10 16:49:39 +02:00
};
programPath = "/bin/creams.exe";
2020-07-10 16:49:39 +02:00
buildInputs = [
nanos6
mpi
cc
2020-07-10 16:49:39 +02:00
tampi
mcxx
];
hardeningDisable = [ "all" ];
2020-07-10 17:02:33 +02:00
configurePhase = ''
2020-07-10 16:49:39 +02:00
export TAMPI_HOME=${tampi}
2020-07-10 16:49:39 +02:00
. etc/bashrc
export FORTRAN_COMPILER=${compName}
export MPI_LIB=${mpiName}
echo
CREAMS_UPDATE_ENVIRONMENT
2020-07-10 16:49:39 +02:00
'';
installPhase = ''
mkdir -p $out/bin
cp -a build/* $out/bin
'';
}