1. Simplify CircleCI build scripts.

2. Refactor mlir installation script to a standalone shell script.
This commit is contained in:
Tian Jin 2019-12-31 01:45:32 -05:00
parent b63b6bfd99
commit c4b990aed8
2 changed files with 20 additions and 32 deletions

View File

@ -11,45 +11,21 @@ jobs:
command: | command: |
git submodule update --init --recursive git submodule update --init --recursive
- run: - run:
name: Check current directory name: Installing GCC, CMake, Ninja, Protobuf
command: pwd command: 'sudo apt-get update && sudo apt-get install -y gcc g++ cmake ninja-build protobuf-compiler'
- run: # Use cached mlir installation if possible.
name: Check current directory content
command: ls
- run:
name: Installing GCC
command: 'sudo apt-get update && sudo apt-get install -y gcc g++'
- run:
name: Install CMAKE
command: 'sudo apt-get update && sudo apt-get install -y cmake ninja-build'
- run:
name: Install Protobuf
command: 'sudo apt-get update && sudo apt-get install -y protobuf-compiler'
- run:
name: Check gcc version
command: gcc --version
- restore_cache: - restore_cache:
key: LLVM-PROJECT-{{ arch }} key: V1-LLVM-PROJECT-{{ arch }}
- run: - run:
name: Install MLIR name: Install MLIR
command: | command: |
# Check whether cache restoration succeeds by checking whether
# mlir-opt executable exists.
if [ ! -f llvm-project/build/bin/mlir-opt ]; then if [ ! -f llvm-project/build/bin/mlir-opt ]; then
git clone https://github.com/llvm/llvm-project.git sh .circleci/install-mlir.sh
mkdir llvm-project/build
cd llvm-project/build
cmake -G Ninja ../llvm \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_BUILD_EXAMPLES=ON \
-DLLVM_TARGETS_TO_BUILD="host" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_RTTI=ON
# TODO(tjingrant): why is RTTI necessary?
cmake --build . --target check-mlir -- -j 4
fi fi
- save_cache: - save_cache:
key: LLVM-PROJECT-{{ arch }} key: V1-LLVM-PROJECT-{{ arch }}
paths: paths:
- llvm-project - llvm-project
- run: - run:

12
.circleci/install-mlir.sh Normal file
View File

@ -0,0 +1,12 @@
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="host" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_RTTI=ON
# TODO(tjingrant): why is RTTI necessary?
cmake --build . --target check-mlir -- -j ${PARALLEL_JOBS_LIMIT:-4}