Skip to content

Commit b5a34c3

Browse files
authored
Update README for Halide 12 release. (#6034)
1 parent 1c0ff0f commit b5a34c3

File tree

1 file changed

+86
-59
lines changed

1 file changed

+86
-59
lines changed

README.md

+86-59
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Halide is a programming language designed to make it easier to write
44
high-performance image and array processing code on modern machines. Halide
55
currently targets:
66

7-
- CPU architectures: X86, ARM, MIPS, Hexagon, PowerPC
8-
- Operating systems: Linux, Windows, Mac OS X, Android, iOS, Qualcomm QuRT
9-
- GPU Compute APIs: CUDA, OpenCL, OpenGL Compute Shaders, Apple Metal,
10-
Microsoft Direct X 12
7+
- CPU architectures: X86, ARM, MIPS, Hexagon, PowerPC, RISC-V
8+
- Operating systems: Linux, Windows, macOS, Android, iOS, Qualcomm QuRT
9+
- GPU Compute APIs: CUDA, OpenCL, OpenGL Compute Shaders, Apple Metal, Microsoft
10+
Direct X 12
1111

1212
Rather than being a standalone programming language, Halide is embedded in C++.
1313
This means you write C++ code that builds an in-memory representation of a
@@ -29,10 +29,10 @@ If you've acquired a full source distribution and want to build Halide, see the
2929

3030
## Binary tarballs
3131

32-
The latest version of Halide is **Halide 11.0.1**. We provide binary releases
32+
The latest version of Halide is **Halide 12.0.0**. We provide binary releases
3333
for many popular platforms and architectures, including 32/64-bit x86 Windows,
3434
64-bit macOS, and 32/64-bit x86/ARM Ubuntu Linux. See the releases tab on the
35-
right (or click [here](https://github.com/halide/Halide/releases/tag/v10.0.0)).
35+
right (or click [here](https://github.com/halide/Halide/releases/tag/v12.0.0)).
3636

3737
## Vcpkg
3838

@@ -43,13 +43,10 @@ you can install Halide via:
4343
$ vcpkg install halide:x64-windows # or x64-linux/x64-osx
4444
```
4545

46-
Note two caveats: first, at time of writing,
47-
[MSVC mis-compiles LLVM](https://github.com/halide/Halide/issues/5039) on
48-
x86-windows, so Halide cannot be used in vcpkg on that platform at this time;
49-
second, vcpkg installs only the minimum Halide backends required to compile code
50-
for the active platform. If you want to include all the backends, you should
51-
install `halide[target-all]:x64-windows` instead. Note that since this will
52-
build LLVM, it will take a _lot_ of disk space (up to 100GB).
46+
One caveat: vcpkg installs only the minimum Halide backends required to compile
47+
code for the active platform. If you want to include all the backends, you
48+
should install `halide[target-all]:x64-windows` instead. Note that since this
49+
will build LLVM, it will take a _lot_ of disk space (up to 100GB).
5350

5451
## Homebrew
5552

@@ -62,60 +59,93 @@ $ brew install halide
6259

6360
## Other package managers
6461

65-
We are interested in bringing Halide 10 to other popular package managers
66-
and Linux distribution repositories including, but not limited to, Conan,
62+
We are interested in bringing Halide 12 to other popular package managers and
63+
Linux distribution repositories including, but not limited to, Conan,
6764
Debian, [Ubuntu (or PPA)](https://github.com/halide/Halide/issues/5285),
68-
CentOS/Fedora, and Arch. If you have experience publishing packages we
69-
would be happy to work with you!
65+
CentOS/Fedora, and Arch. If you have experience publishing packages we would be
66+
happy to work with you!
7067

71-
If you are a maintainer of any other package distribution platform, we would
72-
be excited to work with you, too.
68+
If you are a maintainer of any other package distribution platform, we would be
69+
excited to work with you, too.
70+
71+
# Platform Support
72+
73+
There are two sets of platform requirements relevant to Halide: those required
74+
to run the compiler library in either JIT or AOT mode, and those required to run
75+
the _binary outputs_ of the AOT compiler.
76+
77+
These are the **tested** host toolchain and platform combinations for building
78+
and running the Halide compiler library.
79+
80+
| Compiler | Version | OS | Architectures |
81+
| ---------- | ------------ | ---------------------- | --------------- |
82+
| GCC | 7.5 | Ubuntu Linux 20.04 LTS | x86, x64, ARM32 |
83+
| GCC | 7.5 | Ubuntu Linux 18.04 LTS | ARM32, ARM64 |
84+
| MSVC | 2019 (19.28) | Windows 10 (20H2) | x86, x64 |
85+
| AppleClang | 12.0.0 | macOS 10.15 | x86_64 |
86+
| AppleClang | 12.0.0 | macOS 11.1 | ARM64 |
87+
88+
Some users have successfully built Halide for Linux using Clang 9.0.0+, for
89+
Windows using ClangCL 11.0.0+, and for Windows ARM64 by cross-compiling with
90+
MSVC. We do not actively test these scenarios, however, so your mileage may
91+
vary.
92+
93+
Beyond these, we are willing to support (by accepting PRs for) platform and
94+
toolchain combinations that still receive _active, first-party, public support_
95+
from their original vendors. For instance, at time of writing, this excludes
96+
Windows 7 and includes Ubuntu 18.04 LTS.
97+
98+
Compiled AOT pipelines are expected to have much broader platform support. The
99+
binaries use the C ABI, and we expect any compliant C compiler to be able to use
100+
the generated headers correctly. The C++ bindings currently require C++11. If
101+
you discover a compatibility problem with a generated pipeline, please open an
102+
issue.
73103

74104
# Building Halide with Make
75105

76106
### TL;DR
77107

78-
Have llvm-9.0 (or greater) installed and run `make` in the root directory of the
79-
repository (where this README is).
108+
Have llvm-11.0 (or greater) installed and run `make` in the root directory of
109+
the repository (where this README is).
80110

81111
### Acquiring LLVM
82112

83113
At any point in time, building Halide requires either the latest stable version
84114
of LLVM, the previous stable version of LLVM, and trunk. At the time of writing,
85-
this means versions 11.0 and 10.0 are supported, but 9.0 is not. The commands
115+
this means versions 12.0 and 11.0 are supported, but 10.0 is not. The commands
86116
`llvm-config` and `clang` must be somewhere in the path.
87117

88-
If your OS does not have packages for llvm, you can find binaries for it at
118+
If your OS does not have packages for LLVM, you can find binaries for it at
89119
http://llvm.org/releases/download.html. Download an appropriate package and then
90120
either install it, or at least put the `bin` subdirectory in your path. (This
91121
works well on OS X and Ubuntu.)
92122

93123
If you want to build it yourself, first check it out from GitHub:
94124

95125
```
96-
% git clone --depth 1 --branch llvmorg-11.0.0 https://github.com/llvm/llvm-project.git
126+
% git clone --depth 1 --branch llvmorg-12.0.0 https://github.com/llvm/llvm-project.git
97127
```
98128

99-
(If you want to build LLVM 10.x, use branch `llvmorg-10.0.1`; for current trunk,
129+
(If you want to build LLVM 11.x, use branch `llvmorg-11.1.0`; for current trunk,
100130
use `main`)
101131

102132
Then build it like so:
103133

104134
```
105135
% cmake -DCMAKE_BUILD_TYPE=Release \
106136
-DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" \
107-
-DLLVM_TARGETS_TO_BUILD="X86;ARM;NVPTX;AArch64;Mips;Hexagon" \
137+
-DLLVM_TARGETS_TO_BUILD="X86;ARM;NVPTX;AArch64;Mips;Hexagon;WebAssembly" \
108138
-DLLVM_ENABLE_TERMINFO=OFF -DLLVM_ENABLE_ASSERTIONS=ON \
109139
-DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON -DLLVM_BUILD_32_BITS=OFF \
110140
-S llvm-project/llvm -B llvm-build
111141
% cmake --build llvm-build
112142
% cmake --install llvm-build --prefix llvm-install
113143
```
144+
114145
Running a serial build will be slow. To improve speed, try running a parallel
115146
build. That's done by default in Ninja; for make, use the option -j NNN,
116-
where NNN is the number of parallel jobs, e.g. the number of CPUs you have.
117-
118-
then to point Halide to it:
147+
where NNN is the number of parallel jobs, e.g. the number of CPUs you have.
148+
Then, point Halide to it:
119149

120150
```
121151
% export LLVM_ROOT=$PWD/llvm-install
@@ -125,8 +155,8 @@ then to point Halide to it:
125155
Note that you _must_ add `clang` to `LLVM_ENABLE_PROJECTS`; adding `lld` to
126156
`LLVM_ENABLE_PROJECTS` is only required when using WebAssembly, and adding
127157
`clang-tools-extra` is only necessary if you plan to contribute code to Halide
128-
(so that you can run clang-tidy on your pull requests). We recommend enabling
129-
both in all cases, to simplify builds. You can disable exception handling (EH)
158+
(so that you can run `clang-tidy` on your pull requests). We recommend enabling
159+
both in all cases to simplify builds. You can disable exception handling (EH)
130160
and RTTI if you don't want the Python bindings.
131161

132162
### Building Halide with make
@@ -136,8 +166,7 @@ just run `make` in the root directory of the Halide source tree.
136166
`make run_tests` will run the JIT test suite, and `make test_apps` will make
137167
sure all the apps compile and run (but won't check their output).
138168

139-
There is no `make install` yet. If you want to make an install package, run
140-
`make distrib`.
169+
There is no `make install`. If you want to make an install package, use CMake.
141170

142171
### Building Halide out-of-tree with make
143172

@@ -156,16 +185,16 @@ Follow the above instructions to build LLVM or acquire a suitable binary
156185
release. Then change directory to the Halide repository and run:
157186

158187
```
159-
% cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=$LLVM_ROOT/lib/cmake/llvm -S . -B build
188+
% cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_DIR=$LLVM_ROOT/lib/cmake/llvm -S . -B build
160189
% cmake --build build
161190
```
162191

163192
`LLVM_DIR` is the folder in the LLVM installation tree **(do not use the build
164193
tree by mistake)** that contains `LLVMConfig.cmake`. It is not required to set
165194
this variable if you have a suitable system-wide version installed. If you have
166195
multiple system-wide versions installed, you can specify the version with
167-
`Halide_REQUIRE_LLVM_VERSION`. Add `-G Ninja` if you prefer to build with the
168-
Ninja generator.
196+
`Halide_REQUIRE_LLVM_VERSION`. Remove `-G Ninja` if you prefer to build with a
197+
different generator.
169198

170199
### Windows
171200

@@ -236,7 +265,7 @@ this by specifying, for example:
236265
Then run the build with:
237266

238267
```
239-
D:\Halide> cmake --build build --config Release -j %NUMBER_OF_PROCESSORS%
268+
D:\Halide> cmake --build build --config Release
240269
```
241270

242271
To run all the tests:
@@ -252,10 +281,10 @@ Subsets of the tests can be selected with `-L` and include `correctness`,
252281
#### Building LLVM (optional)
253282

254283
Follow these steps if you want to build LLVM yourself. First, download LLVM's
255-
sources (these instructions use the latest 11.0 release)
284+
sources (these instructions use the latest 12.0 release)
256285

257286
```
258-
D:\> git clone --depth 1 --branch llvmorg-11.0.0 https://github.com/llvm/llvm-project.git
287+
D:\> git clone --depth 1 --branch llvmorg-12.0.0 https://github.com/llvm/llvm-project.git
259288
```
260289

261290
For a 64-bit build, run:
@@ -291,7 +320,7 @@ D:\> cmake -G Ninja ^
291320
Finally, run:
292321

293322
```
294-
D:\> cmake --build llvm-build --config Release -j %NUMBER_OF_PROCESSORS%
323+
D:\> cmake --build llvm-build --config Release
295324
D:\> cmake --install llvm-build --prefix llvm-install
296325
```
297326

@@ -337,47 +366,44 @@ Apple clang 500.2.76. This means that we link against libc++ instead of
337366
libstdc++. You may need to adjust compiler options accordingly if you're using
338367
an older XCode which does not default to libc++.
339368

340-
# Halide OpenGL/GLSL backend
341-
342-
TODO(https://github.com/halide/Halide/issues/5633): update this for OpenGLCompute, which is staying
343-
344369
# Halide for Hexagon HVX
345370

346371
Halide supports offloading work to Qualcomm Hexagon DSP on Qualcomm Snapdragon
347-
835 devices or newer. The Hexagon DSP provides a set of 128 byte vector instruction
348-
extensions - the Hexagon Vector eXtensions (HVX). HVX is well suited for image
349-
processing, and Halide for Hexagon HVX will generate the appropriate HVX vector
350-
instructions from a program authored in Halide.
372+
835 devices or newer. The Hexagon DSP provides a set of 128 byte vector
373+
instruction extensions - the Hexagon Vector eXtensions (HVX). HVX is well suited
374+
for image processing, and Halide for Hexagon HVX will generate the appropriate
375+
HVX vector instructions from a program authored in Halide.
351376

352377
Halide can be used to compile Hexagon object files directly, by using a target
353378
such as `hexagon-32-qurt-hvx`.
354379

355380
Halide can also be used to offload parts of a pipeline to Hexagon using the
356381
`hexagon` scheduling directive. To enable the `hexagon` scheduling directive,
357-
include the `hvx` target feature in your target. The currently
358-
supported combination of targets is to use the HVX target features with an x86
359-
linux host (to use the simulator) or with an ARM android target (to use Hexagon
360-
DSP hardware). For examples of using the `hexagon` scheduling directive on both
361-
the simulator and a Hexagon DSP, see the blur example app.
382+
include the `hvx` target feature in your target. The currently supported
383+
combination of targets is to use the HVX target features with an x86 linux
384+
host (to use the simulator) or with an ARM android target (to use Hexagon DSP
385+
hardware). For examples of using the `hexagon` scheduling directive on both the
386+
simulator and a Hexagon DSP, see the blur example app.
362387

363388
To build and run an example app using the Hexagon target,
364389

365390
1. Obtain and build trunk LLVM and Clang. (Earlier versions of LLVM may work but
366391
are not actively tested and thus not recommended.)
367-
2. Download and install the Hexagon SDK and Hexagon Tools. Hexagon SDK 3.4.1 or later
368-
is needed. Hexagon Tools 8.2 or later is needed.
392+
2. Download and install the Hexagon SDK and Hexagon Tools. Hexagon SDK 3.4.1 or
393+
later is needed. Hexagon Tools 8.2 or later is needed.
369394
3. Build and run an example for Hexagon HVX
370395

371396
### 1. Obtain and build trunk LLVM and Clang
372397

373-
(Instructions given previous, just be sure to check out the `master` branch.)
398+
(Follow the instructions given previously, just be sure to check out the `main`
399+
branch.)
374400

375401
### 2. Download and install the Hexagon SDK and Hexagon Tools
376402

377403
Go to https://developer.qualcomm.com/software/hexagon-dsp-sdk/tools
378404

379-
1. Select the Hexagon Series 600 Software and download the 3.4.1 version or later
380-
for Linux.
405+
1. Select the Hexagon Series 600 Software and download the 3.4.1 version or
406+
later for Linux.
381407
2. untar the installer
382408
3. Run the extracted installer to install the Hexagon SDK and Hexagon Tools,
383409
selecting Installation of Hexagon SDK into `/location/of/SDK/Hexagon_SDK/3.x`
@@ -405,7 +431,8 @@ LD_LIBRARY_PATH=../../src/runtime/hexagon_remote/bin/host/:$HL_HEXAGON_TOOLS/lib
405431

406432
To build the example for Android, first ensure that you have Android NDK r19b or
407433
later installed, and the ANDROID_NDK_ROOT environment variable points to it.
408-
(Note that Qualcomm Hexagon SDK v3.5.2 includes Android NDK r19c, which is fine.)
434+
(Note that Qualcomm Hexagon SDK v3.5.2 includes Android NDK r19c, which is
435+
fine.)
409436

410437
Now build and run the blur example using the script to run it on device:
411438

0 commit comments

Comments
 (0)