blob: 7c198414eaacf910c9c53e9b068c2cbb101c21bc (
plain)
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
|
{ pkgs ? (import <nixpkgs> {})
, llvmPackages ? pkgs.llvmPackages_19
, stdenv ? llvmPackages.stdenv
, clang-tools ? llvmPackages.clang-tools
}:
let
glad_opengl_33_core = stdenv.mkDerivation {
pname = "glad_opengl_33_core";
version = "0.0.1";
dontUnpack = true;
nativeBuildInputs = [
pkgs.python312Packages.glad2
];
buildPhase = ''
mkdir -p glad_out
glad \
--api gl:core=3.3 \
--out-path glad_out \
--reproducible \
c
mkdir -p glad_out/lib
cc -Iglad_out/include -fPIC -shared -o glad_out/lib/libgl.so glad_out/src/gl.c
'';
installPhase = ''
mv glad_out $out
'';
};
adaptive-cpp = pkgs.callPackage .nix/adaptive-cpp.nix {
inherit stdenv;
llvmPackages = pkgs.llvmPackages_19;
lld = pkgs.lld_19;
};
sci_tools = let
scitoolsSrc = stdenv.mkDerivation {
name = "scitools-src";
src = builtins.fetchurl {
url = "https://git.keldu.de/apps-science_tools/snapshot/master.tar.gz";
sha256 = "e91c18fef798dd7b3afbd1615c2e320b90a74aa2d7ef726801a76e3f7f77ae81";
};
phases = [ "unpackPhase" "installPhase" ];
unpackPhase = ''
mkdir source
tar -xzf "$src" -C source --strip-components=1
'';
installPhase = ''
cp -r source $out
'';
};
in
(import "${scitoolsSrc}/default.nix" {
inherit stdenv clang-tools forstio;
});
forstio = let
forstioSrc = stdenv.mkDerivation {
name = "forstio-src";
src = builtins.fetchurl {
url = "https://git.keldu.de/forstio-forstio/snapshot/master.tar.gz";
sha256 = "e91c18fef798dd7b3afbd1615c2e320b90d74aa2d7ef726801a76e3f7f77ae81";
};
phases = [ "unpackPhase" "installPhase" ];
unpackPhase = ''
mkdir source
tar -xzf "$src" -C source --strip-components=1
'';
installPhase = ''
cp -r source $out
'';
};
in
(import "${forstioSrc}/default.nix" {
inherit stdenv clang-tools adaptive-cpp;
}).forstio;
pname = "kel-lbm";
version = "0.0.5";
in rec {
kel = {
lbm = {
core = pkgs.callPackage ./lib/core/.nix/derivation.nix {
inherit forstio stdenv clang-tools pname version;
};
sycl = pkgs.callPackage ./lib/sycl/.nix/derivation.nix {
inherit forstio stdenv clang-tools pname version kel adaptive-cpp;
};
};
};
util = {
lbm_ogl_renderer = pkgs.callPackage ./util/ogl_renderer/.nix/derivation.nix {
inherit forstio stdenv clang-tools pname version kel;
kel-glad = glad_opengl_33_core;
};
};
examples = {
cavity_2d_gpu = pkgs.callPackage ./examples/cavity_2d_gpu/.nix/derivation.nix {
inherit pname version stdenv forstio adaptive-cpp;
inherit kel;
};
poiseulle_2d_gpu = pkgs.callPackage ./examples/poiseulle_2d_gpu/.nix/derivation.nix {
inherit pname version stdenv forstio adaptive-cpp;
inherit kel;
};
cavity_2d = pkgs.callPackage ./examples/cavity_2d/.nix/derivation.nix {
inherit pname version stdenv forstio;
inherit kel;
};
meta_2d = pkgs.callPackage ./examples/meta_2d/.nix/derivation.nix {
inherit pname version stdenv forstio;
inherit kel;
};
planetary_3d = pkgs.callPackage ./examples/planetary_3d/.nix/derivation.nix {
inherit pname version stdenv forstio adaptive-cpp;
inherit kel;
};
poiseulle_2d = pkgs.callPackage ./examples/poiseulle_3d/.nix/derivation.nix {
inherit pname version stdenv forstio;
inherit kel;
};
poiseulle_particles_2d_gpu = pkgs.callPackage ./examples/poiseulle_particles_2d_gpu/.nix/derivation.nix {
inherit pname version stdenv forstio adaptive-cpp;
inherit kel;
};
s_poiseulle_particles_2d_gpu = pkgs.callPackage ./examples/s_poiseulle_particles_2d_gpu/.nix/derivation.nix {
inherit pname version stdenv forstio adaptive-cpp;
inherit kel;
};
poiseulle_3d = pkgs.callPackage ./examples/poiseulle_3d/.nix/derivation.nix {
inherit pname version stdenv forstio adaptive-cpp;
inherit kel;
};
particles_gpu = pkgs.callPackage ./examples/particles_gpu/.nix/derivation.nix {
inherit pname version stdenv forstio adaptive-cpp;
inherit kel;
};
heterogeneous_computing = pkgs.callPackage ./examples/heterogeneous_computing/.nix/derivation.nix {
inherit pname version stdenv forstio adaptive-cpp;
inherit kel;
};
};
debug = {
inherit adaptive-cpp;
};
release = {
dev = {
inherit kel;
};
examples = pkgs.symlinkJoin {
name = "kel-lbm-sims-${version}";
paths = [
kel.lbm.core
kel.lbm.sycl
examples.poiseulle_particles_2d_gpu
];
};
};
default = release.examples;
}
|