Fix-opening-closing #1189
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 : | | |
cmake -S "${{ github.workspace }}" -B "${{ runner.workspace }}/build" -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DBUILD_DOCUMENTATION=OFF -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_DOCUMENTATION=OFF -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_DOCUMENTATION=OFF -DBUILD_BENCHMARK=OFF | |
cmake --build "${{ runner.workspace }}/build" --parallel 10 --config Release | |
shell: bash -l {0} |