-
Notifications
You must be signed in to change notification settings - Fork 25
/
derivation.nix
75 lines (62 loc) · 1.49 KB
/
derivation.nix
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{ stdenv
, lib
, cmake
, glibc_multi
, glibc
, git
, pkgconfig
, cudatoolkit
, withCuda ? false
, linuxPackages
}:
let
hwloc = stdenv.mkDerivation rec {
name = "hwloc";
src = fetchTarball {
url = https://download.open-mpi.org/release/hwloc/v2.7/hwloc-2.7.0.tar.gz;
sha256 = "0gii1b8m5c5x6zan66m5hbbzqhmxn5sfkl879xxrf3gb2gxf9mi9";
};
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 = [ pkgconfig ];
enableParalellBuilding = true;
outputs = [ "out" "lib" "dev" "doc" "man" ];
};
in
stdenv.mkDerivation rec {
name = "firestarter";
version = "0.0";
src = ./.;
nativeBuildInputs = [ cmake git pkgconfig ];
buildInputs = if withCuda then
[ glibc_multi cudatoolkit linuxPackages.nvidia_x11 hwloc ]
else
[ glibc.static hwloc ];
cmakeFlags = [
"-DFIRESTARTER_BUILD_HWLOC=OFF"
"-DCMAKE_C_COMPILER_WORKS=1"
"-DCMAKE_CXX_COMPILER_WORKS=1"
] ++ lib.optionals withCuda [
"-DFIRESTARTER_BUILD_TYPE=FIRESTARTER_CUDA"
];
enableParalellBuilding = true;
installPhase = ''
mkdir -p $out/bin
cp src/FIRESTARTER${lib.optionalString withCuda ''_CUDA''} $out/bin/
'';
}