From 280fee108ac44e0495fa5f392f79c60b04ab74ff Mon Sep 17 00:00:00 2001 From: Kevin Gleason Date: Thu, 1 Sep 2022 15:01:13 +0000 Subject: [PATCH] Addressed feedback - only run build and test on Linux --- .github/workflows/buildAndTest.yml | 7 +----- build_tools/github_actions/ci_build_llvm.sh | 13 ++--------- .../github_actions/ci_build_stablehlo.sh | 22 +++++-------------- 3 files changed, 9 insertions(+), 33 deletions(-) diff --git a/.github/workflows/buildAndTest.yml b/.github/workflows/buildAndTest.yml index 8abb9c4b2eb..192076f1cd2 100644 --- a/.github/workflows/buildAndTest.yml +++ b/.github/workflows/buildAndTest.yml @@ -27,16 +27,13 @@ jobs: strategy: fail-fast: false matrix: - os-arch: [maci-x86_64, ubuntu-x86_64] + os-arch: [ubuntu-x86_64] include: - os-arch: ubuntu-x86_64 os: ubuntu-22.04 - - os-arch: maci-x86_64 - os: macos-latest runs-on: ${{ matrix.os }} steps: - # Check out StableHLO repo - name: Checkout StableHLO uses: actions/checkout@v2 @@ -53,13 +50,11 @@ jobs: with: llvm-version: ${{ steps.llvm-version.outputs.version }} - # Configuration for linux - name: Configure and Build LLVM os-arch='${{ matrix.os-arch }}' shell: bash run: | ./build_tools/github_actions/ci_build_llvm.sh "$GITHUB_WORKSPACE/llvm-project/" "$GITHUB_WORKSPACE/llvm-build" - # Configure for linux - name: Build and Test StableHLO os-arch='${{ matrix.os-arch }}' run: | ./build_tools/github_actions/ci_build_stablehlo.sh "$GITHUB_WORKSPACE/llvm-build" "$GITHUB_WORKSPACE/stablehlo-build" diff --git a/build_tools/github_actions/ci_build_llvm.sh b/build_tools/github_actions/ci_build_llvm.sh index 95f40100547..0081a8ffb36 100755 --- a/build_tools/github_actions/ci_build_llvm.sh +++ b/build_tools/github_actions/ci_build_llvm.sh @@ -25,21 +25,12 @@ fi LLVM_SRC_DIR="$1" LLVM_BUILD_DIR="$2" -# Check for LLD -LLVM_ENABLE_LLD="" -if command -v lld &> /dev/null -then - LLVM_ENABLE_LLD="-DLLVM_ENABLE_LLD=ON" - echo "lld found, compiling with '$LLVM_ENABLE_LLD'" -else - echo "lld not found, using default linker" -fi - +# Configure LLVM cmake -GNinja \ "-H$LLVM_SRC_DIR/llvm" \ "-B$LLVM_BUILD_DIR" \ -DLLVM_INSTALL_UTILS=ON \ - "$LLVM_ENABLE_LLD" \ + -DLLVM_ENABLE_LLD=ON \ -DLLVM_ENABLE_PROJECTS=mlir \ -DLLVM_TARGETS_TO_BUILD="X86;NVPTX;AMDGPU" \ -DLLVM_INCLUDE_TOOLS=ON \ diff --git a/build_tools/github_actions/ci_build_stablehlo.sh b/build_tools/github_actions/ci_build_stablehlo.sh index f130b9c2a60..534db670a9c 100755 --- a/build_tools/github_actions/ci_build_stablehlo.sh +++ b/build_tools/github_actions/ci_build_stablehlo.sh @@ -28,28 +28,18 @@ fi LLVM_BUILD_DIR="$1" STABLEHLO_BUILD_DIR="$2" -# Check for LLD -FLAGS="" -LLD_FLAG="-DLLVM_ENABLE_LLD=ON" -if command -v lld &> /dev/null -then - echo "lld found, appending flag '$LLD_FLAG'" - FLAGS="$LLD_FLAG" -else - echo "lld not found, using default linker" -fi - -# Build StableHLO +# Configure StableHLO cmake -GNinja \ - "$FLAGS" \ -B"$STABLEHLO_BUILD_DIR" \ + -DLLVM_ENABLE_LLD=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_ENABLE_ASSERTIONS=On \ + -DMLIR_DIR="$LLVM_BUILD_DIR/lib/cmake/mlir" \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ - -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_ENABLE_ASSERTIONS=On \ - -DMLIR_DIR="$LLVM_BUILD_DIR/lib/cmake/mlir" +# Build and Check StableHLO cd "$STABLEHLO_BUILD_DIR" ninja check-stablehlo