From 5f7183e4cf56a0d1752e5ffcc7f8772bc8ac6ce5 Mon Sep 17 00:00:00 2001 From: andreroesti Date: Thu, 31 Oct 2024 14:42:01 -0700 Subject: [PATCH] fix workflow --- .github/workflows/test.yaml | 13 ++++++++++--- docker/Dockerfile | 6 +++--- docker/setup-build.sh | 8 ++++++-- docker/setup-deps.sh | 18 ++++++++++++++++++ docker/setup-llvm.sh | 24 +++++++----------------- 5 files changed, 44 insertions(+), 25 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2c8b71b..86d57c5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,11 +8,18 @@ on: permissions: contents: read # Default everything to read-only +env: + WORKSPACE_PATH: ${{ github.workspace }} jobs: - job1: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: checkout and build - run: ./ci/run.sh \ No newline at end of file + - name: build LLVM + run: ./docker/setup-llvm.sh + - name: install dependencies + run: sudo ./docker/setup-deps.sh + - name: build LLVM-MCA-Daemon + run: ./docker/setup-build.sh + \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 77bcb2c..ec98465 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,11 +13,11 @@ COPY . LLVM-MCA-Daemon/ COPY docker/setup-ssh.sh ./setup/ RUN setup/setup-ssh.sh -COPY docker/setup-llvm.sh ./setup/ -RUN setup/setup-llvm.sh - COPY docker/setup-deps.sh ./setup/ RUN setup/setup-deps.sh + +COPY docker/setup-llvm.sh ./setup/ +RUN setup/setup-llvm.sh COPY docker/setup-build.sh ./setup/ RUN setup/setup-build.sh diff --git a/docker/setup-build.sh b/docker/setup-build.sh index 9618f01..e9234bb 100755 --- a/docker/setup-build.sh +++ b/docker/setup-build.sh @@ -4,8 +4,12 @@ set -e export DEBIAN_FRONTEND=noninteractive -mkdir LLVM-MCA-Daemon/build -cd LLVM-MCA-Daemon/build +if [ -z "${WORKSPACE_PATH}" ]; then +WORKSPACE_PATH=/work/LLVM-MCA-Daemon +fi + +mkdir -p ${WORKSPACE_PATH}/build +cd ${WORKSPACE_PATH}/build cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/LLVM-MCA-Daemon \ -DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 \ diff --git a/docker/setup-deps.sh b/docker/setup-deps.sh index aa8c842..ef86063 100755 --- a/docker/setup-deps.sh +++ b/docker/setup-deps.sh @@ -1,11 +1,14 @@ #!/bin/bash +# This script probably needs to run as sudo. + set -e export DEBIAN_FRONTEND=noninteractive dpkg --add-architecture i386 +# General dependencies -- apt-get update apt-get install -y \ autoconf \ @@ -50,6 +53,21 @@ apt-get install -y \ htop \ vim \ nano + +# Dependencies to build LLVM -- +apt-get update +apt-get install -y software-properties-common wget +wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc +add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" +apt-get update +apt-get install -y \ + build-essential \ + clang-14 \ + cmake \ + lld-14 \ + git \ + ninja-build + rm -rf /var/lib/apt/lists/* rm -rf /root/.cache diff --git a/docker/setup-llvm.sh b/docker/setup-llvm.sh index 41224d3..96ad12b 100755 --- a/docker/setup-llvm.sh +++ b/docker/setup-llvm.sh @@ -4,27 +4,17 @@ set -e export DEBIAN_FRONTEND=noninteractive -apt-get update -apt-get install -y software-properties-common wget +if [ -z "${WORKSPACE_PATH}" ]; then +WORKSPACE_PATH=/work/LLVM-MCA-Daemon +fi -wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc -add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main" - -apt-get update -apt-get install -y \ - build-essential \ - clang-14 \ - cmake \ - lld-14 \ - git \ - ninja-build -rm -rf /var/lib/apt/lists/* +# Run ./setup-deps.sh before this to install dependencies needed to build LLVM git clone https://github.com/llvm/llvm-project.git llvm cd llvm -git am < /work/LLVM-MCA-Daemon/patches/add-identifier-to-mca-instruction.patch -git am < /work/LLVM-MCA-Daemon/patches/start-mapping-e500-itenerary-model-to-new-schedule.patch -git am < /work/LLVM-MCA-Daemon/patches/abstract-memory-group.patch +git am < ${WORKSPACE_PATH}/patches/add-identifier-to-mca-instruction.patch +git am < ${WORKSPACE_PATH}/patches/start-mapping-e500-itenerary-model-to-new-schedule.patch +git am < ${WORKSPACE_PATH}/patches/abstract-memory-group.patch mkdir build && cd build cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/opt/llvm-main \ -DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 \