Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[open3d] add Open3D port #41844

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2770ca2
[open3d] new port
Apr 19, 2021
9f2533c
[open3d] update to 0.18.0
aminya Oct 29, 2024
d7f50d8
[open3d] add external dependencies and flags
aminya Oct 29, 2024
e49cecb
[open3d] add liblzf dependency
aminya Oct 29, 2024
d958566
[open3d] add msgpack dependency
aminya Oct 29, 2024
0d3c781
[open3d] fix finding of TinyGLTF
aminya Oct 29, 2024
c711874
[open3d] add jsoncpp dependency
aminya Oct 29, 2024
0007019
[lapack] support the lapacke feature of lapack
aminya Oct 29, 2024
fc1c8b9
[open3d] add intel-oneapi, blas, lapack, lapacke features
aminya Oct 29, 2024
9ddb8fc
[open3d] add zeromq dependency
aminya Oct 29, 2024
a901b78
[open3d] add the gui feature
aminya Oct 29, 2024
dd470be
[open3d] add python feature
aminya Oct 29, 2024
dbb81f6
[open3d] add OpenMP feature
aminya Oct 29, 2024
8c39d40
[open3d] remove excess flags set by default
aminya Oct 29, 2024
7cb7957
[open3d] add azure kinect and realsense support
aminya Oct 29, 2024
4738138
[open3d] add missing Open3D build
aminya Oct 29, 2024
240ed42
[open3d] fix finding of blas/lapack libraries
aminya Oct 29, 2024
bd2f65d
[open3d] add fmt formatting patch
aminya Oct 29, 2024
fea6bc4
[open3d] add embree3 dependency
aminya Oct 29, 2024
6baa0f7
[open3d] use the system parallel stl
aminya Oct 29, 2024
976240b
[open3d] fix liblzf includes
aminya Oct 29, 2024
fca3d35
[open3d] use cppzmq instead of zeromq
aminya Oct 29, 2024
9ddc03b
[open3d] fix all the fmt build errors
aminya Oct 29, 2024
933da63
[open3d] fix curl macro redefinition
aminya Oct 29, 2024
bcd1c4a
[open3d] add minizip dependency
aminya Oct 29, 2024
8bfb31a
[open3d] add missing std includes
aminya Oct 29, 2024
745242c
[open3d] fix imgui obsolete functions
aminya Oct 29, 2024
fd93578
[open3d] add more llvm paths for libc++
aminya Oct 31, 2024
c558d07
[open3d] fix webrtc for Windows
aminya Oct 31, 2024
075cce3
[open3d] fix finding libcurl via CMake
aminya Oct 31, 2024
9451b48
[ci] add required libc++ libraries for Open3D
aminya Oct 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ports/lapack-reference/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#TODO: Features to add:
# USE_XBLAS??? extended precision blas. needs xblas
# LAPACKE should be its own PORT
# USE_OPTIMIZED_LAPACK (Probably not what we want. Does a find_package(LAPACK): probably for LAPACKE only builds _> own port?)
# LAPACKE Builds LAPACKE
# LAPACKE_WITH_TMG Build LAPACKE with tmglib routines
if(EXISTS "${CURRENT_INSTALLED_DIR}/share/clapack/copyright")
message(FATAL_ERROR "Can't build ${PORT} if clapack is installed. Please remove clapack:${TARGET_TRIPLET}, and try to install ${PORT}:${TARGET_TRIPLET} again.")
Expand Down Expand Up @@ -56,13 +54,19 @@ if(VCPKG_USE_INTERNAL_Fortran)
endif()
endif()

vcpkg_check_features(OUT_FEATURE_OPTIONS options
FEATURES
lapacke LAPACKE
)
aminya marked this conversation as resolved.
Show resolved Hide resolved

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"-DUSE_OPTIMIZED_BLAS=${USE_OPTIMIZED_BLAS}"
"-DCMAKE_REQUIRE_FIND_PACKAGE_BLAS=${USE_OPTIMIZED_BLAS}"
"-DCBLAS=${CBLAS}"
"-DTEST_FORTRAN_COMPILER=OFF"
"-DLAPACKE=${LAPACKE}"
${FORTRAN_CMAKE}
MAYBE_UNUSED_VARIABLES
CMAKE_REQUIRE_FIND_PACKAGE_BLAS
Expand Down
5 changes: 4 additions & 1 deletion ports/lapack-reference/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lapack-reference",
"version": "3.11.0",
"port-version": 6,
"port-version": 7,
"description": "LAPACK - Linear Algebra PACKage",
"homepage": "https://netlib.org/lapack/",
"license": "BSD-3-Clause-Open-MPI",
Expand Down Expand Up @@ -39,6 +39,9 @@
"cblas": {
"description": "Builds CBLAS"
},
"lapacke": {
"description": "Build the LAPACKE C Interface to LAPACK"
},
"noblas": {
"description": "Use external optimized BLAS",
"supports": "!windows | !static",
Expand Down
40 changes: 40 additions & 0 deletions ports/open3d/0001-uvatlas.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake
index c3dc38855..69a4821e1 100644
--- a/3rdparty/find_dependencies.cmake
+++ b/3rdparty/find_dependencies.cmake
@@ -1521,14 +1521,25 @@ endif()
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_vtk)

