Skip to content

Commit

Permalink
fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej committed Oct 31, 2024
1 parent 26536a5 commit 6a18842
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 25 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ on:
permissions:
contents: read # Default everything to read-only

env:
WORKSPACE_PATH: ${{ github.workspace }}

jobs:
job1:
build LLVM-MCA-Daemon:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: checkout and build
run: ./ci/run.sh
- 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

6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions docker/setup-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
18 changes: 18 additions & 0 deletions docker/setup-deps.sh
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down Expand Up @@ -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
24 changes: 7 additions & 17 deletions docker/setup-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 6a18842

Please sign in to comment.