Skip to content

Commit e382784

Browse files
mnaczkigcbot
authored andcommitted
Add new build workflow to github Action
Add new build workflow to github Action to build IGC OpenSource on public repository on github hosted machines
1 parent ec41408 commit e382784

File tree

9 files changed

+184
-8
lines changed

9 files changed

+184
-8
lines changed

.github/workflows/build-IGC.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# Copyright (C) 2021 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
name: Build IGC
8+
9+
on:
10+
push:
11+
branches: [ master ]
12+
13+
jobs:
14+
build:
15+
if: github.repository == 'intel/intel-graphics-compiler'
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ ubuntu1804, ubuntu2004 ]
21+
llvm_ver: [ 10, 11 ]
22+
compiler: [ gcc, clang ]
23+
# include experimental builds
24+
include:
25+
- llvm_ver: 12
26+
compiler: gcc
27+
os: ubuntu2004
28+
experimental: true
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Run Script Selectiong Docker
32+
run: docker build -f scripts/Dockerfile-${{ matrix.os }} --build-arg BUILD_OS=${{ matrix.os }} --build-arg LLVM_VERSION=${{ matrix.llvm_ver }} --build-arg COMPILER=${{ matrix.compiler }} ./scripts

IGC/AdaptorOCL/ocl_igc_interface/impl/fcl_ocl_translation_ctx_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static bool processCmSrcOptions(
197197
[&optname](const auto& Item) { return std::strcmp(Item, optname.c_str()) == 0; });
198198
if (toErase != userArgs.end()) {
199199
auto itFilename = toErase + 1;
200-
if (itFilename != userArgs.end() && *itFilename != "--") {
200+
if (itFilename != userArgs.end() && strcmp(*itFilename, "--") != 0) {
201201
inputFile = *itFilename;
202202
userArgs.erase(toErase, toErase + 2);
203203
return true;

IGC/VectorCompiler/cmake/spirv.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ if(DEFINED SPIRVDLL_SRC)
9696
ExternalProject_Add(SPIRVDLL_EX
9797
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/SPIRVDLL
9898
SOURCE_DIR ${SPIRV_SOURCES}
99-
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/spirv-install
99+
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/spirv-install -DBASE_LLVM_VERSION=${IGC_OPTION__LLVM_PREFERRED_VERSION}
100100
BUILD_COMMAND ${MAKE_EXEC} SPIRVDLL
101101
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/spirv-install
102102
)
@@ -184,7 +184,7 @@ else()
184184
ExternalProject_Add(SPIRVDLL_EX
185185
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/SPIRVDLL
186186
SOURCE_DIR ${SPIRV_COPY}
187-
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/spirv-install
187+
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/spirv-install -DBASE_LLVM_VERSION=${IGC_OPTION__LLVM_PREFERRED_VERSION}
188188
BUILD_COMMAND ${MAKE_EXEC} SPIRVDLL
189189
INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/spirv-install
190190
)

scripts/Dockerfile-ubuntu1804

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Copyright (C) 2021 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
FROM ubuntu:18.04
8+
LABEL maintainer="[email protected]"
9+
ENV DEBIAN_FRONTEND="noninteractive"
10+
11+
ARG BUILD_OS
12+
ARG LLVM_VERSION
13+
ARG COMPILER
14+
15+
RUN echo "[Build Status Dockerfile] Dockerfile start working"
16+
RUN echo "[Build Status Dockerfile] BUILD_OS = ${BUILD_OS}"
17+
RUN echo "[Build Status Dockerfile] LLVM_VERSION = ${LLVM_VERSION}"
18+
RUN echo "[Build Status Dockerfile] COMPILER = ${COMPILER}"
19+
20+
COPY . /home
21+
RUN /bin/bash -c "BUILD_OS=${BUILD_OS} LLVM_VERSION=${LLVM_VERSION} COMPILER=${COMPILER} sh /home/buildIGC.sh"

scripts/Dockerfile-ubuntu2004

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# Copyright (C) 2021 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
FROM ubuntu:20.04
8+
LABEL maintainer="[email protected]"
9+
ENV DEBIAN_FRONTEND="noninteractive"
10+
11+
ARG BUILD_OS
12+
ARG LLVM_VERSION
13+
ARG COMPILER
14+
15+
RUN echo "[Build Status Dockerfile] Dockerfile start working"
16+
RUN echo "[Build Status Dockerfile] BUILD_OS = ${BUILD_OS}"
17+
RUN echo "[Build Status Dockerfile] LLVM_VERSION = ${LLVM_VERSION}"
18+
RUN echo "[Build Status Dockerfile] COMPILER = ${COMPILER}"
19+
20+
COPY . /home
21+
RUN /bin/bash -c "BUILD_OS=${BUILD_OS} LLVM_VERSION=${LLVM_VERSION} COMPILER=${COMPILER} sh /home/buildIGC.sh"

scripts/buildIGC.sh

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/bin/sh
2+
3+
#
4+
# Copyright (C) 2021 Intel Corporation
5+
#
6+
# SPDX-License-Identifier: MIT
7+
#
8+
9+
set -e
10+
# BUILD_OS supported value [ ubuntu1804, ubuntu2004 ] default ubuntu2004
11+
# LLVM_VERSION supported value [ 10, 11, 12 ] default 11
12+
# COMPILER supported value [ gcc, clang ] default gcc
13+
# OWN_CMAKE_FLAGS not suported but can be use as WA (each flag should be with -D prefix) default empty
14+
# example run: BUILD_OS=ubuntu2004 LLVM_VERSION=11 COMPILER=gcc sh /home/buildIGC.sh
15+
16+
echo "====================BUILD IGC========================="
17+
echo "[Build Status] build script started"
18+
if [ -z ${BUILD_OS+x} ]; then
19+
echo "[Build Status] BUILD_OS is unset, use default ubuntu2004";
20+
BUILD_OS="ubuntu2004"
21+
else
22+
echo "[Build Status] BUILD_OS = ${BUILD_OS}"
23+
fi
24+
if [ -z ${LLVM_VERSION+x} ]; then
25+
echo "[Build Status] LLVM_VERSION is unset, use default 11";
26+
LLVM_VERSION="11"
27+
else
28+
echo "[Build Status] LLVM_VERSION = ${LLVM_VERSION}"
29+
fi
30+
if [ -z ${COMPILER+x} ]; then
31+
echo "[Build Status] COMPILER is unset, use default gcc";
32+
COMPILER="gcc"
33+
else
34+
echo "[Build Status] COMPILER = ${COMPILER}"
35+
fi
36+
if [ -z ${OWN_CMAKE_FLAGS+x} ]; then
37+
echo "[Build Status] OWN_CMAKE_FLAGS is unset, use default EMPTY";
38+
OWN_CMAKE_FLAGS=""
39+
else
40+
echo "[Build Status] OWN_CMAKE_FLAGS = ${OWN_CMAKE_FLAGS}"
41+
fi
42+
43+
44+
apt-get update
45+
apt-get install -y flex bison libz-dev cmake curl wget build-essential git software-properties-common
46+
apt-get update
47+
echo "[Build Status] flex bison libz-dev cmake curl wget build-essential git software-properties-common INSTALLED"
48+
49+
if [ "$BUILD_OS" = "ubuntu1804" ]; then
50+
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -
51+
apt-add-repository "deb https://apt.kitware.com/ubuntu/ bionic main"
52+
apt update
53+
apt-get install -y cmake
54+
echo "[Build Status] new cmake on Ubuntu18.04 INSTALLED"
55+
wget --no-check-certificate -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
56+
add-apt-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-$LLVM_VERSION main"
57+
apt update
58+
echo '[Build Status] LLVM "$LLVM_VERSION" on Ubuntu18.04 PREPARED'
59+
fi
60+
apt-get install -y llvm-"$LLVM_VERSION" llvm-"$LLVM_VERSION"-dev clang-"$LLVM_VERSION" liblld-"$LLVM_VERSION" liblld-"$LLVM_VERSION"-dev
61+
echo "[Build Status] LLVM INSTALLED"
62+
63+
mkdir workspace
64+
cd workspace
65+
/usr/bin/git version
66+
/usr/bin/git clone https://github.com/intel/intel-graphics-compiler ./igc
67+
cd igc
68+
echo "[Build Status] IGC commit hash below:"
69+
/usr/bin/git log -1 --format='%H'
70+
/usr/bin/git clone https://github.com/intel/vc-intrinsics ../vc-intrinsics
71+
/usr/bin/git clone https://github.com/KhronosGroup/SPIRV-Headers.git ../SPIRV-Headers
72+
/usr/bin/git clone https://github.com/KhronosGroup/SPIRV-Tools.git ../SPIRV-Tools
73+
/usr/bin/git clone --branch llvm_release_"$LLVM_VERSION"0 https://github.com/KhronosGroup/SPIRV-LLVM-Translator ../llvm-project/llvm/projects/llvm-spirv
74+
echo "[Build Status] All necessary repository CLONED"
75+
mkdir build
76+
cd build
77+
curl -s https://api.github.com/repos/intel/intel-graphics-compiler/releases/latest | grep browser_download_url | egrep 'opencl_|core_' | cut -d '"' -f 4 | wget -qi -
78+
dpkg -i *.deb
79+
echo "[Build Status] Old IGC with opencl-clang downloaded and INSTALLED, WA to install opencl-clang"
80+
81+
if [ "$BUILD_OS" = "ubuntu1804" ] && [ "$LLVM_VERSION" = "11" ]; then
82+
LLVM_VERSION_PREFERRED="$LLVM_VERSION".1.0
83+
else
84+
LLVM_VERSION_PREFERRED="$LLVM_VERSION".0.0
85+
fi
86+
echo "[Build Status] LLVM_VERSION_PREFERRED = $LLVM_VERSION_PREFERRED"
87+
88+
CONFIG_VARS="-DIGC_OPTION__LLVM_MODE=Prebuilds -DIGC_OPTION__LLVM_PREFERRED_VERSION=$LLVM_VERSION_PREFERRED"
89+
case $COMPILER in
90+
"clang")
91+
CONFIG_VARS="$CONFIG_VARS -DCMAKE_C_COMPILER=clang-$LLVM_VERSION -DCMAKE_CXX_COMPILER=clang++-$LLVM_VERSION"
92+
;;
93+
esac
94+
CONFIG_VARS="$CONFIG_VARS $OWN_CMAKE_FLAGS"
95+
echo "[Build Status] CONFIG_VARS = $CONFIG_VARS"
96+
97+
cmake ../ $CONFIG_VARS
98+
echo "[Build Status] Cmake created"
99+
100+
make -j`nproc`
101+
echo "[Build Status] make DONE"
102+
echo "====================BUILD IGC========================="

visa/Common_ISA.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ struct vector_opnd {
606606
int getSizeInBinary() const;
607607
};
608608

609-
typedef struct {
609+
typedef struct _raw_opnd{
610610
uint32_t index;
611611
unsigned short offset;
612612

visa/Optimizer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SPDX-License-Identifier: MIT
1818
#include <unordered_set>
1919
#include <optional>
2020

21-
typedef struct{
21+
typedef struct _AddrSubReg_Node{
2222
short immAddrOff = 0;
2323
int subReg = 0;
2424
INST_LIST_ITER iter;
@@ -81,7 +81,7 @@ typedef std::list<vISA::MSGTable*>::iterator MSGTable_ITER;
8181

8282
#define MESSAGE_HEADER_THRESHOLD 1
8383

84-
typedef struct
84+
typedef struct _DEFA0
8585
{
8686
vISA::G4_INST *pred = nullptr;
8787
vISA::G4_INST *curr = nullptr;

visa/include/JitterDataStruct.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ SPDX-License-Identifier: MIT
1111

1212
#include <stdint.h>
1313

14-
typedef struct {
14+
typedef struct _VISA_BB_INFO{
1515
int id;
1616
unsigned staticCycle;
1717
unsigned sendStallCycle;
1818
unsigned char loopNestLevel;
1919
} VISA_BB_INFO;
2020

21-
typedef struct {
21+
typedef struct _FINALIZER_INFO{
2222
// Common part
2323
bool isSpill;
2424
int numGRFUsed;

0 commit comments

Comments
 (0)