Skip to content

Commit 1e7910b

Browse files
authored
[oneAPI] oneAPI_Level_Zero_Loader LTS (#13625)
1 parent 167888c commit 1e7910b

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Note that this script can accept some limited command-line arguments, run
2+
# `julia build_tarballs.jl --help` to see a usage message.
3+
using BinaryBuilder, Pkg
4+
5+
include("../common_lts.jl")
6+
name = "oneAPI_Level_Zero_Loader_LTS"
7+
8+
9+
# Bash recipe for building across all platforms
10+
script = raw"""
11+
cd level-zero
12+
install_license LICENSE
13+
14+
mkdir build && cd build
15+
cmake -DCMAKE_INSTALL_PREFIX=$prefix \
16+
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
17+
-DCMAKE_BUILD_TYPE=Release ..
18+
make -j${nproc}
19+
make install
20+
"""
21+
22+
# These are the platforms we will build for by default, unless further
23+
# platforms are passed in on the command line
24+
platforms = [
25+
Platform("i686", "linux"; libc="glibc"),
26+
Platform("x86_64", "linux"; libc="glibc"),
27+
Platform("i686", "linux"; libc="musl"),
28+
Platform("x86_64", "linux"; libc="musl"),
29+
]
30+
platforms = expand_cxxstring_abis(platforms)
31+
32+
# The products that we will ensure are always built
33+
products = [
34+
LibraryProduct("libze_loader", :libze_loader),
35+
LibraryProduct("libze_tracing_layer", :libze_tracing_layer),
36+
LibraryProduct("libze_validation_layer", :libze_validation_layer),
37+
]
38+
39+
# Dependencies that must be installed before this package can be built
40+
dependencies = [
41+
BuildDependency("OpenCL_Headers_jll"),
42+
43+
# The oneAPI Level Zero loader expects an implementation of its spec to be available.
44+
# That means we need to dlopen the implementation, e.g. Intel's NEO, before the loader!
45+
# To make sure that implementation sits at the same API level of the loader, we have
46+
# both packages depend on the oneAPI Level Zero Headers package.
47+
#
48+
# Users of these packages, e.g. oneAPI.jl, should only depend on the loader and an
49+
# implementation, but will need to make sure to load one before the other.
50+
Dependency("oneAPI_Level_Zero_Headers_LTS_jll"; compat="=$api_version"),
51+
]
52+
53+
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
54+
preferred_gcc_version=v"8")

0 commit comments

Comments
 (0)