From 87dae7d800cdb035d710af178dca21481d4e84a0 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 12 Jun 2024 19:19:12 +0200 Subject: [PATCH] Build: Clean up oneAPI cmake messages * Always define root directories in LIBDIR even when not needed, to silence some warnings. * Only show warnings about not finding libs when oneAPI is enabled. * Prefix message for context. --- build_files/cmake/platform/platform_unix.cmake | 2 +- intern/cycles/cmake/external_libs.cmake | 16 +++++++++------- intern/cycles/kernel/CMakeLists.txt | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index 3abc83419ab..c92beb9e877 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -397,7 +397,7 @@ if(WITH_CYCLES AND WITH_CYCLES_OSL) endif() add_bundled_libraries(osl/lib) -if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI AND DEFINED LIBDIR) +if(WITH_CYCLES AND DEFINED LIBDIR) set(CYCLES_LEVEL_ZERO ${LIBDIR}/level-zero CACHE PATH "Path to Level Zero installation") mark_as_advanced(CYCLES_LEVEL_ZERO) if(EXISTS ${CYCLES_LEVEL_ZERO} AND NOT LEVEL_ZERO_ROOT_DIR) diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index c59f78b1f1a..935e5296572 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -96,16 +96,18 @@ endif() ########################################################################### if(WITH_CYCLES_DEVICE_ONEAPI OR EMBREE_SYCL_SUPPORT) + # Find packages for even when WITH_CYCLES_DEVICE_ONEAPI is OFF, as it's + # needed for linking to Embree with SYCL support. find_package(SYCL) find_package(LevelZero) - set_and_warn_library_found("oneAPI" SYCL_FOUND WITH_CYCLES_DEVICE_ONEAPI) - set_and_warn_library_found("Level Zero" LEVEL_ZERO_FOUND WITH_CYCLES_DEVICE_ONEAPI) - if(SYCL_FOUND AND SYCL_VERSION VERSION_GREATER_EQUAL 6.0 AND LEVEL_ZERO_FOUND) - message(STATUS "Found Level Zero: ${LEVEL_ZERO_LIBRARY}") - else() - message(STATUS "SYCL 6.0+ or Level Zero not found, disabling WITH_CYCLES_DEVICE_ONEAPI") - set(WITH_CYCLES_DEVICE_ONEAPI OFF) + if(WITH_CYCLES_DEVICE_ONEAPI) + set_and_warn_library_found("oneAPI" SYCL_FOUND WITH_CYCLES_DEVICE_ONEAPI) + set_and_warn_library_found("Level Zero" LEVEL_ZERO_FOUND WITH_CYCLES_DEVICE_ONEAPI) + if(NOT (SYCL_FOUND AND SYCL_VERSION VERSION_GREATER_EQUAL 6.0 AND LEVEL_ZERO_FOUND)) + message(STATUS "SYCL 6.0+ or Level Zero not found, disabling WITH_CYCLES_DEVICE_ONEAPI") + set(WITH_CYCLES_DEVICE_ONEAPI OFF) + endif() endif() endif() diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 6457b4dc6d3..05c390e1768 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -915,7 +915,7 @@ if(WITH_CYCLES_DEVICE_ONEAPI) endif() if(NOT oclocids_ret EQUAL 0) list(REMOVE_ITEM CYCLES_ONEAPI_INTEL_BINARIES_ARCH ${device}) - message(STATUS "binaries for ${device} not supported by Intel Graphics Compiler/ocloc, skipped.") + message(STATUS "Cycles oneAPI: binaries for ${device} not supported by Intel Graphics Compiler/ocloc, skipped.") endif() endforeach() list(JOIN CYCLES_ONEAPI_INTEL_BINARIES_ARCH "," gen_devices_string)