Skip to content

Commit

Permalink
[open3d] use the system parallel stl
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 29, 2024
1 parent fea6bc4 commit 8018efa
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
37 changes: 37 additions & 0 deletions ports/open3d/0007-parallelstl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake
index 169bfbe1a..5415f7c6d 100644
--- a/3rdparty/find_dependencies.cmake
+++ b/3rdparty/find_dependencies.cmake
@@ -1619,14 +1619,22 @@ else() # if(OPEN3D_USE_ONEAPI_PACKAGES)
endif()

# parallelstl
- include(${Open3D_3RDPARTY_DIR}/parallelstl/parallelstl.cmake)
- open3d_import_3rdparty_library(3rdparty_parallelstl
- PUBLIC
- INCLUDE_DIRS ${PARALLELSTL_INCLUDE_DIRS}
- INCLUDE_ALL
- DEPENDS ext_parallelstl
- )
- list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS_FROM_SYSTEM Open3D::3rdparty_parallelstl)
+ option(USE_SYSTEM_PARALLELSTL "Use parallelstl from the system" OFF)
+ if(USE_SYSTEM_PARALLELSTL)
+ find_package(ParallelSTL CONFIG REQUIRED)
+ target_compile_definitions(pstl::ParallelSTL INTERFACE _GLIBCXX_USE_TBB_PAR_BACKEND=0)
+ target_compile_definitions(pstl::ParallelSTL INTERFACE PSTL_USE_PARALLEL_POLICIES=0)
+ list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS_FROM_SYSTEM pstl::ParallelSTL)
+ else()
+ include(${Open3D_3RDPARTY_DIR}/parallelstl/parallelstl.cmake)
+ open3d_import_3rdparty_library(3rdparty_parallelstl
+ PUBLIC
+ INCLUDE_DIRS ${PARALLELSTL_INCLUDE_DIRS}
+ INCLUDE_ALL
+ DEPENDS ext_parallelstl
+ )
+ list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS_FROM_SYSTEM Open3D::3rdparty_parallelstl)
+ endif()

# MKL/BLAS
if(USE_BLAS)
--
2.45.2
2 changes: 2 additions & 0 deletions ports/open3d/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ vcpkg_from_github(
0004-tiny_gltf.patch
0005-jsoncpp.patch
0006-fmt.patch # remove in the next release https://github.com/isl-org/Open3D/pull/6783
0007-parallelstl.patch
)

string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_WINDOWS_RUNTIME)
Expand Down Expand Up @@ -81,6 +82,7 @@ vcpkg_cmake_configure(
-DUSE_SYSTEM_UVATLAS=ON
-DUSE_SYSTEM_VTK=ON
-DUSE_SYSTEM_ZEROMQ=ON
-DUSE_SYSTEM_PARALLELSTL=ON
)

vcpkg_cmake_build(TARGET Open3D)
Expand Down
2 changes: 1 addition & 1 deletion versions/o-/open3d.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "5b39c8604918389390bb16f205f04d966bba1985",
"git-tree": "4ee800ac365571c707f3a865868ed6fa83ce631f",
"version-semver": "0.18.0",
"port-version": 0
}
Expand Down

0 comments on commit 8018efa

Please sign in to comment.