nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ llvmPackages
2, lib
3, fetchFromGitHub
4, cmake
5, libpng
6, libjpeg
7, mesa
8, eigen
9, openblas
10, blas
11, lapack
12}:
13
14assert blas.implementation == "openblas" && lapack.implementation == "openblas";
15
16llvmPackages.stdenv.mkDerivation rec {
17 pname = "halide";
18 version = "10.0.0";
19
20 src = fetchFromGitHub {
21 owner = "halide";
22 repo = "Halide";
23 rev = "v${version}";
24 sha256 = "0il71rppjp76m7zd420siidvhs76sqiq26h60ywk812sj9mmgxj6";
25 };
26
27 # clang fails to compile intermediate code because
28 # of unused "--gcc-toolchain" option
29 postPatch = ''
30 sed -i "s/-Werror//" src/CMakeLists.txt
31 '';
32
33 cmakeFlags = [ "-DWARNINGS_AS_ERRORS=OFF" "-DWITH_PYTHON_BINDINGS=OFF" ];
34
35 # To handle the lack of 'local' RPATH; required, as they call one of
36 # their built binaries requiring their libs, in the build process.
37 preBuild = ''
38 export LD_LIBRARY_PATH="$(pwd)/src''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
39 '';
40
41 # Note: only openblas and not atlas part of this Nix expression
42 # see pkgs/development/libraries/science/math/liblapack/3.5.0.nix
43 # to get a hint howto setup atlas instead of openblas
44 buildInputs = [
45 llvmPackages.llvm
46 llvmPackages.lld
47 llvmPackages.openmp
48 llvmPackages.libclang
49 libpng
50 libjpeg
51 mesa
52 eigen
53 openblas
54 ];
55
56 nativeBuildInputs = [ cmake ];
57
58 meta = with lib; {
59 description = "C++ based language for image processing and computational photography";
60 homepage = "https://halide-lang.org";
61 license = licenses.mit;
62 platforms = platforms.all;
63 maintainers = [ maintainers.ck3d ];
64 };
65}