Skip to content

Instantly share code, notes, and snippets.

@automata
Created January 18, 2024 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save automata/0626aa0abf8ea3387ab6511c44264ffe to your computer and use it in GitHub Desktop.
Save automata/0626aa0abf8ea3387ab6511c44264ffe to your computer and use it in GitHub Desktop.
Install MLIR tutorial on Mac
brew install cmake cache ninja
git clone https://github.com/llvm/llvm-project.git
mkdir llvm-project/build
cd llvm-project/build
cmake -G Ninja ../llvm \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_BUILD_EXAMPLES=ON \
-DLLVM_TARGETS_TO_BUILD="Native;ARM;X86" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DLLVM_CCACHE_BUILD=ON
cmake --build . --target check-mlir
# To check if worked, generate the AST of a Toy file:
./bin/toyc-ch1 ../mlir/test/Examples/Toy/Ch1/ast.toy -emit=ast
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment