nixpkgs/pkgs/applications/misc/firestarter/default.nix

107 lines
2.3 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, fetchFromGitHub
, fetchzip
, addOpenGLRunpath
, cmake
, glibc_multi
, glibc
, git
, pkg-config
, cudatoolkit
, withCuda ? false
2019-08-07 19:48:50 +00:00
}:
let
hwloc = stdenv.mkDerivation rec {
pname = "hwloc";
version = "2.2.0";
src = fetchzip {
url = "https://download.open-mpi.org/release/hwloc/v${lib.versions.majorMinor version}/hwloc-${version}.tar.gz";
sha256 = "1ibw14h9ppg8z3mmkwys8vp699n85kymdz20smjd2iq9b67y80b6";
};
configureFlags = [
"--enable-static"
"--disable-libudev"
"--disable-shared"
"--disable-doxygen"
"--disable-libxml2"
"--disable-cairo"
"--disable-io"
"--disable-pci"
"--disable-opencl"
"--disable-cuda"
"--disable-nvml"
"--disable-gl"
"--disable-libudev"
"--disable-plugin-dlopen"
"--disable-plugin-ltdl"
];
nativeBuildInputs = [ pkg-config ];
enableParallelBuilding = true;
outputs = [ "out" "lib" "dev" "doc" "man" ];
};
in
2019-08-07 19:48:50 +00:00
stdenv.mkDerivation rec {
pname = "firestarter";
version = "2.0";
2019-08-07 19:48:50 +00:00
src = fetchFromGitHub {
owner = "tud-zih-energy";
repo = "FIRESTARTER";
rev = "v${version}";
sha256 = "1ik6j1lw5nldj4i3lllrywqg54m9i2vxkxsb2zr4q0d2rfywhn23";
fetchSubmodules = true;
2019-08-07 19:48:50 +00:00
};
nativeBuildInputs = [
cmake
git
pkg-config
] ++ lib.optionals withCuda [
addOpenGLRunpath
];
buildInputs = [ hwloc ] ++ (if withCuda then
[ glibc_multi cudatoolkit ]
else
[ glibc.static ]);
NIX_LDFLAGS = lib.optionals withCuda [
"-L${cudatoolkit}/lib/stubs"
];
cmakeFlags = [
"-DFIRESTARTER_BUILD_HWLOC=OFF"
"-DCMAKE_C_COMPILER_WORKS=1"
"-DCMAKE_CXX_COMPILER_WORKS=1"
] ++ lib.optionals withCuda [
"-DFIRESTARTER_BUILD_TYPE=FIRESTARTER_CUDA"
];
2019-08-07 19:48:50 +00:00
installPhase = ''
runHook preInstall
2019-08-07 19:48:50 +00:00
mkdir -p $out/bin
cp src/FIRESTARTER${lib.optionalString withCuda "_CUDA"} $out/bin/
runHook postInstall
'';
postFixup = lib.optionalString withCuda ''
addOpenGLRunpath $out/bin/FIRESTARTER_CUDA
2019-08-07 19:48:50 +00:00
'';
meta = with lib; {
homepage = "https://tu-dresden.de/zih/forschung/projekte/firestarter";
2019-08-07 19:48:50 +00:00
description = "Processor Stress Test Utility";
platforms = platforms.linux;
2020-07-06 13:46:46 +00:00
maintainers = with maintainers; [ astro marenz ];
2019-08-07 19:48:50 +00:00
license = licenses.gpl3;
};
}