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

Commit a30f6bb

Browse files
committed
Fix macOS AdaptiveCpp OpenMP detection
1 parent bfb79bf commit a30f6bb

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

scripts/ci/sycl_adaptivecpp_setup.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,27 @@
77
from common import append_path, capture, prepend_env_path, require_env, run, write_env
88

99

10-
def set_common_env(prefix: str, clang_path: str, clangxx_path: str) -> None:
10+
def set_common_env(prefixes: list[str], clang_path: str, clangxx_path: str) -> None:
11+
prefix_path = ";".join(prefixes)
1112
write_env("ITLABAI_CC", clang_path)
1213
write_env("ITLABAI_CXX", clangxx_path)
13-
write_env("ITLABAI_CMAKE_PREFIX_PATH", prefix)
14+
write_env("ITLABAI_CMAKE_PREFIX_PATH", prefix_path)
1415
write_env("ITLABAI_SYCL_IMPLEMENTATION", "AdaptiveCpp")
1516
write_env("ITLABAI_ENABLE_OPENCV_APPS", "ON")
1617
write_env("ACPP_TARGETS", "omp.library-only")
17-
append_path(f"{prefix}/bin")
18+
append_path(f"{prefixes[0]}/bin")
1819

1920

2021
def setup_macos() -> None:
21-
run(["brew", "install", "adaptivecpp"])
22+
run(["brew", "install", "adaptivecpp", "libomp"])
2223

2324
adaptivecpp_prefix = capture(["brew", "--prefix", "adaptivecpp"])
25+
libomp_prefix = capture(["brew", "--prefix", "libomp"])
2426
clang_path = capture(["xcrun", "--find", "clang"])
2527
clangxx_path = capture(["xcrun", "--find", "clang++"])
2628

27-
set_common_env(adaptivecpp_prefix, clang_path, clangxx_path)
29+
write_env("ITLABAI_OPENMP_ROOT", libomp_prefix)
30+
set_common_env([adaptivecpp_prefix, libomp_prefix], clang_path, clangxx_path)
2831

2932

3033
def setup_linux() -> None:
@@ -88,7 +91,7 @@ def setup_linux() -> None:
8891
)
8992
run(["cmake", "--build", str(build_dir), "--target", "install", "--parallel"])
9093

91-
set_common_env(str(install_dir), "/usr/bin/clang-18", "/usr/bin/clang++-18")
94+
set_common_env([str(install_dir)], "/usr/bin/clang-18", "/usr/bin/clang++-18")
9295
prepend_env_path("LD_LIBRARY_PATH", f"{install_dir}/lib")
9396
prepend_env_path("LD_LIBRARY_PATH", "/usr/lib/llvm-18/lib")
9497

scripts/ci/sycl_configure.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ def main() -> None:
4040
if openmp_include_dir:
4141
cmake_args.append(f"-DITLABAI_OPENMP_INCLUDE_DIR={openmp_include_dir}")
4242

43+
openmp_root = os.environ.get("ITLABAI_OPENMP_ROOT", "")
44+
if openmp_root:
45+
cmake_args.append(f"-DOpenMP_ROOT={openmp_root}")
46+
4347
acpp_targets = os.environ.get("ACPP_TARGETS", "")
4448
if acpp_targets:
4549
cmake_args.append(f"-DACPP_TARGETS={acpp_targets}")

0 commit comments

Comments
 (0)