Skip to content

Update cmake-multi-platform.yml #4

Update cmake-multi-platform.yml

Update cmake-multi-platform.yml #4

name: Build with OpenCL on Ubuntu and Windows
on: [push, pull_request]
jobs:
build-ubuntu:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install OpenCL
run: |
sudo apt-get update
sudo apt-get install -y ocl-icd-opencl-dev pocl-opencl-icd
- name: Verify OpenCL installation
run: |
clinfo # Lists available OpenCL platforms and devices
- name: Build project
run: |
# Placeholder: Replace with your build commands (e.g., make, cmake)
chdir /home/runner/work/ae2f/CL-Ann
rm -r -f build
cd build
cmake ..
cmake --build .
cd ..
- name: Run tests
run: |
chdir /home/runner/work/ae2f/CL-Ann/build
ctest
cd ..
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install OpenCL Runtime (Intel CPU)
shell: pwsh
run: |
# Download Intel OpenCL CPU runtime (update URL if needed)
$url = "https://downloadmirror.intel.com/736607/opencl_runtime_2023.16.10.0_x64_setup.msi"
$output = "opencl_setup.msi"
Invoke-WebRequest -Uri $url -OutFile $output
# Install silently
Start-Process msiexec -ArgumentList "/i $output /quiet /norestart" -Wait -NoNewWindow
Write-Host "OpenCL runtime installed"
- name: Verify OpenCL setup
shell: pwsh
run: |
# Placeholder: Add a verification step if you have a tool/test program
Write-Host "OpenCL runtime should be available (no clinfo on Windows by default)"
- name: Build project
shell: cmd
run: |
# Placeholder: Replace with your build commands (e.g., MSBuild, cmake)
chdir C:/Users/runneradmin/work/ae2f/CL-Ann
echo Building OpenCL project on Windows...
chdir build
cmake ..
cmake --build .
chdir ..
- name: Run tests
shell: cmd
run: |
# Placeholder: Replace with your test commands
echo Running tests on Windows...
chdir C:/Users/runneradmin/work/ae2f/CL-Ann/build
ctest
chdir ..