Skip to content
This repository was archived by the owner on Jul 22, 2026. It is now read-only.

Commit 3a17b13

Browse files
committed
Use explicit GCC install dir for Intel SYCL
1 parent 6fed73a commit 3a17b13

2 files changed

Lines changed: 14 additions & 15 deletions

File tree

scripts/ci/sycl_configure.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,19 @@ def main() -> None:
5252
if itlabai_sycl_targets:
5353
cmake_args.append(f"-DITLABAI_SYCL_TARGETS={itlabai_sycl_targets}")
5454

55+
c_flags = os.environ.get("ITLABAI_C_FLAGS", "")
56+
cxx_flags = os.environ.get("ITLABAI_CXX_FLAGS", "")
57+
gcc_install_dir = os.environ.get("ITLABAI_GCC_INSTALL_DIR", "")
58+
if gcc_install_dir:
59+
gcc_toolchain_flag = f"--gcc-install-dir={gcc_install_dir}"
60+
cmake_args.append(f"-DCMAKE_C_FLAGS={gcc_toolchain_flag} {c_flags}".strip())
61+
cmake_args.append(f"-DCMAKE_CXX_FLAGS={gcc_toolchain_flag} {cxx_flags}".strip())
62+
else:
63+
if c_flags:
64+
cmake_args.append(f"-DCMAKE_C_FLAGS={c_flags}")
65+
if cxx_flags:
66+
cmake_args.append(f"-DCMAKE_CXX_FLAGS={cxx_flags}")
67+
5568
run(
5669
[
5770
"cmake",

scripts/ci/sycl_x86_setup.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,7 @@ def setup_linux_runtime() -> None:
9797
run(["sudo", "apt-get", "update"])
9898
run(["sudo", "apt-get", "install", "-y", "intel-oneapi-runtime-opencl"])
9999

100-
gcc_shim_dir = Path(require_env("RUNNER_TEMP")) / "gcc-13-shim"
101-
gcc_shim_dir.mkdir(parents=True, exist_ok=True)
102-
for link_name, target in (
103-
("gcc", "/usr/bin/gcc-13"),
104-
("g++", "/usr/bin/g++-13"),
105-
("cc", "/usr/bin/gcc-13"),
106-
("c++", "/usr/bin/g++-13"),
107-
):
108-
link_path = gcc_shim_dir / link_name
109-
if link_path.exists() or link_path.is_symlink():
110-
link_path.unlink()
111-
link_path.symlink_to(target)
112-
113-
current_path = os.environ.get("PATH", "")
114-
write_env("PATH", f"{gcc_shim_dir}:{current_path}" if current_path else str(gcc_shim_dir))
100+
write_env("ITLABAI_GCC_INSTALL_DIR", "/usr/lib/gcc/x86_64-linux-gnu/13")
115101

116102
icd_dir = Path(require_env("RUNNER_TEMP")) / "intel-opencl-icd"
117103
icd_dir.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)