diff --git a/README.md b/README.md index 5688364..a20a9f3 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,11 @@ export LLVM_SYS_170_PREFIX=/usr/lib/llvm-17 export TABLEGEN_170_PREFIX=/usr/lib/llvm-17 ``` +If you installed llvm with brew, source the `env-macos.sh` script to set up the needed env vars: +```sh +source scripts/env-macos.sh +``` + ## Table of Contents - [Design](#design) diff --git a/scripts/env-macos.sh b/scripts/env-macos.sh new file mode 100644 index 0000000..a61e9c0 --- /dev/null +++ b/scripts/env-macos.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# This script is only useful on macOS using brew. +# It sets the LLVM environment variables. + +MLIR_SYS_170_PREFIX="$(brew --prefix llvm@17)" +LLVM_SYS_170_PREFIX="$(brew --prefix llvm@17)" +TABLEGEN_170_PREFIX="$(brew --prefix llvm@17)" + +export MLIR_SYS_170_PREFIX +export LLVM_SYS_170_PREFIX +export TABLEGEN_170_PREFIX