cmake 3.20.6 or higher
ninja 1.8.2
clang/llvm 14+ from source https://github.com/llvm/llvm-project
llvm/torch-mlir from https://github.com/llvm/torch-mlir
NOTE: this initial version of mlir-xten currently fails to build against head torch-mlir. Fixes in progress.
Clone torch-mlir from https://github.com/llvm/torch-mlir and follow the build instructions. This process builds torch-mlir integrated with LLVM/MLIR. We recommend adding the additional CMake flags: -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON
to build and link with libLLVM.so.
cmake --build build
git clone https://github.com/Xilinx/mlir-xten.git
mkdir build; cd build
cmake ..\
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DLLVM_DIR=${absolute path to torchMlirBuild}/cmake/llvm \
-DMLIR_DIR=${absolute path to torchMlirBuild}/cmake/mlir \
-DTORCH_MLIR_SOURCE_DIR=${absolute path to torchMlirSource} \
-DTORCH_MLIR_BINARY_DIR=${absolute path to torchMlirBuild}
TBD
Copyright© 2019-2021 Xilinx