about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/firestarter/default.nix
blob: e93d0ab69a7b87527f9a7bbb4bd726517b7fee83 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ stdenv, fetchFromGitHub, python3, cudatoolkit,
  withCuda ? true
}:

with stdenv.lib;
stdenv.mkDerivation rec {
  pname = "firestarter";
  version = "1.7.3";

  src = fetchFromGitHub {
    owner = "tud-zih-energy";
    repo = "FIRESTARTER";
    rev = "v${version}";
    sha256 = "1gc7kmzx9nw22lyfmpyz72p974jf1hvw5nvszcaq7x6h8cz9ip15";
  };

  nativeBuildInputs = [ python3 ];
  buildInputs = optionals withCuda [ cudatoolkit ];
  preBuild = ''
    mkdir -p build
    cd build
    python ../code-generator.py ${optionalString withCuda "--enable-cuda"}
  '';
  makeFlags = optionals withCuda [ "LINUX_CUDA_PATH=${cudatoolkit}" ];
  enableParallelBuilding = true;

  installPhase = ''
    mkdir -p $out/bin
    cp FIRESTARTER $out/bin/firestarter
  '';

  meta = with stdenv.lib; {
    homepage = https://tu-dresden.de/zih/forschung/projekte/firestarter;
    description = "Processor Stress Test Utility";
    platforms = platforms.linux;
    maintainers = with maintainers; [ astro ];
    license = licenses.gpl3;
  };
}