# UVAtlas
-include(${Open3D_3RDPARTY_DIR}/uvatlas/uvatlas.cmake)
-open3d_import_3rdparty_library(3rdparty_uvatlas
- HIDDEN
- INCLUDE_DIRS ${UVATLAS_INCLUDE_DIRS}
- LIB_DIR ${UVATLAS_LIB_DIR}
- LIBRARIES ${UVATLAS_LIBRARIES}
- DEPENDS ext_uvatlas
-)
+if(USE_SYSTEM_UVATLAS)
+ open3d_find_package_3rdparty_library(3rdparty_uvatlas
+ PACKAGE uvatlas
+ TARGETS Microsoft::UVAtlas
+ )
+ if(NOT 3rdparty_uvatlas_FOUND)
+ set(USE_SYSTEM_UVATLAS OFF)
+ endif()
+endif()
+if(NOT USE_SYSTEM_UVATLAS)
+ include(${Open3D_3RDPARTY_DIR}/uvatlas/uvatlas.cmake)
+ open3d_import_3rdparty_library(3rdparty_uvatlas
+ HIDDEN
+ INCLUDE_DIRS ${UVATLAS_INCLUDE_DIRS}
+ LIB_DIR ${UVATLAS_LIB_DIR}
+ LIBRARIES ${UVATLAS_LIBRARIES}
+ DEPENDS ext_uvatlas
+ )
+endif()
list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_uvatlas)


--
2.45.2
41 changes: 41 additions & 0 deletions ports/open3d/0002-blas.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake
index d694621ad..a2b45e8ff 100644
--- a/3rdparty/find_dependencies.cmake
+++ b/3rdparty/find_dependencies.cmake
@@ -1597,11 +1597,29 @@ else(OPEN3D_USE_ONEAPI_PACKAGES)
find_package(LAPACKE)
if(BLAS_FOUND AND LAPACK_FOUND AND LAPACKE_FOUND)
message(STATUS "System BLAS/LAPACK/LAPACKE found.")
- list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM
- ${BLAS_LIBRARIES}
- ${LAPACK_LIBRARIES}
- ${LAPACKE_LIBRARIES}
- )
+ if("${BLAS_LIBRARIES}" MATCHES ".*openblas.*")
+ find_package(OpenBLAS)
+ if(OpenBLAS_FOUND)
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM OpenBLAS::OpenBLAS)
+ endif()
+ endif()
+ if(NOT TARGET OpenBlas::OpenBLAS)
+ if(TARGET BLAS::BLAS)
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM BLAS::BLAS)
+ else()
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM ${BLAS_LIBRARIES})
+ endif()
+ endif()
+ if(TARGET LAPACK::LAPACK)
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM LAPACK::LAPACK)
+ else()
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM ${LAPACK_LIBRARIES})
+ endif()
+ if(TARGET LAPACK::LAPACKE)
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM LAPACK::LAPACKE)
+ else()
+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM ${LAPACKE_LIBRARIES})
+ endif()
else()
message(STATUS "System BLAS/LAPACK/LAPACKE not found, setting USE_SYSTEM_BLAS=OFF.")
set(USE_SYSTEM_BLAS OFF)
--
2.45.2
49 changes: 49 additions & 0 deletions ports/open3d/0003-liblzf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake
index 13a538461..859edbab5 100644
--- a/3rdparty/find_dependencies.cmake
+++ b/3rdparty/find_dependencies.cmake
@@ -792,8 +792,8 @@ endif()
# liblzf
if(USE_SYSTEM_LIBLZF)
open3d_find_package_3rdparty_library(3rdparty_liblzf
- PACKAGE liblzf
- TARGETS liblzf::liblzf
+ PACKAGE unofficial-liblzf
+ TARGETS unofficial::liblzf::liblzf
)
if(NOT 3rdparty_liblzf_FOUND)
set(USE_SYSTEM_LIBLZF OFF)
diff --git a/cpp/open3d/io/file_format/FilePCD.cpp b/cpp/open3d/io/file_format/FilePCD.cpp
index ce04f2e2d..f1a1c0cdb 100644
--- a/cpp/open3d/io/file_format/FilePCD.cpp
+++ b/cpp/open3d/io/file_format/FilePCD.cpp
@@ -5,7 +5,11 @@
// SPDX-License-Identifier: MIT
// ----------------------------------------------------------------------------

