@@ -282,6 +282,15 @@ def setup_unix_compilers(sycl_root: Path) -> None:
282282 openmp_library = find_file ([sycl_root , Path ("/opt/intel/oneapi" )], "libomp.so" )
283283 openmp_library_name = "omp"
284284 openmp_flags = "-fopenmp"
285+ if openmp_library is None and source_built_linux_toolchain :
286+ gcc_root = Path (require_env ("ITLABAI_GCC_INSTALL_DIR" ))
287+ gcc_include_root = gcc_root / "include"
288+ gcc_openmp_header = find_file ([gcc_include_root ], "omp.h" )
289+ gcc_openmp_library = Path (capture (["gcc-13" , "-print-file-name=libgomp.so" ]))
290+ if gcc_openmp_header is not None and gcc_openmp_library .exists ():
291+ openmp_library = gcc_openmp_library
292+ openmp_library_name = "gomp"
293+ openmp_flags = "-fopenmp"
285294 if openmp_library is None and not source_built_linux_toolchain :
286295 main_error ("Unable to locate an Intel toolchain OpenMP runtime library" )
287296
@@ -294,6 +303,9 @@ def setup_unix_compilers(sycl_root: Path) -> None:
294303 ],
295304 "omp.h" ,
296305 )
306+ if openmp_header is None and source_built_linux_toolchain :
307+ gcc_root = Path (require_env ("ITLABAI_GCC_INSTALL_DIR" ))
308+ openmp_header = find_file ([gcc_root / "include" ], "omp.h" )
297309 if openmp_header is None and not source_built_linux_toolchain :
298310 main_error (
299311 "Unable to locate Intel-provided omp.h under the SYCL toolchain"
0 commit comments