bscpkgs/garlic/apps/creams/default.nix

68 lines
929 B
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
, gitBranch
2020-07-10 22:49:39 +08: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 22:49:39 +08:00
stdenv.mkDerivation rec {
name = "creams";
# src = /home/Computational/pmartin1/creams-simplified;
2020-07-10 22:49:39 +08:00
src = builtins.fetchGit {
url = "ssh://git@bscpm02.bsc.es/pmartin1/creams-simplified.git";
ref = "${gitBranch}";
2020-07-10 22:49:39 +08:00
};
programPath = "/bin/creams.exe";
2020-07-10 22:49:39 +08:00
buildInputs = [
nanos6
mpi
cc
2020-07-10 22:49:39 +08:00
tampi
mcxx
];
hardeningDisable = [ "all" ];
2020-07-10 23:02:33 +08:00
configurePhase = ''
2020-07-10 22:49:39 +08:00
export TAMPI_HOME=${tampi}
2020-07-10 22:49:39 +08:00
. etc/bashrc
export FORTRAN_COMPILER=${compName}
export MPI_LIB=${mpiName}
echo
CREAMS_UPDATE_ENVIRONMENT
2020-07-10 22:49:39 +08:00
'';
installPhase = ''
mkdir -p $out/bin
cp -a build/* $out/bin
'';
}