-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathflake.nix
More file actions
315 lines (254 loc) · 9.56 KB
/
Copy pathflake.nix
File metadata and controls
315 lines (254 loc) · 9.56 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
{
description = "A Shared-Memory and Distributed-Memory Parallel Graph Partitioner";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
lib = pkgs.lib;
stdenv = pkgs.stdenv;
kaminpar = stdenv.mkDerivation (finalAttrs: {
pname = "kaminpar";
version = "3.7.3";
src = self;
strictDeps = true;
nativeBuildInputs = builtins.attrValues {
inherit (pkgs) cmake mpi;
};
buildInputs = [ pkgs.gtest ] ++ lib.optional stdenv.hostPlatform.isLinux pkgs.numactl;
propagatedBuildInputs = builtins.attrValues {
inherit (pkgs) mpi tbb_2022_0;
inherit kagen kassert;
};
cmakeFlags = [
(lib.cmakeBool "KAMINPAR_BUILD_DISTRIBUTED" true)
(lib.cmakeBool "KAMINPAR_BUILD_WITH_MTUNE_NATIVE" false)
];
doCheck = true;
__darwinAllowLocalNetworking = true;
nativeCheckInputs = [ pkgs.mpiCheckPhaseHook ];
meta = {
description = "Parallel heuristic solver for the balanced k-way graph partitioning problem";
homepage = "https://github.com/KaHIP/KaMinPar";
changelog = "https://github.com/KaHIP/KaMinPar/releases/tag/v${finalAttrs.version}";
mainProgram = "KaMinPar";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
});
kagen = stdenv.mkDerivation (finalAttrs: {
pname = "kagen";
version = "1.1.0";
src = pkgs.fetchFromGitHub {
owner = "KarlsruheGraphGeneration";
repo = "KaGen";
rev = "5442f30b37f1e3ffd006d510c96e86de43d8d196";
fetchSubmodules = true;
hash = "sha256-bO0tLz9gZ10BidcxUEE2sRj6wWaBqhQb/87bopifTo4=";
};
nativeBuildInputs = builtins.attrValues {
inherit (pkgs) cmake pkg-config;
};
buildInputs = builtins.attrValues {
inherit (pkgs) imagemagick;
};
propagatedBuildInputs = builtins.attrValues {
inherit (pkgs) boost cgal gmp mpfr mpi sparsehash;
};
cmakeFlags = [
(lib.cmakeBool "KAGEN_BUILD_EXAMPLES" false)
(lib.cmakeBool "KAGEN_BUILD_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "KAGEN_USE_BUNDLED_GTEST" false)
];
doCheck = false;
__darwinAllowLocalNetworking = true;
nativeCheckInputs = with pkgs; [
gtest
ctestCheckHook
mpiCheckPhaseHook
];
disabledTests = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
# flaky tests on aarch64-darwin
"test_rgg2d.2cores"
"test_rgg2d.4cores"
];
meta = {
description = "Communication-free Massively Distributed Graph Generators";
homepage = "https://github.com/KarlsruheGraphGeneration/KaGen";
changelog = "https://github.com/KarlsruheGraphGeneration/KaGen/releases/tag/v${finalAttrs.version}";
mainProgram = "KaGen";
license = with lib.licenses; [
bsd2
mit
lib.licenses.boost
];
platforms = lib.platforms.unix;
};
});
kassert = stdenv.mkDerivation (finalAttrs: {
pname = "kassert";
version = "0.2.2";
src = pkgs.fetchFromGitHub {
owner = "kamping-site";
repo = "kassert";
tag = "v${finalAttrs.version}";
hash = "sha256-5UndFUhKtHPFPLfYP0EI/r+eoAptcQBheznALfxh27s=";
};
nativeBuildInputs = [ pkgs.cmake ];
cmakeFlags = [
# doc generation require git clone doxygen-awesome-css
(lib.cmakeBool "KASSERT_BUILD_DOCS" false)
(lib.cmakeBool "KASSERT_BUILD_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "KASSERT_USE_BUNDLED_GTEST" false)
];
doCheck = true;
nativeCheckInputs = [ pkgs.gtest ];
meta = {
description = "Karlsruhe assertion library for C++";
homepage = "https://kamping-site.github.io/kassert/";
changelog = "https://github.com/kamping-site/kasser/releases/tag/v${finalAttrs.version}";
license = with lib.licenses; [ mit ];
platforms = lib.platforms.unix;
};
});
kaminpar-python = pkgs.python3Packages.buildPythonPackage {
pname = "kaminpar";
version = "3.6.0";
pyproject = true;
src = "${self}/bindings/python";
build-system = builtins.attrValues {
inherit (pkgs.python3Packages) scikit-build-core pybind11;
};
nativeBuildInputs = builtins.attrValues {
inherit (pkgs) git pkg-config cmake ninja;
};
preBuild = lib.optionalString stdenv.hostPlatform.isDarwin ''
export CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_CXX_COMPILER_AR=$AR -DCMAKE_CXX_COMPILER_RANLIB=$RANLIB"
'';
buildInputs = [ kassert pkgs.tbb_2022_0 ] ++ lib.optional stdenv.hostPlatform.isLinux pkgs.numactl;
dontUseCmakeConfigure = true;
CMAKE_ARGS = [
(lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true)
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_KAMINPAR" "${self}")
];
meta = {
description = "Python Bindings for KaMinPar";
homepage = "https://github.com/KaHIP/KaMinPar";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
};
kaminpar-networkit = pkgs.python3Packages.buildPythonPackage {
pname = "kaminpar-networkit";
version = "3.6.0";
pyproject = true;
src = "${self}/bindings/networkit";
build-system = builtins.attrValues {
inherit (pkgs.python3Packages) scikit-build-core cython;
inherit cython-cmake;
};
nativeBuildInputs = builtins.attrValues {
inherit (pkgs) git pkg-config cmake ninja;
};
preBuild = lib.optionalString stdenv.hostPlatform.isDarwin ''
export CMAKE_ARGS="-DCMAKE_CXX_COMPILER_AR=$AR -DCMAKE_CXX_COMPILER_RANLIB=$RANLIB"
'';
buildInputs = [ pkgs.tbb_2022_0 ] ++ lib.optional stdenv.hostPlatform.isLinux pkgs.numactl;
dependencies = [ kassert networkit-python ];
dontUseCmakeConfigure = true;
CMAKE_ARGS = [
(lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true)
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_KAMINPAR" "${self}")
];
meta = {
description = "NetworKit Bindings for KaMinPar";
homepage = "https://github.com/KaHIP/KaMinPar";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
};
};
networkit-python = pkgs.python3Packages.buildPythonPackage {
pname = "networkit";
version = "11.1.post1";
pyproject = true;
src = pkgs.fetchFromGitHub {
owner = "networkit";
repo = "networkit";
rev = "39ef1be566b82e9afe4d98de3a272d1f255375fb";
fetchSubmodules = true;
hash = "sha256-D1scYeu4irbKZu4rtDATwJ6gMWFGPZZ5IO4O/2ZY8fA=";
};
build-system = builtins.attrValues {
inherit (pkgs.python3Packages) cython setuptools wheel;
};
nativeBuildInputs = builtins.attrValues {
inherit (pkgs) cmake ninja;
};
dependencies = builtins.attrValues {
inherit (pkgs.python3Packages) numpy scipy;
};
dontUseCmakeConfigure = true;
meta = {
description = "Toolbox for high-performance network analysis";
homepage = "https://networkit.github.io";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
};
};
cython-cmake = pkgs.python3Packages.buildPythonPackage {
pname = "cython-cmake";
version = "2.1.0";
pyproject = true;
src = pkgs.fetchFromGitHub {
owner = "scikit-build";
repo = "cython-cmake";
rev = "aef4790b3e896f505fdcb378f8570b5c18b5e335";
hash = "sha256-Rr5PaVx+zzYyC1dWOH4nuMSfqKrCALrRptXINp0mNrk=";
};
build-system = builtins.attrValues {
inherit (pkgs.python3Packages) hatchling hatch-vcs cython;
};
meta = {
description = "CMake helpers for building Cython modules";
homepage = "https://github.com/scikit-build/cython-cmake";
license = lib.licenses.asl20;
};
};
in
{
apps = rec {
default = KaMinPar;
KaMinPar = {
type = "app";
program = "${kaminpar}/bin/KaMinPar";
};
dKaMinPar = {
type = "app";
program = "${kaminpar}/bin/dKaMinPar";
};
};
devShells = {
default = pkgs.mkShell {
packages = builtins.attrValues {
# (d)KaMinPar inputs
inherit (pkgs) cmake gtest mpi numactl tbb_2022_0;
inherit kagen kassert;
# Development inputs
inherit (pkgs) ccache ninja mold-wrapped gdb dpkg rpm pre-commit gersemi;
inherit (pkgs.llvmPackages_20) clang-tools;
inherit (pkgs.python3Packages) build pybind11 ruff mypy;
};
};
python = pkgs.mkShell {
packages = [ kaminpar-python kaminpar-networkit ];
};
};
packages = {
default = kaminpar;
inherit kaminpar kaminpar-python kaminpar-networkit;
};
}
);
}