bscpkgs/bsc/garlic/nbody/default.nix

45 lines
726 B
Nix
Raw Normal View History

2020-07-27 17:55:56 +02:00
{
stdenv
, cc
2020-08-17 18:50:18 +02:00
, mpi ? null
2020-07-27 17:55:56 +02:00
, cflags ? null
, gitBranch
2020-08-25 18:37:50 +02:00
, gitURL ? "ssh://git@bscpm02.bsc.es/garlic/apps/nbody.git"
2020-08-04 18:38:33 +02:00
, blocksize ? 2048
2020-07-27 17:55:56 +02:00
}:
2020-08-17 18:50:18 +02:00
with stdenv.lib;
2020-08-12 14:00:04 +02:00
stdenv.mkDerivation rec {
2020-07-27 17:55:56 +02:00
name = "nbody";
2020-09-02 17:07:09 +02:00
src = /home/Computational/rarias/bscpkgs/manual/nbody;
2020-09-02 10:44:13 +02:00
#src = builtins.fetchGit {
# url = "${gitURL}";
# ref = "${gitBranch}";
#};
2020-09-02 17:07:09 +02:00
programPath = "/bin/nbody";
2020-07-27 17:55:56 +02:00
buildInputs = [
cc
2020-08-17 18:50:18 +02:00
]
++ optional (mpi != null) [ mpi ];
2020-07-27 17:55:56 +02:00
preBuild = (if cflags != null then ''
2020-07-27 19:13:11 +02:00
makeFlagsArray+=(CFLAGS="${cflags}")
2020-07-27 17:55:56 +02:00
'' else "");
makeFlags = [
"CC=${cc.cc.CC}"
2020-08-04 18:38:33 +02:00
"BS=${toString blocksize}"
2020-07-27 17:55:56 +02:00
];
dontPatchShebangs = true;
2020-07-27 17:55:56 +02:00
installPhase = ''
mkdir -p $out/bin
2020-08-12 14:00:04 +02:00
cp nbody* $out/bin/${name}
2020-07-27 17:55:56 +02:00
'';
}