|
7 | 7 | from common import append_path, capture, prepend_env_path, require_env, run, write_env |
8 | 8 |
|
9 | 9 |
|
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) |
11 | 12 | write_env("ITLABAI_CC", clang_path) |
12 | 13 | write_env("ITLABAI_CXX", clangxx_path) |
13 | | - write_env("ITLABAI_CMAKE_PREFIX_PATH", prefix) |
| 14 | + write_env("ITLABAI_CMAKE_PREFIX_PATH", prefix_path) |
14 | 15 | write_env("ITLABAI_SYCL_IMPLEMENTATION", "AdaptiveCpp") |
15 | 16 | write_env("ITLABAI_ENABLE_OPENCV_APPS", "ON") |
16 | 17 | write_env("ACPP_TARGETS", "omp.library-only") |
17 | | - append_path(f"{prefix}/bin") |
| 18 | + append_path(f"{prefixes[0]}/bin") |
18 | 19 |
|
19 | 20 |
|
20 | 21 | def setup_macos() -> None: |
21 | | - run(["brew", "install", "adaptivecpp"]) |
| 22 | + run(["brew", "install", "adaptivecpp", "libomp"]) |
22 | 23 |
|
23 | 24 | adaptivecpp_prefix = capture(["brew", "--prefix", "adaptivecpp"]) |
| 25 | + libomp_prefix = capture(["brew", "--prefix", "libomp"]) |
24 | 26 | clang_path = capture(["xcrun", "--find", "clang"]) |
25 | 27 | clangxx_path = capture(["xcrun", "--find", "clang++"]) |
26 | 28 |
|
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) |
28 | 31 |
|
29 | 32 |
|
30 | 33 | def setup_linux() -> None: |
@@ -88,7 +91,7 @@ def setup_linux() -> None: |
88 | 91 | ) |
89 | 92 | run(["cmake", "--build", str(build_dir), "--target", "install", "--parallel"]) |
90 | 93 |
|
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") |
92 | 95 | prepend_env_path("LD_LIBRARY_PATH", f"{install_dir}/lib") |
93 | 96 | prepend_env_path("LD_LIBRARY_PATH", "/usr/lib/llvm-18/lib") |
94 | 97 |
|
|
0 commit comments