Skip to content

Commit

Permalink
Addressed feedback - only run build and test on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
GleasonK committed Sep 1, 2022
1 parent 17fca58 commit 280fee1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 33 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
13 changes: 2 additions & 11 deletions build_tools/github_actions/ci_build_llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
22 changes: 6 additions & 16 deletions build_tools/github_actions/ci_build_stablehlo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 280fee1

Please sign in to comment.