+#if __has_include(<lzf.h>)
+#include <lzf.h>
+#else
#include <liblzf/lzf.h>
+#endif

#include <cstdint>
#include <cstdio>
diff --git a/cpp/open3d/t/io/file_format/FilePCD.cpp b/cpp/open3d/t/io/file_format/FilePCD.cpp
index 4aa229c0d..9eb7ec285 100644
--- a/cpp/open3d/t/io/file_format/FilePCD.cpp
+++ b/cpp/open3d/t/io/file_format/FilePCD.cpp
@@ -5,7 +5,11 @@
// SPDX-License-Identifier: MIT
// ----------------------------------------------------------------------------

+#if __has_include(<lzf.h>)
+#include <lzf.h>
+#else
#include <liblzf/lzf.h>
+#endif

#include <cinttypes>
#include <cstdint>
--
2.45.2
23 changes: 23 additions & 0 deletions ports/open3d/0004-tiny_gltf.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake
index 859edbab5..7c44d738f 100644
--- a/3rdparty/find_dependencies.cmake
+++ b/3rdparty/find_dependencies.cmake
@@ -968,13 +968,10 @@ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_CUSTOM Open3D::3rdparty_tinyfil

# tinygltf
if(USE_SYSTEM_TINYGLTF)
- open3d_find_package_3rdparty_library(3rdparty_tinygltf
- PACKAGE TinyGLTF
- TARGETS TinyGLTF::TinyGLTF
+ find_path(TINYGLTF_INCLUDE_DIRS "tiny_gltf.h" REQUIRED)
+ open3d_import_3rdparty_library(3rdparty_tinygltf
+ INCLUDE_DIRS ${TINYGLTF_INCLUDE_DIRS}
)
- if(NOT 3rdparty_tinygltf_FOUND)
- set(USE_SYSTEM_TINYGLTF OFF)
- endif()
endif()
if(NOT USE_SYSTEM_TINYGLTF)
include(${Open3D_3RDPARTY_DIR}/tinygltf/tinygltf.cmake)
--
2.45.2
15 changes: 15 additions & 0 deletions ports/open3d/0005-jsoncpp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake
index 7c44d738f..45b1dcfdb 100644
--- a/3rdparty/find_dependencies.cmake
+++ b/3rdparty/find_dependencies.cmake
@@ -770,7 +770,7 @@ endif()
if(USE_SYSTEM_JSONCPP)
open3d_find_package_3rdparty_library(3rdparty_jsoncpp
PACKAGE jsoncpp
- TARGETS jsoncpp_lib
+ TARGETS JsonCpp::JsonCpp
)
if(NOT 3rdparty_jsoncpp_FOUND)
set(USE_SYSTEM_JSONCPP OFF)
--
2.45.2
50 changes: 50 additions & 0 deletions ports/open3d/0007-parallelstl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a87d542b5..805668cac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -296,7 +296,7 @@ endif()
# This does not affect 3rd party libraries.
# Tensorflow 2.9+ requires cxx_17, but MSVC 19.29 throws errors with C++17
# enabled.
-if (BUILD_SYCL_MODULE OR BUILD_TENSORFLOW_OPS)
+if (BUILD_SYCL_MODULE OR BUILD_TENSORFLOW_OPS OR USE_SYSTEM_PARALLELSTL)
set(CMAKE_CXX_STANDARD 17)
else()
set(CMAKE_CXX_STANDARD 14)
--
2.45.2
33 changes: 33 additions & 0 deletions ports/open3d/0008-curl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/cpp/open3d/utility/Download.cpp b/cpp/open3d/utility/Download.cpp
index 025dbc664..0193d1fa3 100644
--- a/cpp/open3d/utility/Download.cpp
+++ b/cpp/open3d/utility/Download.cpp
@@ -22,7 +22,9 @@
#define USE_OPENSSL
#endif

+#ifndef CURL_STATICLIB
#define CURL_STATICLIB
+#endif

#include <curl/curl.h>
#include <curl/easy.h>
diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake
index cdb0f30ee..755895f66 100644
--- a/3rdparty/find_dependencies.cmake
+++ b/3rdparty/find_dependencies.cmake
@@ -847,8 +847,9 @@ endif()
# - openssl.cmake needs to be included before curl.cmake, for the
# BORINGSSL_ROOT_DIR variable.
if(USE_SYSTEM_CURL)
- open3d_pkg_config_3rdparty_library(3rdparty_curl
- SEARCH_ARGS libcurl
+ open3d_find_package_3rdparty_library(3rdparty_curl
+ PACKAGE CURL
+ TARGETS CURL::libcurl
)
if(NOT 3rdparty_curl_FOUND)
set(USE_SYSTEM_CURL OFF)
--
2.45.2

18 changes: 18 additions & 0 deletions ports/open3d/0009-std-includes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/cpp/open3d/visualization/rendering/Renderer.h b/cpp/open3d/visualization/rendering/Renderer.h
index b642e4b6d..c2ec38f94 100644
--- a/cpp/open3d/visualization/rendering/Renderer.h
+++ b/cpp/open3d/visualization/rendering/Renderer.h
@@ -7,6 +7,10 @@

#pragma once

+#include <functional>
+#include <memory>
+#include <string>
+
#include "open3d/visualization/rendering/MaterialModifier.h"
#include "open3d/visualization/rendering/RendererHandle.h"

--
2.45.2

42 changes: 42 additions & 0 deletions ports/open3d/0010-imgui.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff --git a/cpp/open3d/visualization/gui/ListView.cpp b/cpp/open3d/visualization/gui/ListView.cpp
index 6ee1ddc98..9d3f8a967 100644
--- a/cpp/open3d/visualization/gui/ListView.cpp
+++ b/cpp/open3d/visualization/gui/ListView.cpp
@@ -8,6 +8,7 @@
#include "open3d/visualization/gui/ListView.h"

#include <imgui.h>
+#include <imgui_internal.h> // ImMin

#include <algorithm>
#include <cmath>
diff --git a/cpp/open3d/visualization/gui/ListView.cpp b/cpp/open3d/visualization/gui/ListView.cpp
index 4d77f0bd1..6ee1ddc98 100644
--- a/cpp/open3d/visualization/gui/ListView.cpp
+++ b/cpp/open3d/visualization/gui/ListView.cpp
@@ -15,6 +15,22 @@
#include "open3d/visualization/gui/Theme.h"
#include "open3d/visualization/gui/Util.h"

+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+namespace ImGui {
+static inline bool ListBoxHeader(const char *label,
+ int items_count,
+ int height_in_items = -1) {
+ float height = GetTextLineHeightWithSpacing() *
+ ((height_in_items < 0 ? ImMin(items_count, 7)
+ : height_in_items) +
+ 0.25f) +
+ GetStyle().FramePadding.y * 2.0f;
+ return BeginListBox(label, ImVec2(0.0f, height));
+} // Helper to calculate size from items_count and height_in_items
+static inline void ListBoxFooter() { EndListBox(); }
+} // namespace ImGui
+#endif
+
namespace open3d {
namespace visualization {
namespace gui {
--
2.45.2

31 changes: 31 additions & 0 deletions ports/open3d/0011-llvm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake
index 169bfbe1a..cdb0f30ee 100644
--- a/3rdparty/find_dependencies.cmake
+++ b/3rdparty/find_dependencies.cmake
@@ -1321,6 +1321,11 @@ if(BUILD_GUI)
# search path. LLVM version must be >= 7 to compile Filament.
if (NOT CLANG_LIBDIR)
set(ubuntu_default_llvm_lib_dirs
+ /usr/lib/llvm-20/lib
+ /usr/lib/llvm-19/lib
+ /usr/lib/llvm-18/lib
+ /usr/lib/llvm-17/lib
+ /usr/lib/llvm-16/lib
/usr/lib/llvm-15/lib
/usr/lib/llvm-14/lib
/usr/lib/llvm-13/lib
@@ -1347,6 +1352,11 @@ if(BUILD_GUI)
# is not enforced by CMake.
if (NOT CLANG_LIBDIR)
find_library(CPPABI_LIBRARY c++abi PATH_SUFFIXES
+ llvm-20/lib
+ llvm-19/lib
+ llvm-18/lib
+ llvm-17/lib
+ llvm-16/lib
llvm-15/lib
llvm-14/lib
llvm-13/lib
--
2.45.2

Loading
Loading