Created
January 18, 2024 20:57
-
-
Save automata/0626aa0abf8ea3387ab6511c44264ffe to your computer and use it in GitHub Desktop.
Install MLIR tutorial on Mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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