From 4010d8782cdf97788689de4df760993236b4ed91 Mon Sep 17 00:00:00 2001 From: Alexei Fedotov Date: Wed, 23 Oct 2024 20:14:34 +0200 Subject: [PATCH] Add compile.sh --- .github/workflows/build.yml | 11 ++--------- dev_scripts/compile.sh | 31 ------------------------------- scripts/compile.sh | 10 ++++++++++ 3 files changed, 12 insertions(+), 40 deletions(-) delete mode 100644 dev_scripts/compile.sh create mode 100644 scripts/compile.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38208c0fa..a7bc45433 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,7 +80,7 @@ jobs: git clone https://github.com/llvm/llvm-project --branch main --single-branch cd llvm-project git checkout ${LLVM_SHA} - if [ -d "/home/runner/work/mlir-extensions/mlir-extensions/build_tools/patches" ]; then git apply /home/runner/work/mlir-extensions/mlir-extensions/build_tools/patches/*.patch; fi + git apply /home/runner/work/mlir-extensions/mlir-extensions/build_tools/patches/*.patch cmake -G Ninja -B _build -S llvm \ -DCMAKE_BUILD_TYPE=MinSizeRel \ -DLLVM_ENABLE_PROJECTS=mlir \ @@ -97,14 +97,7 @@ jobs: - name: Build IMEX and run lit tests shell: bash -le {0} run: | - external_lit=`which lit` - echo ${external_lit} - cd /home/runner/work/mlir-extensions/mlir-extensions - cmake -S . -B _build -GNinja \ - -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_EXTERNAL_LIT=${external_lit} \ - -DMLIR_DIR=/home/runner/work/llvm-mlir/_mlir_install/lib/cmake/mlir \ - -DLLVM_LIT_ARGS=-a + ./scripts/compile.sh -DLLVM_LIT_ARGS="-a" -DLLVM_EXTERNAL_LIT=$(which lit) cmake --build _build --target check-imex - name: Build doxygen docs diff --git a/dev_scripts/compile.sh b/dev_scripts/compile.sh deleted file mode 100644 index 5fe080b82..000000000 --- a/dev_scripts/compile.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -set -e -set -vx - -cd $(dirname "$0")/.. -mlir_dir=$(pwd -P) - -cd .. -if test -d llvm-project -then - cd llvm-project - git clean -fd -else - git clone https://github.com/llvm/llvm-project.git - cd llvm-project -fi - -git reset --hard HEAD -git checkout $(cat $mlir_dir/build_tools/llvm_version.txt) -git apply $mlir_dir/build_tools/patches/* -cmake -G Ninja -B build -S llvm \ - -DLLVM_ENABLE_PROJECTS=mlir \ - -DLLVM_BUILD_EXAMPLES=ON \ - -DLLVM_TARGETS_TO_BUILD="X86" \ - -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_ENABLE_ASSERTIONS=ON \ - -DLLVM_EXTERNAL_PROJECTS="Imex" \ - -DLLVM_EXTERNAL_IMEX_SOURCE_DIR=$mlir_dir - -cmake --build build --target check-imex diff --git a/scripts/compile.sh b/scripts/compile.sh new file mode 100644 index 000000000..55fbf91a2 --- /dev/null +++ b/scripts/compile.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e +set -vx + +cd $(dirname "$0")/.. +mlir_dir=$(pwd -P) + +cmake -S llvm-project/llvm -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DLLVM_ENABLE_PROJECTS=mlir -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_USE_LINKER=gold -DLLVM_ENABLE_ZSTD=OFF -DLLVM_EXTERNAL_PROJECTS="Imex" -DLLVM_EXTERNAL_IMEX_SOURCE_DIR=. "$@" +