-
Notifications
You must be signed in to change notification settings - Fork 15
132 lines (110 loc) · 5.36 KB
/
build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
opencl-icd-loader-git-tag: "v2023.04.17"
opencl-headers-git-tag: "v2023.04.17"
jobs:
build:
name: ${{ matrix.os }}-${{ matrix.cxx-compiler }}-${{ matrix.cmake-build-type }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
max-parallel: 3
matrix:
name: [ubuntu, windows, macos]
include:
- name: ubuntu
os: ubuntu-latest
c-compiler: "gcc"
cxx-compiler: "g++"
cmake-build-type: "Release"
cmake-build-flag: ""
- name: windows
os: windows-latest
c-compiler: "cl.exe"
cxx-compiler: "cl.exe"
cmake-build-type: "Release"
cmake-build-flag: "-A x64"
- name: macos
os: macos-latest
c-compiler: "clang"
cxx-compiler: "clang++"
cmake-build-type: "Release"
cmake-build-flag: ""
steps:
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.8
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install ninja
shell: bash
- name: Get specific version of CMake, Ninja
uses: lukka/[email protected]
- name: Install ocl-icd-loader - windows
if: matrix.os == 'windows-latest'
run: |
cd ..
git clone --branch ${{ env.opencl-icd-loader-git-tag }} https://github.com/KhronosGroup/OpenCL-ICD-Loader
git clone --branch ${{ env.opencl-headers-git-tag }} https://github.com/KhronosGroup/OpenCL-Headers
# cmake -D CMAKE_INSTALL_PREFIX="./OpenCL-Headers/install" -S "./OpenCL-Headers" -B "./OpenCL-Headers/build"
cmake -S "./OpenCL-Headers" -B "./OpenCL-Headers/build"
cmake --build "./OpenCL-Headers/build" --parallel 6 --target install
cmake -D CMAKE_PREFIX_PATH="./OpenCL-Headers" -D OPENCL_ICD_LOADER_HEADERS_DIR="./OpenCL-Headers/" -S "./OpenCL-ICD-Loader" -B "./OpenCL-ICD-Loader/build" -A x64
cmake --build "./OpenCL-ICD-Loader/build" --parallel 6 --target install --config Release
shell: bash -l {0}
# - name: Install cuda toolkit (windows)
# if: matrix.os == 'windows-latest'
# uses: Jimver/[email protected]
# id: cuda-toolkit
# with:
# cuda: '12.1.0'
- name: Install ocl-icd-loader - linux
if: matrix.os == 'ubuntu-latest'
run: |
cd ..
git clone --branch ${{ env.opencl-icd-loader-git-tag }} https://github.com/KhronosGroup/OpenCL-ICD-Loader
git clone --branch ${{ env.opencl-headers-git-tag }} https://github.com/KhronosGroup/OpenCL-Headers
cmake -S "./OpenCL-Headers" -B "./OpenCL-Headers/build"
sudo cmake --build "./OpenCL-Headers/build" --parallel 6 --target install
cmake -D CMAKE_PREFIX_PATH="./OpenCL-Headers/" -D OPENCL_ICD_LOADER_HEADERS_DIR="./OpenCL-Headers/" -S "./OpenCL-ICD-Loader" -B "./OpenCL-ICD-Loader/build"
sudo cmake --build "./OpenCL-ICD-Loader/build" --parallel 6 --target install --config Release
shell: bash -l {0}
# - name: Install cuda toolkit (ubuntu)
# if: matrix.os == 'ubuntu-latest'
# run: |
# wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
# sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
# wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-ubuntu2204-12-1-local_12.1.1-530.30.02-1_amd64.deb
# sudo dpkg -i cuda-repo-ubuntu2204-12-1-local_12.1.1-530.30.02-1_amd64.deb
# sudo cp /var/cuda-repo-ubuntu2204-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
# sudo apt-get update
# sudo apt-get -y install cuda
- uses: actions/checkout@v4
with:
submodules: true
- name: compile CLIc - linux
if: matrix.os == 'ubuntu-latest'
run : |
pwd
cmake -S "${{ github.workspace }}" -B "${{ runner.workspace }}/build" -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DBUILD_BENCHMARK=OFF -DOpenCL_LIBRARIES:FILEPATH="/usr/local/lib/libOpenCL.so" -DOpenCL_INCLUDE_DIRS:PATH="/usr/local/include/"
cmake --build "${{ runner.workspace }}/build" --parallel 10 --config Release
shell: bash -l {0}
- name: compile CLIc - windows
if: matrix.os == 'windows-latest'
run : |
cmake -S "${{ github.workspace }}" -B "${{ runner.workspace }}/build" -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DBUILD_BENCHMARK=OFF -DOpenCL_LIBRARIES:FILEPATH="C:/Program Files/OpenCL-ICD-Loader/lib/OpenCL.lib" -DOpenCL_INCLUDE_DIRS:PATH="C:/Program Files (x86)/OpenCLHeaders/include/"
cmake --build "${{ runner.workspace }}/build" --parallel 10 --config Release
shell: bash -l {0}
- name: compile CLIc - macos
if: matrix.os == 'macos-latest'
run : |
cmake -S "${{ github.workspace }}" -B "${{ runner.workspace }}/build" -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DBUILD_BENCHMARK=OFF
cmake --build "${{ runner.workspace }}/build" --parallel 10 --config Release
shell: bash -l {0}