diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-08-24 16:36:29 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-24 16:38:27 +0300 |
commit | e65f0337e94242baf868aa2cd90a0b489e38b087 (patch) | |
tree | 94b6e8fd20357e23d23a5020ec5165353b4f59f8 /intern/cycles | |
parent | 8c38a994c6b7728d4eae21626b566bcc13376c49 (diff) |
Fix WITH_CYCLES_ONEAPI_BINARIES issues with make release
Fix typo in blender_release.cmake, and ensure that "make release" still works
when ocloc is not available. While a fatal error is useful for debugging, the
current convention is to disable features, especially in cases like this where
there is no simple way to make the feature work.
Differential Revision: https://developer.blender.org/D15774
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/cmake/external_libs.cmake | 20 | ||||
-rw-r--r-- | intern/cycles/kernel/CMakeLists.txt | 8 |
2 files changed, 17 insertions, 11 deletions
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index 51830250f2e..00a824ca99a 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -654,15 +654,29 @@ endif() # oneAPI ########################################################################### -if (WITH_CYCLES_DEVICE_ONEAPI) +if(WITH_CYCLES_DEVICE_ONEAPI) find_package(SYCL) find_package(LevelZero) - if (SYCL_FOUND AND LEVEL_ZERO_FOUND) + if(SYCL_FOUND AND LEVEL_ZERO_FOUND) message(STATUS "Found oneAPI: ${SYCL_LIBRARY}") message(STATUS "Found Level Zero: ${LEVEL_ZERO_LIBRARY}") + + if(WITH_CYCLES_ONEAPI_BINARIES) + if(NOT OCLOC_INSTALL_DIR) + get_filename_component(_sycl_compiler_root ${SYCL_COMPILER} DIRECTORY) + get_filename_component(OCLOC_INSTALL_DIR "${_sycl_compiler_root}/../lib/ocloc" ABSOLUTE) + unset(_sycl_compiler_root) + endif() + + if(NOT EXISTS ${OCLOC_INSTALL_DIR}) + message(STATUS "oneAPI ocloc not found in ${OCLOC_INSTALL_DIR}, disabling WITH_CYCLES_ONEAPI_BINARIES." + " A different ocloc directory can be set using OCLOC_INSTALL_DIR cmake variable.") + set(WITH_CYCLES_ONEAPI_BINARIES OFF) + endif() + endif() else() - message(STATUS "oneAPI or Level Zero not found, disabling oneAPI device from Cycles") + message(STATUS "oneAPI or Level Zero not found, disabling WITH_CYCLES_DEVICE_ONEAPI") set(WITH_CYCLES_DEVICE_ONEAPI OFF) endif() endif() diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index b00515eb037..7c31b21797f 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -785,14 +785,6 @@ if(WITH_CYCLES_DEVICE_ONEAPI) get_filename_component(sycl_compiler_root ${SYCL_COMPILER} DIRECTORY) get_filename_component(sycl_compiler_compiler_name ${SYCL_COMPILER} NAME_WE) - if(NOT OCLOC_INSTALL_DIR) - get_filename_component(OCLOC_INSTALL_DIR "${sycl_compiler_root}/../lib/ocloc" ABSOLUTE) - endif() - if(WITH_CYCLES_ONEAPI_BINARIES AND NOT EXISTS ${OCLOC_INSTALL_DIR}) - message(FATAL_ERROR "WITH_CYCLES_ONEAPI_BINARIES requires ocloc but ${OCLOC_INSTALL_DIR} directory doesn't exist." - " A different ocloc directory can be set using OCLOC_INSTALL_DIR cmake variable.") - endif() - if(UNIX AND NOT APPLE) if(NOT WITH_CXX11_ABI) check_library_exists(sycl |