onnx-mlir/.circleci/config.yml

62 lines
2.3 KiB
YAML
Raw Normal View History

2019-12-24 05:33:08 +08:00
version: 2
jobs:
build:
docker:
2019-12-24 06:03:22 +08:00
- image: circleci/python
2019-12-24 05:33:08 +08:00
steps:
- checkout
2019-12-24 13:51:23 +08:00
- run:
name: "Pull Submodules"
command: |
git submodule update --init --recursive
- run:
name: Check current directory
command: pwd
2019-12-24 13:09:31 +08:00
- run:
name: Check current directory content
command: ls
2019-12-24 06:47:37 +08:00
- run:
name: Installing GCC
2019-12-24 06:53:31 +08:00
command: 'sudo apt-get update && sudo apt-get install -y gcc g++'
2019-12-24 06:47:37 +08:00
- run:
name: Install CMAKE
2019-12-24 06:58:55 +08:00
command: 'sudo apt-get update && sudo apt-get install -y cmake ninja-build'
2019-12-24 13:54:02 +08:00
- run:
name: Install Protobuf
command: 'sudo apt-get update && sudo apt-get install -y protobuf-compiler'
2019-12-24 06:47:37 +08:00
- run:
name: Check gcc version
2019-12-24 06:47:37 +08:00
command: gcc --version
2019-12-24 13:09:31 +08:00
- restore_cache:
2019-12-24 14:17:20 +08:00
key: ONNF-MLIR-{{ arch }}
2019-12-24 05:33:08 +08:00
- run:
name: Install MLIR
2019-12-24 05:53:08 +08:00
command: |
2019-12-24 13:48:42 +08:00
if [ ! -f llvm-project/build/bin/mlir-opt ]; then
2019-12-24 13:09:31 +08:00
git clone https://github.com/llvm/llvm-project.git
2019-12-24 14:17:20 +08:00
cd llvm-project && git checkout 9b6ad8466bb8b97082b705270603ad7f4559e931 && cd ..
2019-12-24 13:09:31 +08:00
git clone https://github.com/tensorflow/mlir llvm-project/llvm/projects/mlir
2019-12-24 14:17:20 +08:00
cd llvm-project/llvm/projects/mlir && git checkout 0710266d0f56cf6ab0f437badbd7416b6cecdf5f && cd ../../../..
2019-12-24 13:09:31 +08:00
mkdir llvm-project/build
cd llvm-project/build
cmake -G Ninja ../llvm -DLLVM_ENABLE_RTTI=ON -DLLVM_BUILD_EXAMPLES=OFF -DLLVM_TARGETS_TO_BUILD="host" -DCMAKE_BUILD_TYPE=Release
CMAKE_EXE_LINKER_FLAGS="-Wl,--reduce-memory-overheads -Wl,--hash-size=512" cmake --build . --target check-mlir -- -j 4
fi
- save_cache:
2019-12-24 14:17:20 +08:00
key: ONNF-MLIR-{{ arch }}
2019-12-24 13:09:31 +08:00
paths:
- llvm-project
- run:
name: Install ONNF
command: |
2019-12-24 13:46:32 +08:00
mkdir build && cd build
LLVM_SRC=$(pwd)/../llvm-project/llvm LLVM_BUILD=$(pwd)/../llvm-project/build cmake ..
2019-12-24 15:13:35 +08:00
make all
2019-12-24 15:01:23 +08:00
VERBOSE=1 LIT_OPTS=-v make check-mlir-lit
2019-12-24 14:50:47 +08:00
cd /home/circleci/project/build/test/mlir && /usr/local/bin/python /home/circleci/project/build/../llvm-project/build/bin/llvm-lit -v /home/circleci/project/build/test/mlir
2019-12-24 05:33:08 +08:00
- run:
name: Print the Current Time
command: date