diff options
author | Yann Herklotz <git@yannherklotz.com> | 2022-09-26 19:08:01 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2022-09-26 19:08:48 +0100 |
commit | 0034f32d6d85d7f21cf04c82083860cdb2fe1ddb (patch) | |
tree | f37f65190acd6040a262cdb7d2dbf6e2b17556f5 /README.md | |
parent | b018c1ef00eade87c9efbf48cc2e3466877ea79d (diff) | |
download | gsa-mlir-0034f32d6d85d7f21cf04c82083860cdb2fe1ddb.tar.gz gsa-mlir-0034f32d6d85d7f21cf04c82083860cdb2fe1ddb.zip |
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 54 |
1 files changed, 3 insertions, 51 deletions
@@ -1,66 +1,18 @@ # An out-of-tree MLIR dialect -This is an example of an out-of-tree [MLIR](https://mlir.llvm.org/) dialect along with a standalone -`opt`-like tool to operate on that dialect. - -## Setting up Docker - -First, set up docker volumes so that the installation persists across multiple images, and pull the -right image. - -``` sh -docker pull ymherklotz/polyhedral:1.0 -docker volume create llvm -docker run -itd --name gsa-mlir -v llvm:/opt ymherklotz/polyhedral:1.0 -docker exec -it gsa-mlir /bin/bash -``` - -## Setting up LLVM - -First, download and install MLIR from the [`llvm-project`](https://github.com/llvm/llvm-project/) -and compile it, installing it in `/opt/llvm` - -``` sh -cd /opt -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="X86;NVPTX;AMDGPU" \ - -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_ENABLE_ASSERTIONS=ON \ - -DLLVM_INSTALL_UTILS=ON \ - -DCMAKE_INSTALL_PREFIX=/opt/llvm -cmake --build . --target check-mlir -mkdir -p /opt/llvm -ninja install -``` - -This should create a `BUILD_DIR` under `/opt/llvm-project/build`, and install everything under -`PREFIX` which is `/opt/llvm`. +This is an example of an out-of-tree [MLIR](https://mlir.llvm.org/) dialect along with a standalone `opt`-like tool to operate on that dialect. ## Building -These instructions are now to build this repository, which should be in a separate place to the -directories above. - -This setup assumes that you have built LLVM and MLIR in `$BUILD_DIR` and installed them to -`$PREFIX`. To build and launch the tests, run - +This setup assumes that you have built LLVM and MLIR in `$BUILD_DIR` and installed them to `$PREFIX`. To build and launch the tests, run ```sh mkdir build && cd build cmake -G Ninja .. -DMLIR_DIR=$PREFIX/lib/cmake/mlir -DLLVM_EXTERNAL_LIT=$BUILD_DIR/bin/llvm-lit cmake --build . --target check-standalone ``` - To build the documentation from the TableGen description of the dialect operations, run - ```sh cmake --build . --target mlir-doc ``` - -**Note**: Make sure to pass `-DLLVM_INSTALL_UTILS=ON` when building LLVM with CMake in order to -install `FileCheck` to the chosen installation prefix. +**Note**: Make sure to pass `-DLLVM_INSTALL_UTILS=ON` when building LLVM with CMake in order to install `FileCheck` to the chosen installation prefix. |