Skip to content

Commit

Permalink
Fix no tbb target with BUILD_SYCL_MODULE
Browse files Browse the repository at this point in the history
Use sycl_target_sources for files with sycl code in cmake.

style fix
  • Loading branch information
ssheorey committed Oct 10, 2024
1 parent 84f0ef9 commit cb71f22
Show file tree
Hide file tree
Showing 11 changed files with 414 additions and 317 deletions.
7 changes: 4 additions & 3 deletions 3rdparty/embree/embree.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ if(BUILD_SYCL_MODULE)
set(ISA_ARGS ${ISA_ARGS} -DCMAKE_CXX_COMPILER=icpx)
set(ISA_ARGS ${ISA_ARGS} -DCMAKE_C_COMPILER=icx)
set(ISA_ARGS ${ISA_ARGS} -DEMBREE_SYCL_SUPPORT=ON)
#list(APPEND ISA_LIBS embree4_sycl)
list(APPEND ISA_LIBS embree4_sycl ze_wrapper)
list(APPEND ISA_BUILD_BYPRODUCTS "<INSTALL_DIR>/${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}embree4_sycl${CMAKE_STATIC_LIBRARY_SUFFIX}"
"<INSTALL_DIR>/${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}ze_wrapper${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()


Expand Down Expand Up @@ -101,11 +103,10 @@ ExternalProject_Add(
<INSTALL_DIR>/${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}math${CMAKE_STATIC_LIBRARY_SUFFIX}
<INSTALL_DIR>/${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}tasking${CMAKE_STATIC_LIBRARY_SUFFIX}
<INSTALL_DIR>/${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}ze_wrapper${CMAKE_STATIC_LIBRARY_SUFFIX}
<INSTALL_DIR>/${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}embree_rthwif${CMAKE_STATIC_LIBRARY_SUFFIX}
${ISA_BUILD_BYPRODUCTS}
)

ExternalProject_Get_Property(ext_embree INSTALL_DIR)
set(EMBREE_INCLUDE_DIRS ${INSTALL_DIR}/include/ ${INSTALL_DIR}/src/ext_embree/) # "/" is critical.
set(EMBREE_LIB_DIR ${INSTALL_DIR}/${Open3D_INSTALL_LIB_DIR})
set(EMBREE_LIBRARIES embree4_sycl embree4 simd lexers sys math tasking ze_wrapper embree_rthwif ${ISA_LIBS})
set(EMBREE_LIBRARIES embree4 simd lexers sys math tasking ${ISA_LIBS})
6 changes: 3 additions & 3 deletions 3rdparty/find_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ if(BUILD_GUI)
${CPP_LIBRARY} ${CPPABI_LIBRARY})
message(STATUS "Filament C++ libraries: ${CPP_LIBRARY} ${CPPABI_LIBRARY}")
if (LIBCPP_VERSION GREATER 11)
message(WARNING "libc++ (LLVM) version ${LIBCPP_VERSION} > 11 includes libunwind that "
message(WARNING "libc++ (LLVM) version ${LIBCPP_VERSION} > 11 includes libunwind that "
"interferes with the system libunwind.so.8 and may crash Python code when exceptions "
"are used. Please consider using libc++ (LLVM) v11.")
endif()
Expand Down Expand Up @@ -1697,7 +1697,7 @@ else(OPEN3D_USE_ONEAPI_PACKAGES)
INCLUDE_DIRS ${STATIC_MKL_INCLUDE_DIR}
LIB_DIR ${STATIC_MKL_LIB_DIR}
LIBRARIES ${STATIC_MKL_LIBRARIES}
DEPENDS ext_tbb ext_mkl_include ext_mkl
DEPENDS Open3D::3rdparty_tbb ext_mkl_include ext_mkl
)
if(UNIX)
target_compile_options(3rdparty_blas INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-m64>")
Expand All @@ -1719,7 +1719,7 @@ else(OPEN3D_USE_ONEAPI_PACKAGES)
endif()
if(NOT USE_SYSTEM_TBB)
include(${Open3D_3RDPARTY_DIR}/mkl/tbb.cmake)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM TBB::tbb)
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_tbb)
else()
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_tbb)
endif()
Expand Down
1 change: 1 addition & 0 deletions 3rdparty/mkl/tbb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ install(TARGETS tbb EXPORT ${PROJECT_NAME}Targets
RUNTIME DESTINATION ${Open3D_INSTALL_BIN_DIR}
COMPONENT tbb
)
add_library(${PROJECT_NAME}::3rdparty_tbb ALIAS tbb)
11 changes: 10 additions & 1 deletion cpp/open3d/t/geometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ target_sources(tgeometry PRIVATE
LineSet.cpp
BoundingVolume.cpp
PointCloud.cpp
RaycastingScene.cpp
RGBDImage.cpp
TensorMap.cpp
TriangleMesh.cpp
Expand All @@ -16,6 +15,16 @@ target_sources(tgeometry PRIVATE
VtkUtils.cpp
)

if (BUILD_SYCL_MODULE)
open3d_sycl_target_sources(tgeometry PRIVATE
RaycastingScene.cpp
)
else()
target_sources(tgeometry PRIVATE
RaycastingScene.cpp
)
endif()

open3d_show_and_abort_on_warning(tgeometry)
open3d_set_global_properties(tgeometry)
open3d_set_open3d_lib_properties(tgeometry)
Expand Down
Loading

0 comments on commit cb71f22

Please sign in to comment.