Skip to content

Commit d220c94

Browse files
authored
Test pocl#main on CI (#569)
1 parent a1535e5 commit d220c94

File tree

1 file changed

+87
-1
lines changed

1 file changed

+87
-1
lines changed

.github/workflows/ci.yml

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,34 @@ jobs:
3030
- windows-latest
3131
arch:
3232
- x64
33+
pocl: [jll,]
3334
include:
35+
- version: '1.10'
36+
os: ubuntu-latest
37+
arch: x64
38+
pocl: local
39+
allow_failure: true
40+
- version: '1.11'
41+
os: ubuntu-latest
42+
arch: x64
43+
pocl: local
44+
allow_failure: true
45+
- version: 'nightly'
46+
os: ubuntu-latest
47+
arch: x64
48+
pocl: local
49+
allow_failure: true
50+
- version: 'nightly'
51+
os: ubuntu-latest
52+
arch: x64
53+
pocl: local
54+
allow_failure: true
3455
- version: 'nightly'
3556
os: ubuntu-latest
3657
arch: x64
58+
pocl: jll
3759
allow_failure: true
60+
3861
steps:
3962
- uses: actions/checkout@v4
4063
- uses: julia-actions/setup-julia@v2
@@ -43,7 +66,70 @@ jobs:
4366
arch: ${{ matrix.arch }}
4467
show-versioninfo: true
4568
- uses: julia-actions/cache@v2
46-
- run: |
69+
- name: Checkout pocl
70+
if: ${{ matrix.pocl == 'local' }}
71+
uses: actions/checkout@v4
72+
with:
73+
repository: pocl/pocl
74+
path: pocl
75+
- name: Install system dependencies
76+
if: ${{ matrix.pocl == 'local' }}
77+
run: |
78+
sudo apt-get update
79+
sudo apt-get install -y build-essential cmake ninja-build pkg-config
80+
- name: Install Julia dependencies
81+
if: ${{ matrix.pocl == 'local' }}
82+
run: |
83+
touch pocl/Project.toml
84+
julia --project=pocl --color=yes -e '
85+
using Pkg
86+
# unversioned
87+
Pkg.add([
88+
"SPIRV_Tools_jll",
89+
"OpenCL_jll",
90+
"OpenCL_Headers_jll",
91+
"Hwloc_jll",
92+
"CMake_jll",
93+
])
94+
# versioned
95+
llvm_version = "$(Base.libllvm_version.major).$(Base.libllvm_version.minor)"
96+
Pkg.add(name="LLVM_full_jll", version=llvm_version)
97+
Pkg.add(name="SPIRV_LLVM_Translator_jll", version=llvm_version)'
98+
- name: Build PoCL
99+
if: ${{ matrix.pocl == 'local' }}
100+
run: |
101+
julia --project=pocl --color=yes -e '
102+
using LLVM_full_jll,
103+
SPIRV_Tools_jll, SPIRV_LLVM_Translator_jll,
104+
OpenCL_jll, OpenCL_Headers_jll,
105+
Hwloc_jll, CMake_jll
106+
sourcedir = joinpath(@__DIR__, "pocl")
107+
builddir = joinpath(@__DIR__, "build")
108+
destdir = joinpath(@__DIR__, "target")
109+
prefix = []
110+
for jll in [SPIRV_Tools_jll, SPIRV_LLVM_Translator_jll, OpenCL_jll,
111+
OpenCL_Headers_jll, Hwloc_jll]
112+
push!(prefix, jll.artifact_dir)
113+
end
114+
withenv("LD_LIBRARY_PATH" => joinpath(Sys.BINDIR, Base.PRIVATE_LIBDIR)) do
115+
mkpath(builddir)
116+
run(```cmake -B $builddir -S $sourcedir
117+
-GNinja
118+
-DCMAKE_CXX_FLAGS="-fdiagnostics-color=always"
119+
-DCMAKE_C_FLAGS="-fdiagnostics-color=always"
120+
-DCMAKE_BUILD_TYPE=Debug
121+
-DENABLE_TESTS:Bool=OFF
122+
-DPOCL_DEBUG_MESSAGES:Bool=ON
123+
-DCMAKE_INSTALL_PREFIX=$destdir
124+
-DWITH_LLVM_CONFIG=$(LLVM_full_jll.artifact_dir)/tools/llvm-config
125+
-DCMAKE_PREFIX_PATH="$(join(prefix, ";"))"
126+
-DKERNELLIB_HOST_CPU_VARIANTS=distro```)
127+
run(```$(cmake()) --build $builddir --parallel $(Sys.CPU_THREADS) --target install```)
128+
end'
129+
echo '[pocl_jll]' > test/LocalPreferences.toml
130+
echo 'libpocl_path="${{ github.workspace }}/target/lib/libpocl.so"' >> test/LocalPreferences.toml
131+
- name: "Co-develop Enzyme and KA"
132+
run: |
47133
julia -e '
48134
using Pkg
49135
withenv("JULIA_PKG_PRECOMPILE_AUTO" => 0) do

0 commit comments

Comments
 (0)