summaryrefslogtreecommitdiff
path: root/default.nix
blob: a63a5e766b2cbf0bcaa51cb7ab67fa0b156d7606 (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
{ pkgs ? import <nixpkgs> {}
, stdenv ? pkgs.llvmPackages_19.stdenv
, clang-tools ? pkgs.clang-tools_19
}:

let

	adaptive-cpp = pkgs.callPackage .nix/adaptive-cpp.nix {
		inherit stdenv;
		llvmPackages = pkgs.llvmPackages_19;
		lld = pkgs.lld_19;
	};

	forstio = (import ((builtins.fetchTarball {
		url = "https://git.keldu.de/forstio-forstio/snapshot/dev.tar.gz";
		sha256 = "sha256:1za6a9379s1i4wb1lpj6bxd6brs6ivk3zvs3pjys4wmhpsji6csj";
	}) + "/default.nix"){
		inherit stdenv;
		inherit clang-tools;
		inherit adaptive-cpp;
	}).forstio;

	pname = "kel-lbm";
	version = "0.0.3";
in rec {
	kel-lbm = {
		core = pkgs.callPackage ./lib/core/.nix/derivation.nix {
			inherit forstio stdenv clang-tools;
		};
		sycl = pkgs.callPackage ./lib/sycl/.nix/derivation.nix {
			inherit forstio stdenv clang-tools kel-lbm adaptive-cpp;
		};
	};

	examples = {
		cavity_2d_gpu = pkgs.callPackage ./examples/cavity_2d_gpu/.nix/derivation.nix {
			inherit pname version stdenv forstio adaptive-cpp;
			inherit kel-lbm;
		};
		
		cavity_2d = pkgs.callPackage ./examples/cavity_2d/.nix/derivation.nix {
			inherit pname version stdenv forstio;
			inherit kel-lbm;
		};

		poiseulle_particles_channel_2d = pkgs.callPackage ./examples/poiseulle_particles_channel_2d/.nix/derivation.nix {
			inherit pname version stdenv forstio;
			inherit kel-lbm;
		};

		meta_2d = pkgs.callPackage ./examples/meta_2d/.nix/derivation.nix {
			inherit pname version stdenv forstio;
			inherit kel-lbm;
		};

		planetary_3d = pkgs.callPackage ./examples/planetary_3d/.nix/derivation.nix {
			inherit pname version stdenv forstio adaptive-cpp;
			inherit kel-lbm;
		};

		poiseulle_2d = pkgs.callPackage ./examples/poiseulle_3d/.nix/derivation.nix {
			inherit pname version stdenv forstio;
			inherit kel-lbm;
		};

		poiseulle_3d = pkgs.callPackage ./examples/poiseulle_3d/.nix/derivation.nix {
			inherit pname version stdenv forstio adaptive-cpp;
			inherit kel-lbm;
		};
	};

	debug = {
		inherit adaptive-cpp;
	};

	release = {
		dev = {
			inherit kel-lbm;
		};

		examples = pkgs.symlinkJoin {
			name = "kel-lbm-sims-${version}";
			paths = [
				kel-lbm.core
				kel-lbm.sycl
				examples.cavity_2d_gpu
			];
		};
	};
}