2020-07-24 13:24:30 +02:00
|
|
|
{
|
|
|
|
stdenv
|
|
|
|
, mpi
|
|
|
|
, fetchurl
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "ppong";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.csl.mtu.edu/cs4331/common/PPong.c";
|
|
|
|
sha256 = "0d1w72gq9627448cb7ykknhgp2wszwd117dlbalbrpf7d0la8yc0";
|
|
|
|
};
|
|
|
|
|
2020-07-24 15:30:28 +02:00
|
|
|
unpackCmd = ''
|
|
|
|
mkdir src
|
|
|
|
cp $src src/ppong.c
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontConfigure = true;
|
2020-07-24 13:24:30 +02:00
|
|
|
|
|
|
|
buildPhase = ''
|
2020-07-24 15:30:28 +02:00
|
|
|
echo mpicc -include stdlib.h ppong.c -o ppong
|
|
|
|
mpicc -include stdlib.h ppong.c -o ppong
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ppong $out/bin/ppong
|
|
|
|
ln -s $out/bin/ppong $out/bin/run
|
2020-07-24 13:24:30 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ mpi ];
|
2021-04-06 19:19:24 +02:00
|
|
|
hardeningDisable = [ "all" ];
|
2020-07-24 13:24:30 +02:00
|
|
|
}
|