38 lines
1.0 KiB
Markdown
38 lines
1.0 KiB
Markdown
# Raptor
|
|
|
|
## Build
|
|
|
|
### Mlir
|
|
|
|
Follow the first part of instructions [here](onnx-mlir/docs/BuildOnLinuxOSX.md) to build mlir.
|
|
|
|
Remember to set ```-DCMAKE_BUILD_TYPE=Debug``` for developing on Raptor
|
|
|
|
Moreover, if compiling with build type debug, it is also suggested to use
|
|
mold as linker (you will need to install it if you don't have it already)
|
|
to reduce memory usage during linking. You can use it with:
|
|
```
|
|
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=mold" \
|
|
-DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=mold"
|
|
```
|
|
|
|
### Raptor
|
|
|
|
Use the following commands to build Raptor.
|
|
Remember to set ```-DCMAKE_BUILD_TYPE=Debug``` for developing on Raptor.
|
|
|
|
```
|
|
git submodule update --init --recursive
|
|
|
|
MLIR_DIR=$(pwd)/onnx-mlir/llvm-project/build/lib/cmake/mlir
|
|
mkdir build && cd build
|
|
cmake .. -G Ninja \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DLLVM_ENABLE_ASSERTIONS=ON \
|
|
-DMLIR_DIR=${MLIR_DIR}
|
|
cmake --build .
|
|
```
|
|
|
|
If the build fails because of protobuf missing uint definitions,
|
|
just patch the problematic files by adding ```#include <cstdint>``` to their includes.
|