-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
/
halide.rb
77 lines (66 loc) 路 3.11 KB
/
halide.rb
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
class Halide < Formula
desc "Language for fast, portable data-parallel computation"
homepage "https://halide-lang.org"
url "https://github.com/halide/Halide/archive/refs/tags/v17.0.1.tar.gz"
sha256 "beb18331d9e4b6f69943bcc75fb9d923a250ae689f09f6940a01636243289727"
license "MIT"
head "https://github.com/halide/Halide.git", branch: "main"
livecheck do
url :stable
strategy :github_latest
end
bottle do
sha256 cellar: :any, arm64_sonoma: "fabb3fb758e0da8961127fd87d60521a8188ecb5d0c324a87e16b6421a2ee8ba"
sha256 cellar: :any, arm64_ventura: "556f60f7f86267903ade80791a9b308aa3645692c1b37990cdc4f8c99129568d"
sha256 cellar: :any, arm64_monterey: "e50fda2ef326f399bc16694dc444657f6fa2c3c3062d7fc2c3ae7250f6d1098f"
sha256 cellar: :any, sonoma: "13409066855f0e41f5f01a1527697ccd35b691b52c0790463049a4248cadbec8"
sha256 cellar: :any, ventura: "f82ea6355cdfb1833c20383a90c22493dc35e5bdb526ed954bfed6be20d54923"
sha256 cellar: :any, monterey: "89a9af672d492aa15934bfb0bddf04a92ae914d0de6df3d3dc9beea2bd58023b"
sha256 cellar: :any_skip_relocation, x86_64_linux: "e78fdb7bbee95088361735d04a15205c448a8cd1f24278f6f4d0870c2e1eaec9"
end
depends_on "cmake" => :build
depends_on "pybind11" => :build
depends_on "flatbuffers"
depends_on "jpeg-turbo"
depends_on "libpng"
depends_on "llvm"
depends_on "python@3.12"
# Check wabt version in `dependencies/wasm/CMakeLists.txt`.
# TODO: Ask upstream to support usage of a system-provided wabt.
# TODO: Do we really need a git checkout here?
resource "wabt" do
url "https://github.com/WebAssembly/wabt.git",
tag: "1.0.33",
revision: "963f973469b45969ce198e0c86d3af316790a780"
end
fails_with :gcc do
version "6"
cause "Requires C++17"
end
def python3
"python3.12"
end
def install
# Work around an Xcode 15 linker issue which causes linkage against LLVM's
# libunwind due to it being present in a library search path.
ENV.remove "HOMEBREW_LIBRARY_PATHS", Formula["llvm"].opt_lib if DevelopmentTools.clang_build_version >= 1500
builddir = buildpath/"build"
(builddir/"_deps/wabt-src").install resource("wabt")
system "cmake", "-S", ".", "-B", builddir
"-DCMAKE_INSTALL_RPATH=#{rpath}",
"-DHalide_INSTALL_PYTHONDIR=#{prefix/Language::Python.site_packages(python3)}",
"-DHalide_SHARED_LLVM=ON",
"-DPYBIND11_USE_FETCHCONTENT=OFF",
"-DFLATBUFFERS_USE_FETCHCONTENT=OFF",
*std_cmake_args
system "cmake", "--build", builddir
system "cmake", "--install", builddir
end
test do
cp share/"doc/Halide/tutorial/lesson_01_basics.cpp", testpath
system ENV.cxx, "-std=c++17", "lesson_01_basics.cpp", "-L#{lib}", "-lHalide", "-o", "test"
assert_match "Success!", shell_output("./test")
cp share/"doc/Halide_Python/tutorial-python/lesson_01_basics.py", testpath
assert_match "Success!", shell_output("#{python3} lesson_01_basics.py")
end
end