2020-11-06 00:33:48 +00:00
|
|
|
{ llvmPackages
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, libpng
|
|
|
|
, libjpeg
|
|
|
|
, mesa
|
|
|
|
, eigen
|
|
|
|
, openblas
|
|
|
|
, blas
|
|
|
|
, lapack
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
llvmPackages.stdenv.mkDerivation rec {
|
|
|
|
pname = "halide";
|
|
|
|
version = "10.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "halide";
|
|
|
|
repo = "Halide";
|
2020-11-06 00:33:48 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0il71rppjp76m7zd420siidvhs76sqiq26h60ywk812sj9mmgxj6";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# clang fails to compile intermediate code because
|
|
|
|
# of unused "--gcc-toolchain" option
|
|
|
|
postPatch = ''
|
|
|
|
sed -i "s/-Werror//" src/CMakeLists.txt
|
|
|
|
'';
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
cmakeFlags = [ "-DWARNINGS_AS_ERRORS=OFF" "-DWITH_PYTHON_BINDINGS=OFF" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# To handle the lack of 'local' RPATH; required, as they call one of
|
|
|
|
# their built binaries requiring their libs, in the build process.
|
|
|
|
preBuild = ''
|
2020-11-06 00:33:48 +00:00
|
|
|
export LD_LIBRARY_PATH="$(pwd)/src''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Note: only openblas and not atlas part of this Nix expression
|
|
|
|
# see pkgs/development/libraries/science/math/liblapack/3.5.0.nix
|
|
|
|
# to get a hint howto setup atlas instead of openblas
|
2021-06-01 10:57:12 +00:00
|
|
|
buildInputs = [
|
|
|
|
llvmPackages.llvm
|
|
|
|
llvmPackages.lld
|
|
|
|
llvmPackages.openmp
|
|
|
|
llvmPackages.libclang
|
|
|
|
libpng
|
|
|
|
libjpeg
|
|
|
|
mesa
|
|
|
|
eigen
|
|
|
|
openblas
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "C++ based language for image processing and computational photography";
|
|
|
|
homepage = "https://halide-lang.org";
|
|
|
|
license = licenses.mit;
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.ck3d ];
|
|
|
|
};
|
|
|
|
}
|