From 2770ca2f0f31ec5426c2b33f200f0b9b3522c69b Mon Sep 17 00:00:00 2001 From: Francisco Facioni Date: Mon, 19 Apr 2021 17:59:55 +0200 Subject: [PATCH 01/31] [open3d] new port --- .../open3d/0001-use-external-libraries.patch | 385 ++++++++++++++++++ ports/open3d/0002-fix-eigen-3-3.patch | 59 +++ ports/open3d/portfile.cmake | 77 ++++ ports/open3d/vcpkg.json | 34 ++ versions/baseline.json | 4 + versions/o-/open3d.json | 9 + 6 files changed, 568 insertions(+) create mode 100644 ports/open3d/0001-use-external-libraries.patch create mode 100644 ports/open3d/0002-fix-eigen-3-3.patch create mode 100644 ports/open3d/portfile.cmake create mode 100644 ports/open3d/vcpkg.json create mode 100644 versions/o-/open3d.json diff --git a/ports/open3d/0001-use-external-libraries.patch b/ports/open3d/0001-use-external-libraries.patch new file mode 100644 index 00000000000000..6714ec0ca0b51d --- /dev/null +++ b/ports/open3d/0001-use-external-libraries.patch @@ -0,0 +1,385 @@ +diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake +index e0035c9..be6d801 100644 +--- a/3rdparty/find_dependencies.cmake ++++ b/3rdparty/find_dependencies.cmake +@@ -299,15 +299,8 @@ find_package(Threads REQUIRED) + list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "Threads") + + # Assimp +-message(STATUS "Building library Assimp from source") +-include(${Open3D_3RDPARTY_DIR}/assimp/assimp.cmake) +-import_3rdparty_library(3rdparty_assimp +- INCLUDE_DIRS ${ASSIMP_INCLUDE_DIR} +- LIB_DIR ${ASSIMP_LIB_DIR} +- LIBRARIES ${ASSIMP_LIBRARIES} +-) +-set(ASSIMP_TARGET "3rdparty_assimp") +-add_dependencies(3rdparty_assimp ext_assimp) ++find_package(assimp CONFIG REQUIRED) ++set(ASSIMP_TARGET "assimp::assimp") + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${ASSIMP_TARGET}") + + # OpenMP +@@ -346,7 +339,7 @@ endif() + + # Eigen3 + if(USE_SYSTEM_EIGEN3) +- find_package(Eigen3) ++ find_package(Eigen3 CONFIG REQUIRED) + if(TARGET Eigen3::Eigen) + message(STATUS "Using installed third-party library Eigen3 ${EIGEN3_VERSION_STRING}") + # Eigen3 is a publicly visible dependency, so add it to the list of +@@ -365,23 +358,22 @@ endif() + list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS "${EIGEN3_TARGET}") + + # Flann +-if(USE_SYSTEM_FLANN) +- pkg_config_3rdparty_library(3rdparty_flann flann) +-endif() +-if(NOT USE_SYSTEM_FLANN OR NOT 3rdparty_flann_FOUND) +- build_3rdparty_library(3rdparty_flann DIRECTORY flann) ++find_package(flann CONFIG REQUIRED) ++if(TARGET flann::flann_cpp_s) ++ set(FLANN_TARGET "flann::flann_cpp_s") ++else() ++ set(FLANN_TARGET "flann::flann_cpp") + endif() +-set(FLANN_TARGET "3rdparty_flann") + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${FLANN_TARGET}") + + # Nanoflann +-build_3rdparty_library(3rdparty_nanoflann DIRECTORY nanoflann INCLUDE_DIRS include/ INCLUDE_ALL) +-set(NANOFLANN_TARGET "3rdparty_nanoflann") ++find_package(nanoflann CONFIG REQUIRED) ++set(NANOFLANN_TARGET "nanoflann::nanoflann") + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${NANOFLANN_TARGET}") + + # GLEW + if(USE_SYSTEM_GLEW) +- find_package(GLEW) ++ find_package(GLEW CONFIG REQUIRED) + if(TARGET GLEW::GLEW) + message(STATUS "Using installed third-party library GLEW ${GLEW_VERSION}") + list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "GLEW") +@@ -410,7 +402,7 @@ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${GLEW_TARGET}") + + # GLFW + if(USE_SYSTEM_GLFW) +- find_package(glfw3) ++ find_package(glfw3 CONFIG REQUIRED) + if(TARGET glfw) + message(STATUS "Using installed third-party library glfw3") + list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "glfw3") +@@ -476,7 +468,7 @@ endif() + + # JPEG + if(USE_SYSTEM_JPEG) +- find_package(JPEG) ++ find_package(JPEG REQUIRED) + if(TARGET JPEG::JPEG) + message(STATUS "Using installed third-party library JPEG") + if(NOT BUILD_SHARED_LIBS) +@@ -517,7 +509,7 @@ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${JSONCPP_TARGET}") + + # liblzf + if(USE_SYSTEM_LIBLZF) +- find_package(liblzf) ++ find_package(liblzf CONFIG REQUIRED) + if(TARGET liblzf::liblzf) + message(STATUS "Using installed third-party library liblzf") + if(NOT BUILD_SHARED_LIBS) +@@ -554,7 +546,7 @@ if (BUILD_LIBREALSENSE) + set(USE_SYSTEM_LIBREALSENSE OFF) + endif() + if(USE_SYSTEM_LIBREALSENSE) +- find_package(realsense2) ++ find_package(realsense2 CONFIG REQUIRED) + if(TARGET realsense2::realsense2) + message(STATUS "Using installed third-party library librealsense") + if(NOT BUILD_SHARED_LIBS) +@@ -587,7 +579,7 @@ endif() + + # PNG + if(USE_SYSTEM_PNG) +- find_package(PNG) ++ find_package(PNG CONFIG REQUIRED) + if(TARGET PNG::PNG) + message(STATUS "Using installed third-party library libpng") + if(NOT BUILD_SHARED_LIBS) +@@ -642,29 +634,15 @@ set(TINYFILEDIALOGS_TARGET "3rdparty_tinyfiledialogs") + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${TINYFILEDIALOGS_TARGET}") + + # tinygltf +-if(USE_SYSTEM_TINYGLTF) +- find_package(TinyGLTF) +- if(TARGET TinyGLTF::TinyGLTF) +- message(STATUS "Using installed third-party library TinyGLTF") +- if(NOT BUILD_SHARED_LIBS) +- list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "TinyGLTF") +- endif() +- set(TINYGLTF_TARGET "TinyGLTF::TinyGLTF") +- else() +- message(STATUS "Unable to find installed third-party library TinyGLTF") +- set(USE_SYSTEM_TINYGLTF OFF) +- endif() +-endif() +-if(NOT USE_SYSTEM_TINYGLTF) +- build_3rdparty_library(3rdparty_tinygltf DIRECTORY tinygltf INCLUDE_DIRS tinygltf/) +- target_compile_definitions(3rdparty_tinygltf INTERFACE TINYGLTF_IMPLEMENTATION STB_IMAGE_IMPLEMENTATION STB_IMAGE_WRITE_IMPLEMENTATION) +- set(TINYGLTF_TARGET "3rdparty_tinygltf") +-endif() ++find_path(TINYGLTF_INCLUDE_DIRS "tiny_gltf.h") ++build_3rdparty_library(3rdparty_tinygltf DIRECTORY tinygltf INCLUDE_DIRS ${TINYGLTF_INCLUDE_DIRS}) ++target_compile_definitions(3rdparty_tinygltf INTERFACE TINYGLTF_IMPLEMENTATION STB_IMAGE_IMPLEMENTATION STB_IMAGE_WRITE_IMPLEMENTATION) ++set(TINYGLTF_TARGET "3rdparty_tinygltf") + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${TINYGLTF_TARGET}") + + # tinyobjloader + if(USE_SYSTEM_TINYOBJLOADER) +- find_package(tinyobjloader) ++ find_package(tinyobjloader CONFIG REQUIRED) + if(TARGET tinyobjloader::tinyobjloader) + message(STATUS "Using installed third-party library tinyobjloader") + if(NOT BUILD_SHARED_LIBS) +@@ -685,12 +663,17 @@ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${TINYOBJLOADER_TARGET}") + + # Qhull + if(USE_SYSTEM_QHULL) +- find_package(Qhull) ++ find_package(Qhull CONFIG REQUIRED) + if(TARGET Qhull::qhullcpp) + message(STATUS "Using installed third-party library Qhull") + if(NOT BUILD_SHARED_LIBS) + list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "Qhull") + endif() ++ if(TARGET Qhull::qhullstatic_r) ++ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "Qhull::qhullstatic_r") ++ else() ++ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "Qhull::qhull_r") ++ endif() + set(QHULL_TARGET "Qhull::qhullcpp") + else() + message(STATUS "Unable to find installed third-party library Qhull") +@@ -751,7 +734,7 @@ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${QHULL_TARGET}") + + # fmt + if(USE_SYSTEM_FMT) +- find_package(fmt) ++ find_package(fmt CONFIG REQUIRED) + if(TARGET fmt::fmt-header-only) + message(STATUS "Using installed third-party library fmt (header only)") + list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "fmt") +@@ -775,7 +758,8 @@ list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS "${FMT_TARGET}") + + # Pybind11 + if(USE_SYSTEM_PYBIND11) +- find_package(pybind11) ++ find_package(Python3 COMPONENTS Development REQUIRED) ++ find_package(pybind11 CONFIG REQUIRED) + endif() + if (NOT USE_SYSTEM_PYBIND11 OR NOT TARGET pybind11::module) + set(USE_SYSTEM_PYBIND11 OFF) +@@ -837,7 +821,7 @@ endif() + + # Headless rendering + if (ENABLE_HEADLESS_RENDERING) +- find_package(OSMesa REQUIRED) ++ find_package(OSMesa CONFIG REQUIRED) + add_library(3rdparty_osmesa INTERFACE) + target_include_directories(3rdparty_osmesa INTERFACE ${OSMESA_INCLUDE_DIR}) + target_link_libraries(3rdparty_osmesa INTERFACE ${OSMESA_LIBRARY}) +@@ -851,7 +835,7 @@ if (ENABLE_HEADLESS_RENDERING) + set(OPENGL_TARGET "3rdparty_osmesa") + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${OPENGL_TARGET}") + else() +- find_package(OpenGL) ++ find_package(OpenGL REQUIRED) + if(TARGET OpenGL::GL) + if(NOT BUILD_SHARED_LIBS) + list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "OpenGL") +@@ -864,7 +848,7 @@ endif() + # imgui + if(BUILD_GUI) + if(USE_SYSTEM_IMGUI) +- find_package(ImGui) ++ find_package(ImGui CONFIG REQUIRED) + if(TARGET ImGui::ImGui) + message(STATUS "Using installed third-party library ImGui") + if(NOT BUILD_SHARED_LIBS) +@@ -1039,26 +1023,20 @@ if(BUILD_RPC_INTERFACE) + endif() + + # TBB +-include(${Open3D_3RDPARTY_DIR}/mkl/tbb.cmake) +-import_3rdparty_library(3rdparty_tbb +- INCLUDE_DIRS ${STATIC_TBB_INCLUDE_DIR} +- LIB_DIR ${STATIC_TBB_LIB_DIR} +- LIBRARIES ${STATIC_TBB_LIBRARIES} +-) +-set(TBB_TARGET "3rdparty_tbb") +-add_dependencies(3rdparty_tbb ext_tbb) ++find_package(TBB CONFIG REQUIRED) ++set(TBB_TARGET "TBB::tbb") + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${TBB_TARGET}") + + # parallelstl +-build_3rdparty_library(3rdparty_parallelstl DIRECTORY parallelstl INCLUDE_DIRS include/ INCLUDE_ALL) +-set(PARALLELSTL_TARGET "3rdparty_parallelstl") ++find_package(ParallelSTL CONFIG REQUIRED) ++set(PARALLELSTL_TARGET "pstl::ParallelSTL") + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${PARALLELSTL_TARGET}") + + if(USE_BLAS) + # Try to locate system BLAS/LAPACK +- find_package(BLAS) +- find_package(LAPACK) +- find_package(LAPACKE) ++ find_package(BLAS CONFIG REQUIRED) ++ find_package(LAPACK CONFIG REQUIRED) ++ find_package(LAPACKE CONFIG REQUIRED) + if(BLAS_FOUND AND LAPACK_FOUND AND LAPACKE_FOUND) + message(STATUS "Using system BLAS/LAPACK") + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${BLAS_LIBRARIES}") +diff --git a/3rdparty/mkl/mkl.cmake b/3rdparty/mkl/mkl.cmake +index df08c1b..7f2487d 100644 +--- a/3rdparty/mkl/mkl.cmake ++++ b/3rdparty/mkl/mkl.cmake +@@ -104,7 +104,6 @@ if(WIN32) + mkl_core + mkl_sequential + mkl_tbb_thread +- tbb_static + ) + list(REMOVE_ITEM MKL_LIBRARIES "$<$:mkl_tbb_thread>") + list(REMOVE_ITEM MKL_LIBRARIES "$<$:tbb_static>") +@@ -134,7 +133,7 @@ elseif(APPLE) + ${STATIC_MKL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}mkl_tbb_thread${CMAKE_STATIC_LIBRARY_SUFFIX} + ${STATIC_MKL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}mkl_core${CMAKE_STATIC_LIBRARY_SUFFIX} + ) +- set(STATIC_MKL_LIBRARIES mkl_intel_ilp64 mkl_tbb_thread mkl_core tbb_static) ++ set(STATIC_MKL_LIBRARIES mkl_intel_ilp64 mkl_tbb_thread mkl_core) + else() + ExternalProject_Add( + ext_mkl_include +@@ -196,5 +195,5 @@ else() + BUILD_BYPRODUCTS ${STATIC_MKL_LIB_DIR}/libmkl_merged.a + ) + endif() +- set(STATIC_MKL_LIBRARIES mkl_merged tbb_static) ++ set(STATIC_MKL_LIBRARIES mkl_merged) + endif() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a80c1e6..2ad73fb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -215,9 +215,11 @@ string(CONCAT OPEN3D_VERSION + ) + set(OPEN3D_VERSION_FULL "${OPEN3D_VERSION}${OPEN3D_VERSION_DEVHASH}") + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in +- ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile @ONLY) ++ ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile @ONLY) ++file(COPY ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/docs) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/getting_started.rst.in +- ${CMAKE_CURRENT_SOURCE_DIR}/docs/getting_started.rst @ONLY) ++ ${CMAKE_CURRENT_BINARY_DIR}/docs/getting_started.rst @ONLY) ++file(COPY ${CMAKE_CURRENT_BINARY_DIR}/docs/getting_started.rst DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/docs) + + project(Open3D VERSION ${OPEN3D_VERSION} LANGUAGES C CXX) + message(STATUS "Open3D ${OPEN3D_VERSION_FULL}") +@@ -550,9 +552,6 @@ function(open3d_set_global_properties target) + if(ENABLE_HEADLESS_RENDERING) + target_compile_definitions(${target} PRIVATE HEADLESS_RENDERING) + endif() +- if(NOT WITH_OPENMP) +- target_compile_options(${target} PRIVATE "$<$:-Wno-unknown-pragmas>") +- endif() + if(BUILD_WEBRTC) + target_compile_definitions(${target} PRIVATE BUILD_WEBRTC) + endif() +@@ -590,9 +589,6 @@ function(open3d_set_global_properties target) + target_compile_options(${target} PRIVATE "-Wno-deprecated-declarations" "$<$:-Wno-unused-result>") + endif() + target_compile_options(${target} PRIVATE "$<$:--expt-extended-lambda>") +- # TBB static version is used +- # See: https://github.com/wjakob/tbb/commit/615d690c165d68088c32b6756c430261b309b79c +- target_compile_definitions(${target} PRIVATE __TBB_LIB_NAME=tbb_static) + if(WITH_FAISS) + target_compile_definitions(${target} PRIVATE WITH_FAISS) + endif() +diff --git a/cpp/open3d/CMakeLists.txt b/cpp/open3d/CMakeLists.txt +index 97589af..b210664 100644 +--- a/cpp/open3d/CMakeLists.txt ++++ b/cpp/open3d/CMakeLists.txt +@@ -12,9 +12,11 @@ endfunction() + + # Configure a header file to pass the version settings to the source code + configure_file("${PROJECT_SOURCE_DIR}/cpp/open3d/Open3D.h.in" +- "${PROJECT_SOURCE_DIR}/cpp/open3d/Open3D.h") ++ "${PROJECT_BINARY_DIR}/cpp/open3d/Open3D.h") ++file(COPY "${PROJECT_BINARY_DIR}/cpp/open3d/Open3D.h" DESTINATION "${PROJECT_SOURCE_DIR}/cpp/open3d") + configure_file("${PROJECT_SOURCE_DIR}/cpp/open3d/Open3DConfig.h.in" +- "${PROJECT_SOURCE_DIR}/cpp/open3d/Open3DConfig.h") ++ "${PROJECT_BINARY_DIR}/cpp/open3d/Open3DConfig.h") ++file(COPY "${PROJECT_BINARY_DIR}/cpp/open3d/Open3DConfig.h" DESTINATION "${PROJECT_SOURCE_DIR}/cpp/open3d") + + # Subdirectories + add_subdirectory(camera) +diff --git a/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp b/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp +index e60697c..8ffb002 100644 +--- a/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp ++++ b/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp +@@ -45,12 +45,12 @@ + // 4245: signed/unsigned mismatch + // 4189: local variable is initialized but not referenced + #endif +-#include "PoissonRecon/Src/PreProcessor.h" +-#include "PoissonRecon/Src/MyMiscellany.h" +-#include "PoissonRecon/Src/CmdLineParser.h" +-#include "PoissonRecon/Src/FEMTree.h" +-#include "PoissonRecon/Src/PPolynomial.h" +-#include "PoissonRecon/Src/PointStreamData.h" ++#include "PoissonRecon/PreProcessor.h" ++#include "PoissonRecon/MyMiscellany.h" ++#include "PoissonRecon/CmdLineParser.h" ++#include "PoissonRecon/FEMTree.h" ++#include "PoissonRecon/PPolynomial.h" ++#include "PoissonRecon/PointStreamData.h" + #ifdef _MSC_VER + #pragma warning(pop) + #endif +diff --git a/cpp/open3d/visualization/CMakeLists.txt b/cpp/open3d/visualization/CMakeLists.txt +index 9c38ff5..77534f5 100644 +--- a/cpp/open3d/visualization/CMakeLists.txt ++++ b/cpp/open3d/visualization/CMakeLists.txt +@@ -1,25 +1,24 @@ + # some black magic to automatically create a header file from shader files + file(GLOB SHADER_FILES "shader/glsl/*.glsl") + ++add_custom_target(ShaderFileTarget ALL) + add_custom_command( +- OUTPUT ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader/Shader.h +- COMMAND EncodeShader Shader.h ++ TARGET ShaderFileTarget PRE_BUILD ++ COMMAND EncodeShader ${PROJECT_BINARY_DIR}/Shader.h + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader/ + DEPENDS ${SHADER_FILES} EncodeShader + ) + + foreach(file ${SHADER_FILES}) + add_custom_command( +- OUTPUT ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader/Shader.h +- COMMAND EncodeShader Shader.h ${file} ++ TARGET ShaderFileTarget PRE_BUILD ++ COMMAND EncodeShader ${PROJECT_BINARY_DIR}/Shader.h ${file} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader/ + DEPENDS ${SHADER_FILES} EncodeShader +- APPEND + ) + endforeach(file) + +-add_custom_target(ShaderFileTarget ALL +- DEPENDS ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader/Shader.h) ++add_custom_command(TARGET ShaderFileTarget POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/Shader.h ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader) + set_target_properties(ShaderFileTarget PROPERTIES FOLDER "Custom") + + # build diff --git a/ports/open3d/0002-fix-eigen-3-3.patch b/ports/open3d/0002-fix-eigen-3-3.patch new file mode 100644 index 00000000000000..8fb448d20afd72 --- /dev/null +++ b/ports/open3d/0002-fix-eigen-3-3.patch @@ -0,0 +1,59 @@ +From a27fbebe3e5df8df1a38061ce95b65bfc48bb415 Mon Sep 17 00:00:00 2001 +From: Han +Date: Sat, 9 Jan 2021 20:55:54 +0800 +Subject: [PATCH] Eigen v3.3.* branch does not contain the `transform` + function. And initilizer list is not well supported in Eigen v3.3.*. + +--- + cpp/open3d/geometry/Line3D.cpp | 18 ++++++++++-------- + 1 file changed, 10 insertions(+), 8 deletions(-) + +diff --git a/cpp/open3d/geometry/Line3D.cpp b/cpp/open3d/geometry/Line3D.cpp +index 28e2e6c610..4af474c839 100644 +--- a/cpp/open3d/geometry/Line3D.cpp ++++ b/cpp/open3d/geometry/Line3D.cpp +@@ -1,5 +1,6 @@ + #include "Line3D.h" + ++#include + #include + + namespace open3d { +@@ -27,7 +28,8 @@ Line3D::Line3D(const Eigen::Vector3d& origin, + } + + void Line3D::Transform(const Eigen::Transform& t) { +- this->transform(t); ++ direction() = (t * direction()).normalized(); ++ origin() = t * origin(); + } + + std::pair Line3D::SlabAABBBase( +@@ -87,12 +89,12 @@ utility::optional Line3D::ExactAABB( + box.max_bound_ + Vector3d(tol, tol, tol)}; + + using plane_t = Eigen::Hyperplane; +- std::array planes{{{{-1, 0, 0}, box.min_bound_}, +- {{1, 0, 0}, box.max_bound_}, +- {{0, -1, 0}, box.min_bound_}, +- {{0, 1, 0}, box.max_bound_}, +- {{0, 0, -1}, box.min_bound_}, +- {{0, 0, 1}, box.max_bound_}}}; ++ std::array planes{plane_t{Vector3d{-1, 0, 0}, box.min_bound_}, ++ plane_t{Vector3d{1, 0, 0}, box.max_bound_}, ++ plane_t{Vector3d{0, -1, 0}, box.min_bound_}, ++ plane_t{Vector3d{0, 1, 0}, box.max_bound_}, ++ plane_t{Vector3d{0, 0, -1}, box.min_bound_}, ++ plane_t{Vector3d{0, 0, 1}, box.max_bound_}}; + + // Get the intersections + std::vector parameters; +@@ -321,7 +323,7 @@ Segment3D::Segment3D(const std::pair& pair) + : Segment3D(std::get<0>(pair), std::get<1>(pair)) {} + + void Segment3D::Transform(const Eigen::Transform& t) { +- this->transform(t); ++ this->Transform(t); + end_point_ = t * end_point_; + } + diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake new file mode 100644 index 00000000000000..74120b4d5e0c6f --- /dev/null +++ b/ports/open3d/portfile.cmake @@ -0,0 +1,77 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO intel-isl/Open3D + REF v0.13.0 + SHA512 10134eee86e364738c60bddebad3cf2a82dc7fe8e9f38e35c410b1be6055089b8ebe93b689c254d897cda2d0b10b509af4c44018553d595ee90b8e022af43cd0 + HEAD_REF master + PATCHES + 0001-use-external-libraries.patch + 0002-fix-eigen-3-3.patch # taken from https://github.com/intel-isl/Open3D/pull/2885 +) + +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_WINDOWS_RUNTIME) + +get_filename_component(GIT_PATH ${GIT} DIRECTORY) +vcpkg_add_to_path(PREPEND "${GIT_PATH}") + + +vcpkg_cmake_configure( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DBUILD_SHARED_LIBS=OFF + -DWITH_OPENMP=OFF + -DWITH_FAISS=OFF + -DBUILD_EXAMPLES=OFF + -DBUILD_UNIT_TESTS=OFF + -DBUILD_BENCHMARKS=OFF + -DBUILD_GUI=OFF + -DBUILD_RPC_INTERFACE=OFF + -DUSE_SYSTEM_EIGEN3=ON + -DUSE_SYSTEM_FLANN=ON + -DUSE_SYSTEM_GLEW=ON + -DUSE_SYSTEM_GLFW=ON + -DUSE_SYSTEM_JPEG=ON + -DUSE_SYSTEM_LIBLZF=OFF + -DUSE_SYSTEM_PNG=OFF + -DUSE_SYSTEM_TINYGLTF=ON + -DUSE_SYSTEM_TINYOBJLOADER=ON + -DUSE_SYSTEM_QHULL=ON + -DUSE_SYSTEM_FMT=ON + -DUSE_SYSTEM_PYBIND11=ON + -DUSE_SYSTEM_GOOGLETEST=ON + -DUSE_SYSTEM_IMGUI=ON + -DBUILD_PYTHON_MODULE=OFF + -DBUILD_LIBREALSENSE=OFF + -DBUILD_AZURE_KINECT=OFF + -DBUILD_FILAMENT_FROM_SOURCE=OFF + -DSTATIC_WINDOWS_RUNTIME=${STATIC_WINDOWS_RUNTIME} + -DBUILD_CUDA_MODULE=OFF + -DBUILD_TENSORFLOW_OPS=OFF + -DGLIBCXX_USE_CXX11_ABI=ON + -DDEVELOPER_BUILD=OFF +) + +# we have to build this first otherwise install fails +#vcpkg_cmake_build(TARGET Open3D) +vcpkg_cmake_install() + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_cmake_config_fixup(CONFIG_PATH CMake) +else() + vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Open3D) +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/open3d/t/io/file_format") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/open3d/ml/tensorflow/tf_neighbors") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/open3d/ml/tensorflow/tf_subsampling") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/open3d/visualization/gui/Resources") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/open3d/visualization/gui/Materials") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/open3d/visualization/shader/glsl") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/open3d/visualization/webrtc_server/html") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/open3d/io/file_format") + +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json new file mode 100644 index 00000000000000..78788f9d9b171a --- /dev/null +++ b/ports/open3d/vcpkg.json @@ -0,0 +1,34 @@ +{ + "name": "open3d", + "version-semver": "0.13.0", + "description": "Open3D is an open-source library that supports rapid development of software that deals with 3D data", + "homepage": "www.open3d.org", + "dependencies": [ + "assimp", + "eigen3", + "flann", + "fmt", + "glew", + "glfw3", + "gtest", + "imgui", + "libjpeg-turbo", + "nanoflann", + "opengl", + "parallelstl", + "poissonrecon", + "pybind11", + "qhull", + "tbb", + "tinygltf", + "tinyobjloader", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 9c3339178e157a..2130245bb19060 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6576,6 +6576,10 @@ "baseline": "1.0.1", "port-version": 0 }, + "open3d": { + "baseline": "0.13.0", + "port-version": 0 + }, "open62541": { "baseline": "1.3.12", "port-version": 0 diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json new file mode 100644 index 00000000000000..ce9e0132e8ca17 --- /dev/null +++ b/versions/o-/open3d.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "4d26ab822ab0fb10500ced6d18b42afaec2cbd03", + "version-semver": "0.13.0", + "port-version": 0 + } + ] +} From 9f2533c7ba02bcff0c11ecccc19f945c4018243a Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Mon, 28 Oct 2024 21:52:10 -0700 Subject: [PATCH 02/31] [open3d] update to 0.18.0 [open3d] do not apply the patch Update vcpkg.json --- .../open3d/0001-use-external-libraries.patch | 385 ------------------ ports/open3d/0002-fix-eigen-3-3.patch | 59 --- ports/open3d/portfile.cmake | 9 +- ports/open3d/vcpkg.json | 4 +- versions/baseline.json | 2 +- versions/o-/open3d.json | 4 +- 6 files changed, 6 insertions(+), 457 deletions(-) delete mode 100644 ports/open3d/0001-use-external-libraries.patch delete mode 100644 ports/open3d/0002-fix-eigen-3-3.patch diff --git a/ports/open3d/0001-use-external-libraries.patch b/ports/open3d/0001-use-external-libraries.patch deleted file mode 100644 index 6714ec0ca0b51d..00000000000000 --- a/ports/open3d/0001-use-external-libraries.patch +++ /dev/null @@ -1,385 +0,0 @@ -diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake -index e0035c9..be6d801 100644 ---- a/3rdparty/find_dependencies.cmake -+++ b/3rdparty/find_dependencies.cmake -@@ -299,15 +299,8 @@ find_package(Threads REQUIRED) - list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "Threads") - - # Assimp --message(STATUS "Building library Assimp from source") --include(${Open3D_3RDPARTY_DIR}/assimp/assimp.cmake) --import_3rdparty_library(3rdparty_assimp -- INCLUDE_DIRS ${ASSIMP_INCLUDE_DIR} -- LIB_DIR ${ASSIMP_LIB_DIR} -- LIBRARIES ${ASSIMP_LIBRARIES} --) --set(ASSIMP_TARGET "3rdparty_assimp") --add_dependencies(3rdparty_assimp ext_assimp) -+find_package(assimp CONFIG REQUIRED) -+set(ASSIMP_TARGET "assimp::assimp") - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${ASSIMP_TARGET}") - - # OpenMP -@@ -346,7 +339,7 @@ endif() - - # Eigen3 - if(USE_SYSTEM_EIGEN3) -- find_package(Eigen3) -+ find_package(Eigen3 CONFIG REQUIRED) - if(TARGET Eigen3::Eigen) - message(STATUS "Using installed third-party library Eigen3 ${EIGEN3_VERSION_STRING}") - # Eigen3 is a publicly visible dependency, so add it to the list of -@@ -365,23 +358,22 @@ endif() - list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS "${EIGEN3_TARGET}") - - # Flann --if(USE_SYSTEM_FLANN) -- pkg_config_3rdparty_library(3rdparty_flann flann) --endif() --if(NOT USE_SYSTEM_FLANN OR NOT 3rdparty_flann_FOUND) -- build_3rdparty_library(3rdparty_flann DIRECTORY flann) -+find_package(flann CONFIG REQUIRED) -+if(TARGET flann::flann_cpp_s) -+ set(FLANN_TARGET "flann::flann_cpp_s") -+else() -+ set(FLANN_TARGET "flann::flann_cpp") - endif() --set(FLANN_TARGET "3rdparty_flann") - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${FLANN_TARGET}") - - # Nanoflann --build_3rdparty_library(3rdparty_nanoflann DIRECTORY nanoflann INCLUDE_DIRS include/ INCLUDE_ALL) --set(NANOFLANN_TARGET "3rdparty_nanoflann") -+find_package(nanoflann CONFIG REQUIRED) -+set(NANOFLANN_TARGET "nanoflann::nanoflann") - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${NANOFLANN_TARGET}") - - # GLEW - if(USE_SYSTEM_GLEW) -- find_package(GLEW) -+ find_package(GLEW CONFIG REQUIRED) - if(TARGET GLEW::GLEW) - message(STATUS "Using installed third-party library GLEW ${GLEW_VERSION}") - list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "GLEW") -@@ -410,7 +402,7 @@ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${GLEW_TARGET}") - - # GLFW - if(USE_SYSTEM_GLFW) -- find_package(glfw3) -+ find_package(glfw3 CONFIG REQUIRED) - if(TARGET glfw) - message(STATUS "Using installed third-party library glfw3") - list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "glfw3") -@@ -476,7 +468,7 @@ endif() - - # JPEG - if(USE_SYSTEM_JPEG) -- find_package(JPEG) -+ find_package(JPEG REQUIRED) - if(TARGET JPEG::JPEG) - message(STATUS "Using installed third-party library JPEG") - if(NOT BUILD_SHARED_LIBS) -@@ -517,7 +509,7 @@ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${JSONCPP_TARGET}") - - # liblzf - if(USE_SYSTEM_LIBLZF) -- find_package(liblzf) -+ find_package(liblzf CONFIG REQUIRED) - if(TARGET liblzf::liblzf) - message(STATUS "Using installed third-party library liblzf") - if(NOT BUILD_SHARED_LIBS) -@@ -554,7 +546,7 @@ if (BUILD_LIBREALSENSE) - set(USE_SYSTEM_LIBREALSENSE OFF) - endif() - if(USE_SYSTEM_LIBREALSENSE) -- find_package(realsense2) -+ find_package(realsense2 CONFIG REQUIRED) - if(TARGET realsense2::realsense2) - message(STATUS "Using installed third-party library librealsense") - if(NOT BUILD_SHARED_LIBS) -@@ -587,7 +579,7 @@ endif() - - # PNG - if(USE_SYSTEM_PNG) -- find_package(PNG) -+ find_package(PNG CONFIG REQUIRED) - if(TARGET PNG::PNG) - message(STATUS "Using installed third-party library libpng") - if(NOT BUILD_SHARED_LIBS) -@@ -642,29 +634,15 @@ set(TINYFILEDIALOGS_TARGET "3rdparty_tinyfiledialogs") - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${TINYFILEDIALOGS_TARGET}") - - # tinygltf --if(USE_SYSTEM_TINYGLTF) -- find_package(TinyGLTF) -- if(TARGET TinyGLTF::TinyGLTF) -- message(STATUS "Using installed third-party library TinyGLTF") -- if(NOT BUILD_SHARED_LIBS) -- list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "TinyGLTF") -- endif() -- set(TINYGLTF_TARGET "TinyGLTF::TinyGLTF") -- else() -- message(STATUS "Unable to find installed third-party library TinyGLTF") -- set(USE_SYSTEM_TINYGLTF OFF) -- endif() --endif() --if(NOT USE_SYSTEM_TINYGLTF) -- build_3rdparty_library(3rdparty_tinygltf DIRECTORY tinygltf INCLUDE_DIRS tinygltf/) -- target_compile_definitions(3rdparty_tinygltf INTERFACE TINYGLTF_IMPLEMENTATION STB_IMAGE_IMPLEMENTATION STB_IMAGE_WRITE_IMPLEMENTATION) -- set(TINYGLTF_TARGET "3rdparty_tinygltf") --endif() -+find_path(TINYGLTF_INCLUDE_DIRS "tiny_gltf.h") -+build_3rdparty_library(3rdparty_tinygltf DIRECTORY tinygltf INCLUDE_DIRS ${TINYGLTF_INCLUDE_DIRS}) -+target_compile_definitions(3rdparty_tinygltf INTERFACE TINYGLTF_IMPLEMENTATION STB_IMAGE_IMPLEMENTATION STB_IMAGE_WRITE_IMPLEMENTATION) -+set(TINYGLTF_TARGET "3rdparty_tinygltf") - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${TINYGLTF_TARGET}") - - # tinyobjloader - if(USE_SYSTEM_TINYOBJLOADER) -- find_package(tinyobjloader) -+ find_package(tinyobjloader CONFIG REQUIRED) - if(TARGET tinyobjloader::tinyobjloader) - message(STATUS "Using installed third-party library tinyobjloader") - if(NOT BUILD_SHARED_LIBS) -@@ -685,12 +663,17 @@ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${TINYOBJLOADER_TARGET}") - - # Qhull - if(USE_SYSTEM_QHULL) -- find_package(Qhull) -+ find_package(Qhull CONFIG REQUIRED) - if(TARGET Qhull::qhullcpp) - message(STATUS "Using installed third-party library Qhull") - if(NOT BUILD_SHARED_LIBS) - list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "Qhull") - endif() -+ if(TARGET Qhull::qhullstatic_r) -+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "Qhull::qhullstatic_r") -+ else() -+ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "Qhull::qhull_r") -+ endif() - set(QHULL_TARGET "Qhull::qhullcpp") - else() - message(STATUS "Unable to find installed third-party library Qhull") -@@ -751,7 +734,7 @@ list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${QHULL_TARGET}") - - # fmt - if(USE_SYSTEM_FMT) -- find_package(fmt) -+ find_package(fmt CONFIG REQUIRED) - if(TARGET fmt::fmt-header-only) - message(STATUS "Using installed third-party library fmt (header only)") - list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "fmt") -@@ -775,7 +758,8 @@ list(APPEND Open3D_3RDPARTY_PUBLIC_TARGETS "${FMT_TARGET}") - - # Pybind11 - if(USE_SYSTEM_PYBIND11) -- find_package(pybind11) -+ find_package(Python3 COMPONENTS Development REQUIRED) -+ find_package(pybind11 CONFIG REQUIRED) - endif() - if (NOT USE_SYSTEM_PYBIND11 OR NOT TARGET pybind11::module) - set(USE_SYSTEM_PYBIND11 OFF) -@@ -837,7 +821,7 @@ endif() - - # Headless rendering - if (ENABLE_HEADLESS_RENDERING) -- find_package(OSMesa REQUIRED) -+ find_package(OSMesa CONFIG REQUIRED) - add_library(3rdparty_osmesa INTERFACE) - target_include_directories(3rdparty_osmesa INTERFACE ${OSMESA_INCLUDE_DIR}) - target_link_libraries(3rdparty_osmesa INTERFACE ${OSMESA_LIBRARY}) -@@ -851,7 +835,7 @@ if (ENABLE_HEADLESS_RENDERING) - set(OPENGL_TARGET "3rdparty_osmesa") - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${OPENGL_TARGET}") - else() -- find_package(OpenGL) -+ find_package(OpenGL REQUIRED) - if(TARGET OpenGL::GL) - if(NOT BUILD_SHARED_LIBS) - list(APPEND Open3D_3RDPARTY_EXTERNAL_MODULES "OpenGL") -@@ -864,7 +848,7 @@ endif() - # imgui - if(BUILD_GUI) - if(USE_SYSTEM_IMGUI) -- find_package(ImGui) -+ find_package(ImGui CONFIG REQUIRED) - if(TARGET ImGui::ImGui) - message(STATUS "Using installed third-party library ImGui") - if(NOT BUILD_SHARED_LIBS) -@@ -1039,26 +1023,20 @@ if(BUILD_RPC_INTERFACE) - endif() - - # TBB --include(${Open3D_3RDPARTY_DIR}/mkl/tbb.cmake) --import_3rdparty_library(3rdparty_tbb -- INCLUDE_DIRS ${STATIC_TBB_INCLUDE_DIR} -- LIB_DIR ${STATIC_TBB_LIB_DIR} -- LIBRARIES ${STATIC_TBB_LIBRARIES} --) --set(TBB_TARGET "3rdparty_tbb") --add_dependencies(3rdparty_tbb ext_tbb) -+find_package(TBB CONFIG REQUIRED) -+set(TBB_TARGET "TBB::tbb") - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${TBB_TARGET}") - - # parallelstl --build_3rdparty_library(3rdparty_parallelstl DIRECTORY parallelstl INCLUDE_DIRS include/ INCLUDE_ALL) --set(PARALLELSTL_TARGET "3rdparty_parallelstl") -+find_package(ParallelSTL CONFIG REQUIRED) -+set(PARALLELSTL_TARGET "pstl::ParallelSTL") - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${PARALLELSTL_TARGET}") - - if(USE_BLAS) - # Try to locate system BLAS/LAPACK -- find_package(BLAS) -- find_package(LAPACK) -- find_package(LAPACKE) -+ find_package(BLAS CONFIG REQUIRED) -+ find_package(LAPACK CONFIG REQUIRED) -+ find_package(LAPACKE CONFIG REQUIRED) - if(BLAS_FOUND AND LAPACK_FOUND AND LAPACKE_FOUND) - message(STATUS "Using system BLAS/LAPACK") - list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS "${BLAS_LIBRARIES}") -diff --git a/3rdparty/mkl/mkl.cmake b/3rdparty/mkl/mkl.cmake -index df08c1b..7f2487d 100644 ---- a/3rdparty/mkl/mkl.cmake -+++ b/3rdparty/mkl/mkl.cmake -@@ -104,7 +104,6 @@ if(WIN32) - mkl_core - mkl_sequential - mkl_tbb_thread -- tbb_static - ) - list(REMOVE_ITEM MKL_LIBRARIES "$<$:mkl_tbb_thread>") - list(REMOVE_ITEM MKL_LIBRARIES "$<$:tbb_static>") -@@ -134,7 +133,7 @@ elseif(APPLE) - ${STATIC_MKL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}mkl_tbb_thread${CMAKE_STATIC_LIBRARY_SUFFIX} - ${STATIC_MKL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}mkl_core${CMAKE_STATIC_LIBRARY_SUFFIX} - ) -- set(STATIC_MKL_LIBRARIES mkl_intel_ilp64 mkl_tbb_thread mkl_core tbb_static) -+ set(STATIC_MKL_LIBRARIES mkl_intel_ilp64 mkl_tbb_thread mkl_core) - else() - ExternalProject_Add( - ext_mkl_include -@@ -196,5 +195,5 @@ else() - BUILD_BYPRODUCTS ${STATIC_MKL_LIB_DIR}/libmkl_merged.a - ) - endif() -- set(STATIC_MKL_LIBRARIES mkl_merged tbb_static) -+ set(STATIC_MKL_LIBRARIES mkl_merged) - endif() -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a80c1e6..2ad73fb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -215,9 +215,11 @@ string(CONCAT OPEN3D_VERSION - ) - set(OPEN3D_VERSION_FULL "${OPEN3D_VERSION}${OPEN3D_VERSION_DEVHASH}") - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in -- ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile @ONLY) -+ ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile @ONLY) -+file(COPY ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/docs) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/getting_started.rst.in -- ${CMAKE_CURRENT_SOURCE_DIR}/docs/getting_started.rst @ONLY) -+ ${CMAKE_CURRENT_BINARY_DIR}/docs/getting_started.rst @ONLY) -+file(COPY ${CMAKE_CURRENT_BINARY_DIR}/docs/getting_started.rst DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/docs) - - project(Open3D VERSION ${OPEN3D_VERSION} LANGUAGES C CXX) - message(STATUS "Open3D ${OPEN3D_VERSION_FULL}") -@@ -550,9 +552,6 @@ function(open3d_set_global_properties target) - if(ENABLE_HEADLESS_RENDERING) - target_compile_definitions(${target} PRIVATE HEADLESS_RENDERING) - endif() -- if(NOT WITH_OPENMP) -- target_compile_options(${target} PRIVATE "$<$:-Wno-unknown-pragmas>") -- endif() - if(BUILD_WEBRTC) - target_compile_definitions(${target} PRIVATE BUILD_WEBRTC) - endif() -@@ -590,9 +589,6 @@ function(open3d_set_global_properties target) - target_compile_options(${target} PRIVATE "-Wno-deprecated-declarations" "$<$:-Wno-unused-result>") - endif() - target_compile_options(${target} PRIVATE "$<$:--expt-extended-lambda>") -- # TBB static version is used -- # See: https://github.com/wjakob/tbb/commit/615d690c165d68088c32b6756c430261b309b79c -- target_compile_definitions(${target} PRIVATE __TBB_LIB_NAME=tbb_static) - if(WITH_FAISS) - target_compile_definitions(${target} PRIVATE WITH_FAISS) - endif() -diff --git a/cpp/open3d/CMakeLists.txt b/cpp/open3d/CMakeLists.txt -index 97589af..b210664 100644 ---- a/cpp/open3d/CMakeLists.txt -+++ b/cpp/open3d/CMakeLists.txt -@@ -12,9 +12,11 @@ endfunction() - - # Configure a header file to pass the version settings to the source code - configure_file("${PROJECT_SOURCE_DIR}/cpp/open3d/Open3D.h.in" -- "${PROJECT_SOURCE_DIR}/cpp/open3d/Open3D.h") -+ "${PROJECT_BINARY_DIR}/cpp/open3d/Open3D.h") -+file(COPY "${PROJECT_BINARY_DIR}/cpp/open3d/Open3D.h" DESTINATION "${PROJECT_SOURCE_DIR}/cpp/open3d") - configure_file("${PROJECT_SOURCE_DIR}/cpp/open3d/Open3DConfig.h.in" -- "${PROJECT_SOURCE_DIR}/cpp/open3d/Open3DConfig.h") -+ "${PROJECT_BINARY_DIR}/cpp/open3d/Open3DConfig.h") -+file(COPY "${PROJECT_BINARY_DIR}/cpp/open3d/Open3DConfig.h" DESTINATION "${PROJECT_SOURCE_DIR}/cpp/open3d") - - # Subdirectories - add_subdirectory(camera) -diff --git a/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp b/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp -index e60697c..8ffb002 100644 ---- a/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp -+++ b/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp -@@ -45,12 +45,12 @@ - // 4245: signed/unsigned mismatch - // 4189: local variable is initialized but not referenced - #endif --#include "PoissonRecon/Src/PreProcessor.h" --#include "PoissonRecon/Src/MyMiscellany.h" --#include "PoissonRecon/Src/CmdLineParser.h" --#include "PoissonRecon/Src/FEMTree.h" --#include "PoissonRecon/Src/PPolynomial.h" --#include "PoissonRecon/Src/PointStreamData.h" -+#include "PoissonRecon/PreProcessor.h" -+#include "PoissonRecon/MyMiscellany.h" -+#include "PoissonRecon/CmdLineParser.h" -+#include "PoissonRecon/FEMTree.h" -+#include "PoissonRecon/PPolynomial.h" -+#include "PoissonRecon/PointStreamData.h" - #ifdef _MSC_VER - #pragma warning(pop) - #endif -diff --git a/cpp/open3d/visualization/CMakeLists.txt b/cpp/open3d/visualization/CMakeLists.txt -index 9c38ff5..77534f5 100644 ---- a/cpp/open3d/visualization/CMakeLists.txt -+++ b/cpp/open3d/visualization/CMakeLists.txt -@@ -1,25 +1,24 @@ - # some black magic to automatically create a header file from shader files - file(GLOB SHADER_FILES "shader/glsl/*.glsl") - -+add_custom_target(ShaderFileTarget ALL) - add_custom_command( -- OUTPUT ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader/Shader.h -- COMMAND EncodeShader Shader.h -+ TARGET ShaderFileTarget PRE_BUILD -+ COMMAND EncodeShader ${PROJECT_BINARY_DIR}/Shader.h - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader/ - DEPENDS ${SHADER_FILES} EncodeShader - ) - - foreach(file ${SHADER_FILES}) - add_custom_command( -- OUTPUT ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader/Shader.h -- COMMAND EncodeShader Shader.h ${file} -+ TARGET ShaderFileTarget PRE_BUILD -+ COMMAND EncodeShader ${PROJECT_BINARY_DIR}/Shader.h ${file} - WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader/ - DEPENDS ${SHADER_FILES} EncodeShader -- APPEND - ) - endforeach(file) - --add_custom_target(ShaderFileTarget ALL -- DEPENDS ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader/Shader.h) -+add_custom_command(TARGET ShaderFileTarget POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/Shader.h ${PROJECT_SOURCE_DIR}/cpp/open3d/visualization/shader) - set_target_properties(ShaderFileTarget PROPERTIES FOLDER "Custom") - - # build diff --git a/ports/open3d/0002-fix-eigen-3-3.patch b/ports/open3d/0002-fix-eigen-3-3.patch deleted file mode 100644 index 8fb448d20afd72..00000000000000 --- a/ports/open3d/0002-fix-eigen-3-3.patch +++ /dev/null @@ -1,59 +0,0 @@ -From a27fbebe3e5df8df1a38061ce95b65bfc48bb415 Mon Sep 17 00:00:00 2001 -From: Han -Date: Sat, 9 Jan 2021 20:55:54 +0800 -Subject: [PATCH] Eigen v3.3.* branch does not contain the `transform` - function. And initilizer list is not well supported in Eigen v3.3.*. - ---- - cpp/open3d/geometry/Line3D.cpp | 18 ++++++++++-------- - 1 file changed, 10 insertions(+), 8 deletions(-) - -diff --git a/cpp/open3d/geometry/Line3D.cpp b/cpp/open3d/geometry/Line3D.cpp -index 28e2e6c610..4af474c839 100644 ---- a/cpp/open3d/geometry/Line3D.cpp -+++ b/cpp/open3d/geometry/Line3D.cpp -@@ -1,5 +1,6 @@ - #include "Line3D.h" - -+#include - #include - - namespace open3d { -@@ -27,7 +28,8 @@ Line3D::Line3D(const Eigen::Vector3d& origin, - } - - void Line3D::Transform(const Eigen::Transform& t) { -- this->transform(t); -+ direction() = (t * direction()).normalized(); -+ origin() = t * origin(); - } - - std::pair Line3D::SlabAABBBase( -@@ -87,12 +89,12 @@ utility::optional Line3D::ExactAABB( - box.max_bound_ + Vector3d(tol, tol, tol)}; - - using plane_t = Eigen::Hyperplane; -- std::array planes{{{{-1, 0, 0}, box.min_bound_}, -- {{1, 0, 0}, box.max_bound_}, -- {{0, -1, 0}, box.min_bound_}, -- {{0, 1, 0}, box.max_bound_}, -- {{0, 0, -1}, box.min_bound_}, -- {{0, 0, 1}, box.max_bound_}}}; -+ std::array planes{plane_t{Vector3d{-1, 0, 0}, box.min_bound_}, -+ plane_t{Vector3d{1, 0, 0}, box.max_bound_}, -+ plane_t{Vector3d{0, -1, 0}, box.min_bound_}, -+ plane_t{Vector3d{0, 1, 0}, box.max_bound_}, -+ plane_t{Vector3d{0, 0, -1}, box.min_bound_}, -+ plane_t{Vector3d{0, 0, 1}, box.max_bound_}}; - - // Get the intersections - std::vector parameters; -@@ -321,7 +323,7 @@ Segment3D::Segment3D(const std::pair& pair) - : Segment3D(std::get<0>(pair), std::get<1>(pair)) {} - - void Segment3D::Transform(const Eigen::Transform& t) { -- this->transform(t); -+ this->Transform(t); - end_point_ = t * end_point_; - } - diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 74120b4d5e0c6f..c7b1810998d6ec 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -3,12 +3,9 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO intel-isl/Open3D - REF v0.13.0 - SHA512 10134eee86e364738c60bddebad3cf2a82dc7fe8e9f38e35c410b1be6055089b8ebe93b689c254d897cda2d0b10b509af4c44018553d595ee90b8e022af43cd0 + REF v0.18.0 + SHA512 2fe67c0c5447177425fd641a92a0b504d234f38f3f3f3957fc3f58a5681282ef59a57e7f212f20485bbf9c3012455b9e1af2a5861c696c329b4241baf477052f HEAD_REF master - PATCHES - 0001-use-external-libraries.patch - 0002-fix-eigen-3-3.patch # taken from https://github.com/intel-isl/Open3D/pull/2885 ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_WINDOWS_RUNTIME) @@ -53,8 +50,6 @@ vcpkg_cmake_configure( -DDEVELOPER_BUILD=OFF ) -# we have to build this first otherwise install fails -#vcpkg_cmake_build(TARGET Open3D) vcpkg_cmake_install() if(VCPKG_TARGET_IS_WINDOWS) diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 78788f9d9b171a..9c75430fa2bbe8 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -1,16 +1,14 @@ { "name": "open3d", - "version-semver": "0.13.0", + "version-semver": "0.18.0", "description": "Open3D is an open-source library that supports rapid development of software that deals with 3D data", "homepage": "www.open3d.org", "dependencies": [ "assimp", "eigen3", - "flann", "fmt", "glew", "glfw3", - "gtest", "imgui", "libjpeg-turbo", "nanoflann", diff --git a/versions/baseline.json b/versions/baseline.json index 2130245bb19060..56cf93e902d02d 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6577,7 +6577,7 @@ "port-version": 0 }, "open3d": { - "baseline": "0.13.0", + "baseline": "0.18.0", "port-version": 0 }, "open62541": { diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index ce9e0132e8ca17..50487e621e4e90 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "4d26ab822ab0fb10500ced6d18b42afaec2cbd03", - "version-semver": "0.13.0", + "git-tree": "a0fadaadcaad7969207738b060023d3a94575101", + "version-semver": "0.18.0", "port-version": 0 } ] From d7f50d8c9b04cd00ef8026e42a2126d01cf8db51 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Mon, 28 Oct 2024 23:45:25 -0700 Subject: [PATCH 03/31] [open3d] add external dependencies and flags --- ports/open3d/0001-uvatlas.patch | 40 ++++++++++++++++++++++++ ports/open3d/portfile.cmake | 54 +++++++++++++++++++++------------ ports/open3d/vcpkg.json | 5 ++- versions/o-/open3d.json | 2 +- 4 files changed, 79 insertions(+), 22 deletions(-) create mode 100644 ports/open3d/0001-uvatlas.patch diff --git a/ports/open3d/0001-uvatlas.patch b/ports/open3d/0001-uvatlas.patch new file mode 100644 index 00000000000000..1937fb07af5937 --- /dev/null +++ b/ports/open3d/0001-uvatlas.patch @@ -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 diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index c7b1810998d6ec..02d510500438a8 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -6,6 +6,8 @@ vcpkg_from_github( REF v0.18.0 SHA512 2fe67c0c5447177425fd641a92a0b504d234f38f3f3f3957fc3f58a5681282ef59a57e7f212f20485bbf9c3012455b9e1af2a5861c696c329b4241baf477052f HEAD_REF master + PATCHES + 0001-uvatlas.patch ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_WINDOWS_RUNTIME) @@ -18,36 +20,48 @@ vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DBUILD_SHARED_LIBS=OFF - -DWITH_OPENMP=OFF - -DWITH_FAISS=OFF + -DSTATIC_WINDOWS_RUNTIME=${STATIC_WINDOWS_RUNTIME} + -DGLIBCXX_USE_CXX11_ABI=ON + -DDEVELOPER_BUILD=OFF -DBUILD_EXAMPLES=OFF -DBUILD_UNIT_TESTS=OFF -DBUILD_BENCHMARKS=OFF -DBUILD_GUI=OFF - -DBUILD_RPC_INTERFACE=OFF + -DBUILD_ISPC_MODULE=OFF + -DBUILD_CUDA_MODULE=OFF + -DBUILD_TENSORFLOW_OPS=OFF + -DBUILD_PYTHON_MODULE=OFF + -DBUILD_LIBREALSENSE=OFF + -DBUILD_AZURE_KINECT=OFF + -DBUILD_FILAMENT_FROM_SOURCE=OFF + -DWITH_OPENMP=OFF + -DUSE_SYSTEM_ASSIMP=ON + -DUSE_SYSTEM_CURL=ON + -DUSE_SYSTEM_CUTLASS=ON -DUSE_SYSTEM_EIGEN3=ON - -DUSE_SYSTEM_FLANN=ON + -DUSE_SYSTEM_EMBREE=ON + -DUSE_SYSTEM_FILAMENT=ON + -DUSE_SYSTEM_FMT=ON -DUSE_SYSTEM_GLEW=ON -DUSE_SYSTEM_GLFW=ON + -DUSE_SYSTEM_GOOGLETEST=ON + -DUSE_SYSTEM_IMGUI=ON -DUSE_SYSTEM_JPEG=ON - -DUSE_SYSTEM_LIBLZF=OFF - -DUSE_SYSTEM_PNG=OFF + -DUSE_SYSTEM_JSONCPP=ON + -DUSE_SYSTEM_LIBLZF=ON + -DUSE_SYSTEM_MSGPACK=ON + -DUSE_SYSTEM_NANOFLANN=ON + -DUSE_SYSTEM_OPENSSL=ON + -DUSE_SYSTEM_PNG=ON + -DUSE_SYSTEM_PYBIND11=ON + -DUSE_SYSTEM_QHULLCPP=ON + -DUSE_SYSTEM_STDGPU=ON + -DUSE_SYSTEM_TBB=ON -DUSE_SYSTEM_TINYGLTF=ON -DUSE_SYSTEM_TINYOBJLOADER=ON - -DUSE_SYSTEM_QHULL=ON - -DUSE_SYSTEM_FMT=ON - -DUSE_SYSTEM_PYBIND11=ON - -DUSE_SYSTEM_GOOGLETEST=ON - -DUSE_SYSTEM_IMGUI=ON - -DBUILD_PYTHON_MODULE=OFF - -DBUILD_LIBREALSENSE=OFF - -DBUILD_AZURE_KINECT=OFF - -DBUILD_FILAMENT_FROM_SOURCE=OFF - -DSTATIC_WINDOWS_RUNTIME=${STATIC_WINDOWS_RUNTIME} - -DBUILD_CUDA_MODULE=OFF - -DBUILD_TENSORFLOW_OPS=OFF - -DGLIBCXX_USE_CXX11_ABI=ON - -DDEVELOPER_BUILD=OFF + -DUSE_SYSTEM_UVATLAS=ON + -DUSE_SYSTEM_VTK=ON + -DUSE_SYSTEM_ZEROMQ=ON ) vcpkg_cmake_install() diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 9c75430fa2bbe8..2e6f3531862ddb 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -5,6 +5,7 @@ "homepage": "www.open3d.org", "dependencies": [ "assimp", + "curl", "eigen3", "fmt", "glew", @@ -20,6 +21,7 @@ "tbb", "tinygltf", "tinyobjloader", + "uvatlas", { "name": "vcpkg-cmake", "host": true @@ -27,6 +29,7 @@ { "name": "vcpkg-cmake-config", "host": true - } + }, + "vtk" ] } diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index 50487e621e4e90..d2723fa92c425f 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "a0fadaadcaad7969207738b060023d3a94575101", + "git-tree": "ccee9291ab76ca635c852e1dad20c30da7c0bf3b", "version-semver": "0.18.0", "port-version": 0 } From e49cecbc3170c17b24bbfe6dc8fc52e2c180f461 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 00:35:06 -0700 Subject: [PATCH 04/31] [open3d] add liblzf dependency --- ports/open3d/0003-liblzf.patch | 17 +++++++++++++++++ ports/open3d/portfile.cmake | 1 + ports/open3d/vcpkg.json | 1 + 3 files changed, 19 insertions(+) create mode 100644 ports/open3d/0003-liblzf.patch diff --git a/ports/open3d/0003-liblzf.patch b/ports/open3d/0003-liblzf.patch new file mode 100644 index 00000000000000..4395981be0fff0 --- /dev/null +++ b/ports/open3d/0003-liblzf.patch @@ -0,0 +1,17 @@ +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) +-- +2.45.2 diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 02d510500438a8..4b7ea3e359a5dd 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( HEAD_REF master PATCHES 0001-uvatlas.patch + 0003-liblzf.patch ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_WINDOWS_RUNTIME) diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 2e6f3531862ddb..421481e216ed9d 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -12,6 +12,7 @@ "glfw3", "imgui", "libjpeg-turbo", + "liblzf", "nanoflann", "opengl", "parallelstl", From d958566f63df14320b75233c5eafd1adc9e8d69e Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 00:50:05 -0700 Subject: [PATCH 05/31] [open3d] add msgpack dependency --- ports/open3d/vcpkg.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 421481e216ed9d..45b88ba12718bf 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -13,6 +13,7 @@ "imgui", "libjpeg-turbo", "liblzf", + "msgpack", "nanoflann", "opengl", "parallelstl", From 0d3c781b5d56f219665936c216843051296ad59d Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 01:08:16 -0700 Subject: [PATCH 06/31] [open3d] fix finding of TinyGLTF --- ports/open3d/0004-tiny_gltf.patch | 23 +++++++++++++++++++++++ ports/open3d/portfile.cmake | 1 + 2 files changed, 24 insertions(+) create mode 100644 ports/open3d/0004-tiny_gltf.patch diff --git a/ports/open3d/0004-tiny_gltf.patch b/ports/open3d/0004-tiny_gltf.patch new file mode 100644 index 00000000000000..1bd19cf4db1ab9 --- /dev/null +++ b/ports/open3d/0004-tiny_gltf.patch @@ -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 diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 4b7ea3e359a5dd..dfb1135d2cd361 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( PATCHES 0001-uvatlas.patch 0003-liblzf.patch + 0004-tiny_gltf.patch ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_WINDOWS_RUNTIME) From c711874395794a9ed413c2853998f2a895037bba Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 01:14:07 -0700 Subject: [PATCH 07/31] [open3d] add jsoncpp dependency --- ports/open3d/0005-jsoncpp.patch | 15 +++++++++++++++ ports/open3d/portfile.cmake | 1 + ports/open3d/vcpkg.json | 1 + 3 files changed, 17 insertions(+) create mode 100644 ports/open3d/0005-jsoncpp.patch diff --git a/ports/open3d/0005-jsoncpp.patch b/ports/open3d/0005-jsoncpp.patch new file mode 100644 index 00000000000000..a3ff38a27f0a98 --- /dev/null +++ b/ports/open3d/0005-jsoncpp.patch @@ -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 diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index dfb1135d2cd361..ab00c845f1647e 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_from_github( 0001-uvatlas.patch 0003-liblzf.patch 0004-tiny_gltf.patch + 0005-jsoncpp.patch ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_WINDOWS_RUNTIME) diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 45b88ba12718bf..ff3ccd2398a356 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -11,6 +11,7 @@ "glew", "glfw3", "imgui", + "jsoncpp", "libjpeg-turbo", "liblzf", "msgpack", From 000701915caf720efc15edd162471b90648199c4 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 01:28:31 -0700 Subject: [PATCH 08/31] [lapack] support the lapacke feature of lapack --- ports/lapack-reference/portfile.cmake | 8 ++++++-- ports/lapack-reference/vcpkg.json | 5 ++++- versions/baseline.json | 2 +- versions/l-/lapack-reference.json | 5 +++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ports/lapack-reference/portfile.cmake b/ports/lapack-reference/portfile.cmake index 093f7f8c21be63..1e53c00485e1a9 100644 --- a/ports/lapack-reference/portfile.cmake +++ b/ports/lapack-reference/portfile.cmake @@ -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.") @@ -56,6 +54,11 @@ if(VCPKG_USE_INTERNAL_Fortran) endif() endif() +vcpkg_check_features(OUT_FEATURE_OPTIONS options + FEATURES + lapacke LAPACKE +) + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS @@ -63,6 +66,7 @@ vcpkg_cmake_configure( "-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 diff --git a/ports/lapack-reference/vcpkg.json b/ports/lapack-reference/vcpkg.json index 684be12305a098..a831afff439e30 100644 --- a/ports/lapack-reference/vcpkg.json +++ b/ports/lapack-reference/vcpkg.json @@ -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", @@ -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", diff --git a/versions/baseline.json b/versions/baseline.json index 56cf93e902d02d..704b9f407ae443 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4170,7 +4170,7 @@ }, "lapack-reference": { "baseline": "3.11.0", - "port-version": 6 + "port-version": 7 }, "lastools": { "baseline": "2.0.3", diff --git a/versions/l-/lapack-reference.json b/versions/l-/lapack-reference.json index eb2ce010904cf8..76532a2734711c 100644 --- a/versions/l-/lapack-reference.json +++ b/versions/l-/lapack-reference.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5c9b707c6765f4ec965e12792cf15d5fc6f0dc2a", + "version": "3.11.0", + "port-version": 7 + }, { "git-tree": "c6447c2a6f70504bfbf20f2e649bcc17a6ce67de", "version": "3.11.0", From fc1c8b919cdc496a4300c882872cfac71a1c93ba Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 01:30:53 -0700 Subject: [PATCH 09/31] [open3d] add intel-oneapi, blas, lapack, lapacke features Update vcpkg.json --- ports/open3d/portfile.cmake | 11 +++++++++++ ports/open3d/vcpkg.json | 30 +++++++++++++++++++++++++++++- versions/o-/open3d.json | 2 +- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index ab00c845f1647e..67aa5252542da8 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -19,6 +19,13 @@ get_filename_component(GIT_PATH ${GIT} DIRECTORY) vcpkg_add_to_path(PREPEND "${GIT_PATH}") +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + "sycl" BUILD_SYCL_MODULE + "intel-oneapi" OPEN3D_USE_ONEAPI_PACKAGES + "blas" USE_BLAS +) + vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS @@ -37,6 +44,10 @@ vcpkg_cmake_configure( -DBUILD_LIBREALSENSE=OFF -DBUILD_AZURE_KINECT=OFF -DBUILD_FILAMENT_FROM_SOURCE=OFF + -DBUILD_SYCL_MODULE=${BUILD_SYCL_MODULE} + -DOPEN3D_USE_ONEAPI_PACKAGES=${OPEN3D_USE_ONEAPI_PACKAGES} + -DUSE_BLAS=${USE_BLAS} + -DUSE_SYSTEM_BLAS=ON -DWITH_OPENMP=OFF -DUSE_SYSTEM_ASSIMP=ON -DUSE_SYSTEM_CURL=ON diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index ff3ccd2398a356..77fbcd851c2982 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -1,8 +1,9 @@ { + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "name": "open3d", "version-semver": "0.18.0", "description": "Open3D is an open-source library that supports rapid development of software that deals with 3D data", - "homepage": "www.open3d.org", + "homepage": "https://www.open3d.org", "dependencies": [ "assimp", "curl", @@ -35,4 +36,31 @@ }, "vtk" ] + "default-features": [ + "blas" + ], + "features": { + "blas": { + "description": "Use BLAS/LAPACK/LAPACKE instead of MKL", + "dependencies": [ + "blas", + "lapack", + { + "name": "lapack-reference", + "features": [ + "lapacke" + ] + } + ] + }, + "intel-oneapi": { + "description": "Use Intel OneAPI MKL", + "dependencies": [ + "intel-mkl" + ] + }, + "sycl": { + "description": "Enable SYCL module" + } + } } diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index d2723fa92c425f..a6b19bbbdf7e0b 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "ccee9291ab76ca635c852e1dad20c30da7c0bf3b", + "git-tree": "b87bb6ee4744da4d9c8f8b93bd523da7bb498904", "version-semver": "0.18.0", "port-version": 0 } From 9ddb8fc501bb87633ed6f8113b100c1a7cdfa981 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 01:31:41 -0700 Subject: [PATCH 10/31] [open3d] add zeromq dependency --- ports/open3d/vcpkg.json | 5 +++-- versions/o-/open3d.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 77fbcd851c2982..5746834605c379 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -34,8 +34,9 @@ "name": "vcpkg-cmake-config", "host": true }, - "vtk" - ] + "vtk", + "zeromq" + ], "default-features": [ "blas" ], diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index a6b19bbbdf7e0b..d8d33f465e044b 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "b87bb6ee4744da4d9c8f8b93bd523da7bb498904", + "git-tree": "2ace2ce9d176ef68ca5c338af5690c218d57835d", "version-semver": "0.18.0", "port-version": 0 } From a901b7805e575a9724296683af5ddb05d2c16ae4 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 01:42:26 -0700 Subject: [PATCH 11/31] [open3d] add the gui feature --- ports/open3d/portfile.cmake | 7 ++++--- ports/open3d/vcpkg.json | 10 ++++++++-- versions/o-/open3d.json | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 67aa5252542da8..bd4d3535db97b2 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -21,9 +21,10 @@ vcpkg_add_to_path(PREPEND "${GIT_PATH}") vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES - "sycl" BUILD_SYCL_MODULE - "intel-oneapi" OPEN3D_USE_ONEAPI_PACKAGES + "gui" BUILD_GUI "blas" USE_BLAS + "intel-oneapi" OPEN3D_USE_ONEAPI_PACKAGES + "sycl" BUILD_SYCL_MODULE ) vcpkg_cmake_configure( @@ -36,7 +37,7 @@ vcpkg_cmake_configure( -DBUILD_EXAMPLES=OFF -DBUILD_UNIT_TESTS=OFF -DBUILD_BENCHMARKS=OFF - -DBUILD_GUI=OFF + -DBUILD_GUI=${BUILD_GUI} -DBUILD_ISPC_MODULE=OFF -DBUILD_CUDA_MODULE=OFF -DBUILD_TENSORFLOW_OPS=OFF diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 5746834605c379..835b726f9e44bb 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -11,7 +11,6 @@ "fmt", "glew", "glfw3", - "imgui", "jsoncpp", "libjpeg-turbo", "liblzf", @@ -38,7 +37,8 @@ "zeromq" ], "default-features": [ - "blas" + "blas", + "gui" ], "features": { "blas": { @@ -54,6 +54,12 @@ } ] }, + "gui": { + "description": "Build the new GUI for Open3D", + "dependencies": [ + "imgui" + ] + }, "intel-oneapi": { "description": "Use Intel OneAPI MKL", "dependencies": [ diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index d8d33f465e044b..a682f68d470de0 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "2ace2ce9d176ef68ca5c338af5690c218d57835d", + "git-tree": "31f788996c2f0dc5dcda144599d586230c2c0722", "version-semver": "0.18.0", "port-version": 0 } From dd470be1b7a77317423dd8973029765d5c5ba745 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 01:51:42 -0700 Subject: [PATCH 12/31] [open3d] add python feature --- ports/open3d/portfile.cmake | 3 ++- ports/open3d/vcpkg.json | 7 ++++++- versions/o-/open3d.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index bd4d3535db97b2..84d991cccf24a2 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -25,6 +25,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "blas" USE_BLAS "intel-oneapi" OPEN3D_USE_ONEAPI_PACKAGES "sycl" BUILD_SYCL_MODULE + "python" BUILD_PYTHON_MODULE ) vcpkg_cmake_configure( @@ -41,7 +42,7 @@ vcpkg_cmake_configure( -DBUILD_ISPC_MODULE=OFF -DBUILD_CUDA_MODULE=OFF -DBUILD_TENSORFLOW_OPS=OFF - -DBUILD_PYTHON_MODULE=OFF + -DBUILD_PYTHON_MODULE=${BUILD_PYTHON_MODULE} -DBUILD_LIBREALSENSE=OFF -DBUILD_AZURE_KINECT=OFF -DBUILD_FILAMENT_FROM_SOURCE=OFF diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 835b726f9e44bb..8e037389af816e 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -19,7 +19,6 @@ "opengl", "parallelstl", "poissonrecon", - "pybind11", "qhull", "tbb", "tinygltf", @@ -66,6 +65,12 @@ "intel-mkl" ] }, + "python": { + "description": "Build the python module", + "dependencies": [ + "pybind11" + ] + }, "sycl": { "description": "Enable SYCL module" } diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index a682f68d470de0..4c091950ff7a85 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "31f788996c2f0dc5dcda144599d586230c2c0722", + "git-tree": "443b57a6ca1fd2a63b3eeac43ba2e3ed6991c5f9", "version-semver": "0.18.0", "port-version": 0 } From dbb81f61e8ca3da4443435496afd8f8f2f79b8ed Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 01:57:28 -0700 Subject: [PATCH 13/31] [open3d] add OpenMP feature --- ports/open3d/portfile.cmake | 3 ++- ports/open3d/vcpkg.json | 6 +++++- versions/o-/open3d.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 84d991cccf24a2..d94822f3fd44ff 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -25,6 +25,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "blas" USE_BLAS "intel-oneapi" OPEN3D_USE_ONEAPI_PACKAGES "sycl" BUILD_SYCL_MODULE + "openmp" WITH_OPENMP "python" BUILD_PYTHON_MODULE ) @@ -50,7 +51,7 @@ vcpkg_cmake_configure( -DOPEN3D_USE_ONEAPI_PACKAGES=${OPEN3D_USE_ONEAPI_PACKAGES} -DUSE_BLAS=${USE_BLAS} -DUSE_SYSTEM_BLAS=ON - -DWITH_OPENMP=OFF + -DWITH_OPENMP=${WITH_OPENMP} -DUSE_SYSTEM_ASSIMP=ON -DUSE_SYSTEM_CURL=ON -DUSE_SYSTEM_CUTLASS=ON diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 8e037389af816e..3e4bc6838ce6c0 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -37,7 +37,8 @@ ], "default-features": [ "blas", - "gui" + "gui", + "openmp" ], "features": { "blas": { @@ -65,6 +66,9 @@ "intel-mkl" ] }, + "openmp": { + "description": "Use OpenMP multi-threading" + }, "python": { "description": "Build the python module", "dependencies": [ diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index 4c091950ff7a85..735cece6db5a2e 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "443b57a6ca1fd2a63b3eeac43ba2e3ed6991c5f9", + "git-tree": "fbdd86787a1d4ce0c989e954c76022acaede5f90", "version-semver": "0.18.0", "port-version": 0 } From 8c39d40151f1365c6dd13df5294069deced22082 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 02:05:23 -0700 Subject: [PATCH 14/31] [open3d] remove excess flags set by default --- ports/open3d/portfile.cmake | 2 -- versions/o-/open3d.json | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index d94822f3fd44ff..0179e23a823be0 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -34,7 +34,6 @@ vcpkg_cmake_configure( OPTIONS -DBUILD_SHARED_LIBS=OFF -DSTATIC_WINDOWS_RUNTIME=${STATIC_WINDOWS_RUNTIME} - -DGLIBCXX_USE_CXX11_ABI=ON -DDEVELOPER_BUILD=OFF -DBUILD_EXAMPLES=OFF -DBUILD_UNIT_TESTS=OFF @@ -46,7 +45,6 @@ vcpkg_cmake_configure( -DBUILD_PYTHON_MODULE=${BUILD_PYTHON_MODULE} -DBUILD_LIBREALSENSE=OFF -DBUILD_AZURE_KINECT=OFF - -DBUILD_FILAMENT_FROM_SOURCE=OFF -DBUILD_SYCL_MODULE=${BUILD_SYCL_MODULE} -DOPEN3D_USE_ONEAPI_PACKAGES=${OPEN3D_USE_ONEAPI_PACKAGES} -DUSE_BLAS=${USE_BLAS} diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index 735cece6db5a2e..56fc92e2daeebc 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "fbdd86787a1d4ce0c989e954c76022acaede5f90", + "git-tree": "76807e6be634e1ed471ec73e625dc9aa5a1ff170", "version-semver": "0.18.0", "port-version": 0 } From 7cb795799f4ccbb5aa1c5bf8f8afa497f57b0e03 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 02:10:01 -0700 Subject: [PATCH 15/31] [open3d] add azure kinect and realsense support --- ports/open3d/portfile.cmake | 6 ++++-- ports/open3d/vcpkg.json | 12 ++++++++++++ versions/o-/open3d.json | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 0179e23a823be0..634493d88f6a38 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -27,6 +27,8 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "sycl" BUILD_SYCL_MODULE "openmp" WITH_OPENMP "python" BUILD_PYTHON_MODULE + "azure-kinect" BUILD_AZURE_KINECT + "realsense2" BUILD_LIBREALSENSE ) vcpkg_cmake_configure( @@ -43,8 +45,8 @@ vcpkg_cmake_configure( -DBUILD_CUDA_MODULE=OFF -DBUILD_TENSORFLOW_OPS=OFF -DBUILD_PYTHON_MODULE=${BUILD_PYTHON_MODULE} - -DBUILD_LIBREALSENSE=OFF - -DBUILD_AZURE_KINECT=OFF + -DBUILD_LIBREALSENSE=${BUILD_LIBREALSENSE} + -DBUILD_AZURE_KINECT=${BUILD_AZURE_KINECT} -DBUILD_SYCL_MODULE=${BUILD_SYCL_MODULE} -DOPEN3D_USE_ONEAPI_PACKAGES=${OPEN3D_USE_ONEAPI_PACKAGES} -DUSE_BLAS=${USE_BLAS} diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 3e4bc6838ce6c0..9144020771f3cb 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -41,6 +41,12 @@ "openmp" ], "features": { + "azure-kinect": { + "description": "Build support for Azure Kinect sensor", + "dependencies": [ + "azure-kinect-sensor-sdk" + ] + }, "blas": { "description": "Use BLAS/LAPACK/LAPACKE instead of MKL", "dependencies": [ @@ -75,6 +81,12 @@ "pybind11" ] }, + "realsense": { + "description": "Build support for Intel RealSense camera", + "dependencies": [ + "realsense2" + ] + }, "sycl": { "description": "Enable SYCL module" } diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index 56fc92e2daeebc..51de01f8275e69 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "76807e6be634e1ed471ec73e625dc9aa5a1ff170", + "git-tree": "69821246fb10b093959686152307ecc704cad0b5", "version-semver": "0.18.0", "port-version": 0 } From 47381388cdf45b4bb2a25662ee08c71561e2b0e9 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 05:26:35 -0700 Subject: [PATCH 16/31] [open3d] add missing Open3D build --- ports/open3d/portfile.cmake | 1 + versions/o-/open3d.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 634493d88f6a38..8a2219edc72433 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -81,6 +81,7 @@ vcpkg_cmake_configure( -DUSE_SYSTEM_ZEROMQ=ON ) +vcpkg_cmake_build(TARGET Open3D) vcpkg_cmake_install() if(VCPKG_TARGET_IS_WINDOWS) diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index 51de01f8275e69..8d7e1e93551d99 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "69821246fb10b093959686152307ecc704cad0b5", + "git-tree": "d9454d03d3c0f08fbd18f29cc4715b031f824bd9", "version-semver": "0.18.0", "port-version": 0 } From 240ed42c6e8ce1a014912ea0b42b590c955ce284 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 05:58:32 -0700 Subject: [PATCH 17/31] [open3d] fix finding of blas/lapack libraries --- ports/open3d/0002-blas.patch | 41 ++++++++++++++++++++++++++++++++++++ ports/open3d/portfile.cmake | 1 + ports/open3d/vcpkg.json | 3 +-- versions/o-/open3d.json | 2 +- 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 ports/open3d/0002-blas.patch diff --git a/ports/open3d/0002-blas.patch b/ports/open3d/0002-blas.patch new file mode 100644 index 00000000000000..f95ebf1a2288f2 --- /dev/null +++ b/ports/open3d/0002-blas.patch @@ -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 diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 8a2219edc72433..6cedc08b70c543 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( HEAD_REF master PATCHES 0001-uvatlas.patch + 0002-blas.patch 0003-liblzf.patch 0004-tiny_gltf.patch 0005-jsoncpp.patch diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 9144020771f3cb..ca8ff65744a66c 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -48,10 +48,9 @@ ] }, "blas": { - "description": "Use BLAS/LAPACK/LAPACKE instead of MKL", + "description": "Use BLAS, LAPACK, and LAPACKE", "dependencies": [ "blas", - "lapack", { "name": "lapack-reference", "features": [ diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index 8d7e1e93551d99..477b1dff468a34 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "d9454d03d3c0f08fbd18f29cc4715b031f824bd9", + "git-tree": "91ea7e67e84d7a715f9945b103b5f8f47ee04563", "version-semver": "0.18.0", "port-version": 0 } From bd2f65d244c0815eb74c18caccfd1a7a315d96e6 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 07:24:27 -0700 Subject: [PATCH 18/31] [open3d] add fmt formatting patch --- ports/open3d/0006-fmt.patch | 63 +++++++++++++++++++++++++++++++++++++ ports/open3d/portfile.cmake | 1 + versions/o-/open3d.json | 2 +- 3 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 ports/open3d/0006-fmt.patch diff --git a/ports/open3d/0006-fmt.patch b/ports/open3d/0006-fmt.patch new file mode 100644 index 00000000000000..f11dc9f5f4a9d3 --- /dev/null +++ b/ports/open3d/0006-fmt.patch @@ -0,0 +1,63 @@ +diff --git a/cpp/open3d/core/DLPack.h b/cpp/open3d/core/DLPack.h +index 9a0c3e57a..e629b138f 100644 +--- a/cpp/open3d/core/DLPack.h ++++ b/cpp/open3d/core/DLPack.h +@@ -188,4 +188,56 @@ typedef struct DLManagedTensor { + #ifdef __cplusplus + } // DLPACK_EXTERN_C + #endif ++ ++#include ++#include ++ ++namespace fmt { ++ ++template <> ++struct formatter { ++ template ++ auto format(const DLDeviceType& c, ++ FormatContext& ctx) const -> decltype(ctx.out()) { ++ const char* text = nullptr; ++ switch (c) { ++ case kDLCPU: ++ text = "kDLCPU"; ++ break; ++ case kDLGPU: ++ text = "kDLGPU"; ++ break; ++ case kDLCPUPinned: ++ text = "kDLCPUPinned"; ++ break; ++ case kDLOpenCL: ++ text = "kDLOpenCL"; ++ break; ++ case kDLVulkan: ++ text = "kDLVulkan"; ++ break; ++ case kDLMetal: ++ text = "kDLMetal"; ++ break; ++ case kDLVPI: ++ text = "kDLVPI"; ++ break; ++ case kDLROCM: ++ text = "kDLROCM"; ++ break; ++ case kDLExtDev: ++ text = "kDLExtDev"; ++ break; ++ } ++ return format_to(ctx.out(), text); ++ } ++ ++ template ++ constexpr auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { ++ return ctx.begin(); ++ } ++}; ++ ++} // namespace fmt ++ + #endif // DLPACK_DLPACK_H_ +-- +2.45.2 diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 6cedc08b70c543..9df41a13dba217 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( 0003-liblzf.patch 0004-tiny_gltf.patch 0005-jsoncpp.patch + 0006-fmt.patch # remove in the next release https://github.com/isl-org/Open3D/pull/6783 ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_WINDOWS_RUNTIME) diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index 477b1dff468a34..e0ead7d84990bf 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "91ea7e67e84d7a715f9945b103b5f8f47ee04563", + "git-tree": "5b39c8604918389390bb16f205f04d966bba1985", "version-semver": "0.18.0", "port-version": 0 } From fea6bc41860364d7a550ff01971777e416a9e2a6 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 08:10:05 -0700 Subject: [PATCH 19/31] [open3d] add embree3 dependency --- ports/open3d/vcpkg.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index ca8ff65744a66c..7a37147c1a94e7 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -8,6 +8,7 @@ "assimp", "curl", "eigen3", + "embree3", "fmt", "glew", "glfw3", From 6baa0f77af4af623e16db08eafa1f63acae1a1bd Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 08:32:37 -0700 Subject: [PATCH 20/31] [open3d] use the system parallel stl --- ports/open3d/0007-parallelstl.patch | 50 +++++++++++++++++++++++++++++ ports/open3d/portfile.cmake | 2 ++ ports/open3d/vcpkg.json | 4 +-- versions/o-/open3d.json | 2 +- 4 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 ports/open3d/0007-parallelstl.patch diff --git a/ports/open3d/0007-parallelstl.patch b/ports/open3d/0007-parallelstl.patch new file mode 100644 index 00000000000000..34e2ece5401d42 --- /dev/null +++ b/ports/open3d/0007-parallelstl.patch @@ -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 diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 9df41a13dba217..9edf0b79b402da 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -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) @@ -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) diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 7a37147c1a94e7..b1b0b887ffd4d1 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -18,7 +18,6 @@ "msgpack", "nanoflann", "opengl", - "parallelstl", "poissonrecon", "qhull", "tbb", @@ -57,7 +56,8 @@ "features": [ "lapacke" ] - } + }, + "parallelstl" ] }, "gui": { diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index e0ead7d84990bf..f02ad757301dec 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "5b39c8604918389390bb16f205f04d966bba1985", + "git-tree": "4ee800ac365571c707f3a865868ed6fa83ce631f", "version-semver": "0.18.0", "port-version": 0 } From 976240b9a5d1811aca3b9b06bc1df1941491803d Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 08:51:36 -0700 Subject: [PATCH 21/31] [open3d] fix liblzf includes --- ports/open3d/0003-liblzf.patch | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/ports/open3d/0003-liblzf.patch b/ports/open3d/0003-liblzf.patch index 4395981be0fff0..830e6c08d01276 100644 --- a/ports/open3d/0003-liblzf.patch +++ b/ports/open3d/0003-liblzf.patch @@ -13,5 +13,37 @@ index 13a538461..859edbab5 100644 ) 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() ++#include ++#else + #include ++#endif + + #include + #include +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() ++#include ++#else + #include ++#endif + + #include + #include -- 2.45.2 From fca3d35ea453fa653b588394126cca4617a70176 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 08:54:26 -0700 Subject: [PATCH 22/31] [open3d] use cppzmq instead of zeromq --- ports/open3d/vcpkg.json | 4 ++-- versions/o-/open3d.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index b1b0b887ffd4d1..52e194b0e241f4 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -6,6 +6,7 @@ "homepage": "https://www.open3d.org", "dependencies": [ "assimp", + "cppzmq", "curl", "eigen3", "embree3", @@ -32,8 +33,7 @@ "name": "vcpkg-cmake-config", "host": true }, - "vtk", - "zeromq" + "vtk" ], "default-features": [ "blas", diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index f02ad757301dec..cf24872a36b790 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "4ee800ac365571c707f3a865868ed6fa83ce631f", + "git-tree": "3e9de6ee1aed3af663dbde7a6264d4c738f052a1", "version-semver": "0.18.0", "port-version": 0 } From 9ddc03b2016b422427d01142b895fd536cbc0bd1 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 09:24:35 -0700 Subject: [PATCH 23/31] [open3d] fix all the fmt build errors --- ports/open3d/0006-fmt.patch | 63 --- ports/open3d/6783.patch | 837 ++++++++++++++++++++++++++++++++++++ ports/open3d/6969.patch | 65 +++ ports/open3d/portfile.cmake | 4 +- versions/o-/open3d.json | 2 +- 5 files changed, 906 insertions(+), 65 deletions(-) delete mode 100644 ports/open3d/0006-fmt.patch create mode 100644 ports/open3d/6783.patch create mode 100644 ports/open3d/6969.patch diff --git a/ports/open3d/0006-fmt.patch b/ports/open3d/0006-fmt.patch deleted file mode 100644 index f11dc9f5f4a9d3..00000000000000 --- a/ports/open3d/0006-fmt.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/cpp/open3d/core/DLPack.h b/cpp/open3d/core/DLPack.h -index 9a0c3e57a..e629b138f 100644 ---- a/cpp/open3d/core/DLPack.h -+++ b/cpp/open3d/core/DLPack.h -@@ -188,4 +188,56 @@ typedef struct DLManagedTensor { - #ifdef __cplusplus - } // DLPACK_EXTERN_C - #endif -+ -+#include -+#include -+ -+namespace fmt { -+ -+template <> -+struct formatter { -+ template -+ auto format(const DLDeviceType& c, -+ FormatContext& ctx) const -> decltype(ctx.out()) { -+ const char* text = nullptr; -+ switch (c) { -+ case kDLCPU: -+ text = "kDLCPU"; -+ break; -+ case kDLGPU: -+ text = "kDLGPU"; -+ break; -+ case kDLCPUPinned: -+ text = "kDLCPUPinned"; -+ break; -+ case kDLOpenCL: -+ text = "kDLOpenCL"; -+ break; -+ case kDLVulkan: -+ text = "kDLVulkan"; -+ break; -+ case kDLMetal: -+ text = "kDLMetal"; -+ break; -+ case kDLVPI: -+ text = "kDLVPI"; -+ break; -+ case kDLROCM: -+ text = "kDLROCM"; -+ break; -+ case kDLExtDev: -+ text = "kDLExtDev"; -+ break; -+ } -+ return format_to(ctx.out(), text); -+ } -+ -+ template -+ constexpr auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { -+ return ctx.begin(); -+ } -+}; -+ -+} // namespace fmt -+ - #endif // DLPACK_DLPACK_H_ --- -2.45.2 diff --git a/ports/open3d/6783.patch b/ports/open3d/6783.patch new file mode 100644 index 00000000000000..0a9130e5c7432f --- /dev/null +++ b/ports/open3d/6783.patch @@ -0,0 +1,837 @@ +Remove in the next release +Modified from https://github.com/isl-org/Open3D/pull/6783 + +From 34c138a68c9aca703cac83a743ea25e31d2dbbdf Mon Sep 17 00:00:00 2001 +From: Zhirui Dai +Date: Thu, 2 May 2024 16:59:10 -0700 +Subject: [PATCH 01/11] add support to fmt-v10 + +--- + cpp/open3d/core/DLPack.h | 45 +++++++++++++++++++ + cpp/open3d/t/geometry/RaycastingScene.cpp | 36 ++++++++++++++- + .../webrtc_server/PeerConnectionManager.h | 38 ++++++++++++++++ + 3 files changed, 118 insertions(+), 1 deletion(-) + +diff --git a/cpp/open3d/core/DLPack.h b/cpp/open3d/core/DLPack.h +index 9a0c3e57affc7a4ab8165ae4e95013f224bd90e0..bf935b1aba5bf5151ff7138b3f23b0d3c2f52032 100644 +--- a/cpp/open3d/core/DLPack.h ++++ b/cpp/open3d/core/DLPack.h +@@ -188,4 +188,49 @@ typedef struct DLManagedTensor { + #ifdef __cplusplus + } // DLPACK_EXTERN_C + #endif ++ ++#include ++#include ++ ++namespace fmt { ++ ++template <> ++struct formatter : formatter { ++ auto format(const DLDeviceType& c, format_context& ctx) const { ++ string_view text; ++ switch (c) { ++ case kDLCPU: ++ text = "kDLCPU"; ++ break; ++ case kDLGPU: ++ text = "kDLGPU"; ++ break; ++ case kDLCPUPinned: ++ text = "kDLCPUPinned"; ++ break; ++ case kDLOpenCL: ++ text = "kDLOpenCL"; ++ break; ++ case kDLVulkan: ++ text = "kDLVulkan"; ++ break; ++ case kDLMetal: ++ text = "kDLMetal"; ++ break; ++ case kDLVPI: ++ text = "kDLVPI"; ++ break; ++ case kDLROCM: ++ text = "kDLROCM"; ++ break; ++ case kDLExtDev: ++ text = "kDLExtDev"; ++ break; ++ } ++ return formatter::format(text, ctx); ++ } ++}; ++ ++} // namespace fmt ++ + #endif // DLPACK_DLPACK_H_ +diff --git a/cpp/open3d/t/geometry/RaycastingScene.cpp b/cpp/open3d/t/geometry/RaycastingScene.cpp +index af7dd3f1480c381835a0e9e51610ced4a53afb78..7a0cf5b59a3a0393fc242e2abc2d4c2b7631b49b 100644 +--- a/cpp/open3d/t/geometry/RaycastingScene.cpp ++++ b/cpp/open3d/t/geometry/RaycastingScene.cpp +@@ -1165,4 +1165,38 @@ uint32_t RaycastingScene::INVALID_ID() { return RTC_INVALID_GEOMETRY_ID; } + + } // namespace geometry + } // namespace t +-} // namespace open3d +\ No newline at end of file ++} // namespace open3d ++ ++namespace fmt { ++template <> ++struct formatter : formatter { ++ template ++ auto format(const RTCError& c, FormatContext& ctx) const { ++ string_view name; ++ switch (c) { ++ case RTC_ERROR_NONE: ++ name = "RTC_ERROR_NONE"; ++ break; ++ case RTC_ERROR_UNKNOWN: ++ name = "RTC_ERROR_UNKNOWN"; ++ break; ++ case RTC_ERROR_INVALID_ARGUMENT: ++ name = "RTC_ERROR_INVALID_ARGUMENT"; ++ break; ++ case RTC_ERROR_INVALID_OPERATION: ++ name = "RTC_ERROR_INVALID_OPERATION"; ++ break; ++ case RTC_ERROR_OUT_OF_MEMORY: ++ name = "RTC_ERROR_OUT_OF_MEMORY"; ++ break; ++ case RTC_ERROR_UNSUPPORTED_CPU: ++ name = "RTC_ERROR_UNSUPPORTED_CPU"; ++ break; ++ case RTC_ERROR_CANCELLED: ++ name = "RTC_ERROR_CANCELLED"; ++ break; ++ } ++ return formatter::format(name, ctx); ++ } ++}; ++} // namespace fmt +diff --git a/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h b/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h +index ceb0fc9df74ab74722a956c208fecc0551147c0f..b28e77e37ac2357ede2c234c71a54844a7e7be93 100644 +--- a/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h ++++ b/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h +@@ -456,3 +456,41 @@ class PeerConnectionManager { + } // namespace webrtc_server + } // namespace visualization + } // namespace open3d ++ ++namespace fmt { ++ ++template <> ++struct formatter ++ : formatter { ++ auto format(const webrtc::PeerConnectionInterface::SignalingState& state, ++ format_context& ctx) const { ++ using namespace webrtc; ++ const char* text = nullptr; ++ switch (state) { ++ case PeerConnectionInterface::SignalingState::kStable: ++ text = "kStable"; ++ break; ++ case PeerConnectionInterface::SignalingState::kHaveLocalOffer: ++ text = "kHaveLocalOffer"; ++ break; ++ case PeerConnectionInterface::SignalingState::kHaveLocalPrAnswer: ++ text = "kHaveLocalPrAnswer"; ++ break; ++ case PeerConnectionInterface::SignalingState::kHaveRemoteOffer: ++ text = "kHaveRemoteOffer"; ++ break; ++ case webrtc::PeerConnectionInterface::SignalingState:: ++ kHaveRemotePrAnswer: ++ text = "kHaveRemotePrAnswer"; ++ break; ++ case webrtc::PeerConnectionInterface::SignalingState::kClosed: ++ text = "kClosed"; ++ break; ++ default: ++ text = "unknown"; ++ } ++ return formatter::format(text, ctx); ++ } ++}; ++ ++} // namespace fmt +diff --git a/examples/cpp/OnlineSLAMUtil.h b/examples/cpp/OnlineSLAMUtil.h +index 585f18a8fbea89c3842e4015c43ffa5b3b3f2b30..d1ea43e44c04c3186f18f1ee71a4d5b6baa5a23f 100644 +--- a/examples/cpp/OnlineSLAMUtil.h ++++ b/examples/cpp/OnlineSLAMUtil.h +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include "open3d/Open3D.h" + + +From c2d80f06aa6f24cb9e1edcb4d9db202ce297ca03 Mon Sep 17 00:00:00 2001 +From: Zhirui Dai +Date: Thu, 2 May 2024 18:38:23 -0700 +Subject: [PATCH 04/11] fix style check error + +--- + examples/cpp/OnlineSLAMUtil.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/examples/cpp/OnlineSLAMUtil.h b/examples/cpp/OnlineSLAMUtil.h +index d1ea43e44c04c3186f18f1ee71a4d5b6baa5a23f..ecb2d0b52ae9def57ee6a8c890d4cdcf7b2356ef 100644 +--- a/examples/cpp/OnlineSLAMUtil.h ++++ b/examples/cpp/OnlineSLAMUtil.h +@@ -5,10 +5,11 @@ + // SPDX-License-Identifier: MIT + // ---------------------------------------------------------------------------- + ++#include ++ + #include + #include + #include +-#include + + #include "open3d/Open3D.h" + + +From 5854e548dc7bc007dcd5e6c35bfddef7c93980cb Mon Sep 17 00:00:00 2001 +From: Zhirui Dai +Date: Sun, 5 May 2024 16:05:34 -0700 +Subject: [PATCH 05/11] fix build with Intel-LLVM toolchains + +--- + cpp/open3d/core/DLPack.h | 15 +++++++++++---- + cpp/open3d/t/geometry/RaycastingScene.cpp | 12 +++++++++--- + .../webrtc_server/PeerConnectionManager.h | 18 +++++++++++------- + 3 files changed, 31 insertions(+), 14 deletions(-) + +diff --git a/cpp/open3d/core/DLPack.h b/cpp/open3d/core/DLPack.h +index bf935b1aba5bf5151ff7138b3f23b0d3c2f52032..1cec10a712f35e8feef83e14f5f620c4255932dd 100644 +--- a/cpp/open3d/core/DLPack.h ++++ b/cpp/open3d/core/DLPack.h +@@ -195,9 +195,11 @@ typedef struct DLManagedTensor { + namespace fmt { + + template <> +-struct formatter : formatter { +- auto format(const DLDeviceType& c, format_context& ctx) const { +- string_view text; ++struct formatter { ++ template ++ auto format(const DLDeviceType& c, FormatContext& ctx) const ++ -> decltype(ctx.out()) { ++ const char* text = nullptr; + switch (c) { + case kDLCPU: + text = "kDLCPU"; +@@ -227,7 +229,12 @@ struct formatter : formatter { + text = "kDLExtDev"; + break; + } +- return formatter::format(text, ctx); ++ return format_to(ctx.out(), text); ++ } ++ ++ template ++ constexpr auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { ++ return ctx.begin(); + } + }; + +diff --git a/cpp/open3d/t/geometry/RaycastingScene.cpp b/cpp/open3d/t/geometry/RaycastingScene.cpp +index 0251c7922913e4fe6b3faa7b60bfde62324c43c6..8906f6373e504a4bdc23c79cf75c8fdfe5f99fed 100644 +--- a/cpp/open3d/t/geometry/RaycastingScene.cpp ++++ b/cpp/open3d/t/geometry/RaycastingScene.cpp +@@ -1177,10 +1177,10 @@ uint32_t RaycastingScene::INVALID_ID() { return RTC_INVALID_GEOMETRY_ID; } + + namespace fmt { + template <> +-struct formatter : formatter { ++struct formatter { + template + auto format(const RTCError& c, FormatContext& ctx) const { +- string_view name; ++ const char* name = nullptr; + switch (c) { + case RTC_ERROR_NONE: + name = "RTC_ERROR_NONE"; +@@ -1204,7 +1204,13 @@ struct formatter : formatter { + name = "RTC_ERROR_CANCELLED"; + break; + } +- return formatter::format(name, ctx); ++ // return formatter::format(name, ctx); ++ return format_to(ctx.out(), name); ++ } ++ ++ template ++ constexpr auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { ++ return ctx.begin(); + } + }; + } // namespace fmt +diff --git a/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h b/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h +index b28e77e37ac2357ede2c234c71a54844a7e7be93..8ef27e79a5446c439db54232a46bc4b0c8ae33a4 100644 +--- a/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h ++++ b/cpp/open3d/visualization/webrtc_server/PeerConnectionManager.h +@@ -460,10 +460,10 @@ class PeerConnectionManager { + namespace fmt { + + template <> +-struct formatter +- : formatter { ++struct formatter { ++ template + auto format(const webrtc::PeerConnectionInterface::SignalingState& state, +- format_context& ctx) const { ++ FormatContext& ctx) const -> decltype(ctx.out()) { + using namespace webrtc; + const char* text = nullptr; + switch (state) { +@@ -479,17 +479,21 @@ struct formatter + case PeerConnectionInterface::SignalingState::kHaveRemoteOffer: + text = "kHaveRemoteOffer"; + break; +- case webrtc::PeerConnectionInterface::SignalingState:: +- kHaveRemotePrAnswer: ++ case PeerConnectionInterface::SignalingState::kHaveRemotePrAnswer: + text = "kHaveRemotePrAnswer"; + break; +- case webrtc::PeerConnectionInterface::SignalingState::kClosed: ++ case PeerConnectionInterface::SignalingState::kClosed: + text = "kClosed"; + break; + default: + text = "unknown"; + } +- return formatter::format(text, ctx); ++ return format_to(ctx.out(), "{}", text); ++ } ++ ++ template ++ constexpr auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { ++ return ctx.begin(); + } + }; + + +From 87e48972064127b1eb73e53a3affb1485c6a0d36 Mon Sep 17 00:00:00 2001 +From: Zhirui Dai +Date: Sun, 5 May 2024 18:09:23 -0700 +Subject: [PATCH 06/11] change dependencies of fmt from 9.0.0 to 10.2.0 except + Windows + +--- + 3rdparty/fmt/fmt.cmake | 6 +++--- + cpp/open3d/io/IJsonConvertibleIO.h | 2 +- + cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp | 1 + + 3 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/3rdparty/fmt/fmt.cmake b/3rdparty/fmt/fmt.cmake +index 88cd8e2fcefb21eaad1b4cae4df307d3cb08cef2..24dae557c5f1b2a4eaacab164cf8bea3ce77a2d7 100644 +--- a/3rdparty/fmt/fmt.cmake ++++ b/3rdparty/fmt/fmt.cmake +@@ -2,16 +2,16 @@ include(ExternalProject) + + set(FMT_LIB_NAME fmt) + +-if (MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") ++if (MSVC) + # MSVC has errors when building fmt >6, up till 9.1 + # SYCL / DPC++ needs fmt ver <=6 or >= 9.2: https://github.com/fmtlib/fmt/issues/3005 + set(FMT_VER "6.0.0") + set(FMT_SHA256 + "f1907a58d5e86e6c382e51441d92ad9e23aea63827ba47fd647eacc0d3a16c78") + else() +- set(FMT_VER "9.0.0") ++ set(FMT_VER "10.2.1") + set(FMT_SHA256 +- "9a1e0e9e843a356d65c7604e2c8bf9402b50fe294c355de0095ebd42fb9bd2c5") ++ "1250e4cc58bf06ee631567523f48848dc4596133e163f02615c97f78bab6c811") + endif() + + ExternalProject_Add( +diff --git a/cpp/open3d/io/IJsonConvertibleIO.h b/cpp/open3d/io/IJsonConvertibleIO.h +index 8bc9f03b13b73bb06ec8292655f8d36f8cb93429..a366b4f5ef86c000d229cde6185a52b39adc0b11 100644 +--- a/cpp/open3d/io/IJsonConvertibleIO.h ++++ b/cpp/open3d/io/IJsonConvertibleIO.h +@@ -82,7 +82,7 @@ bool WriteIJsonConvertibleToJSONString(std::string &json_string, + [&str](const std::pair &es_pair) \ + -> bool { return es_pair.second == str; }); \ + e = ((it != std::end(m)) ? it : std::begin(m))->first; \ +- utility::LogDebug("{} -> {}", str, e); \ ++ utility::LogDebug("{} -> {}", str, enum_to_string(e)); \ + } + + } // namespace io +diff --git a/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp b/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp +index 356fdbed6bcf7749e7c754ad8e040661439d3095..990b948ee33e71a1fb53fc43d39e56c4cf10eaf5 100644 +--- a/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp ++++ b/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp +@@ -7,6 +7,7 @@ + + #include "open3d/t/io/sensor/realsense/RSBagReader.h" + ++#include + #include + + #include + +From 5a4be2ffcad88f87a62944574eebd27248db7412 Mon Sep 17 00:00:00 2001 +From: Zhirui Dai +Date: Sun, 5 May 2024 23:13:39 -0700 +Subject: [PATCH 07/11] change fmt from 6.0.0 to 10.2.0 for windows + +--- + 3rdparty/fmt/fmt.cmake | 15 +++------------ + 1 file changed, 3 insertions(+), 12 deletions(-) + +diff --git a/3rdparty/fmt/fmt.cmake b/3rdparty/fmt/fmt.cmake +index 24dae557c5f1b2a4eaacab164cf8bea3ce77a2d7..0ccbec293ff31f4aab20f9fe090e68574ab0c9d1 100644 +--- a/3rdparty/fmt/fmt.cmake ++++ b/3rdparty/fmt/fmt.cmake +@@ -1,18 +1,9 @@ + include(ExternalProject) + + set(FMT_LIB_NAME fmt) +- +-if (MSVC) +- # MSVC has errors when building fmt >6, up till 9.1 +- # SYCL / DPC++ needs fmt ver <=6 or >= 9.2: https://github.com/fmtlib/fmt/issues/3005 +- set(FMT_VER "6.0.0") +- set(FMT_SHA256 +- "f1907a58d5e86e6c382e51441d92ad9e23aea63827ba47fd647eacc0d3a16c78") +-else() +- set(FMT_VER "10.2.1") +- set(FMT_SHA256 +- "1250e4cc58bf06ee631567523f48848dc4596133e163f02615c97f78bab6c811") +-endif() ++set(FMT_VER "10.2.1") ++set(FMT_SHA256 ++ "1250e4cc58bf06ee631567523f48848dc4596133e163f02615c97f78bab6c811") + + ExternalProject_Add( + ext_fmt + +From 70f7e618e1d3c14295404abba451c071ff0cac01 Mon Sep 17 00:00:00 2001 +From: Zhirui Dai +Date: Mon, 20 May 2024 03:22:28 -0700 +Subject: [PATCH 08/11] fix build on Windows with CUDA enabled + +--- + 3rdparty/fmt/fmt.cmake | 16 +++- + cpp/open3d/core/linalg/LinalgHeadersCUDA.h | 103 +++++++++++++++++++++ + cpp/open3d/utility/Logging.h | 1 + + 3 files changed, 117 insertions(+), 3 deletions(-) + +diff --git a/3rdparty/fmt/fmt.cmake b/3rdparty/fmt/fmt.cmake +index 0ccbec293ff31f4aab20f9fe090e68574ab0c9d1..767f44c0c4798a66c83cf39944b28c8a8122c2f6 100644 +--- a/3rdparty/fmt/fmt.cmake ++++ b/3rdparty/fmt/fmt.cmake +@@ -1,9 +1,19 @@ + include(ExternalProject) + + set(FMT_LIB_NAME fmt) +-set(FMT_VER "10.2.1") +-set(FMT_SHA256 +- "1250e4cc58bf06ee631567523f48848dc4596133e163f02615c97f78bab6c811") ++ ++if (MSVC AND BUILD_CUDA_MODULE) ++ # set(FMT_VER "9.1.0") ++ set(FMT_VER "10.1.1") ++ set(FMT_SHA256 ++ "78b8c0a72b1c35e4443a7e308df52498252d1cefc2b08c9a97bc9ee6cfe61f8b" ++ # "5dea48d1fcddc3ec571ce2058e13910a0d4a6bab4cc09a809d8b1dd1c88ae6f2" ++ ) ++else() ++ set(FMT_VER "10.2.1") ++ set(FMT_SHA256 ++ "1250e4cc58bf06ee631567523f48848dc4596133e163f02615c97f78bab6c811") ++endif() + + ExternalProject_Add( + ext_fmt +diff --git a/cpp/open3d/core/linalg/LinalgHeadersCUDA.h b/cpp/open3d/core/linalg/LinalgHeadersCUDA.h +index d34394dc813bf43bd91455476efb369881ecf99c..765ef348df7e1b67e72234234ca851d0954844c3 100644 +--- a/cpp/open3d/core/linalg/LinalgHeadersCUDA.h ++++ b/cpp/open3d/core/linalg/LinalgHeadersCUDA.h +@@ -16,4 +16,107 @@ + #include + #include + #include ++ ++#include ++#include ++ ++namespace fmt { ++ ++template <> ++struct formatter { ++ template ++ auto format(const cusolverStatus_t& c, FormatContext& ctx) const ++ -> decltype(ctx.out()) { ++ const char* text = nullptr; ++ switch (c) { ++ case CUSOLVER_STATUS_SUCCESS: ++ text = "CUSOLVER_STATUS_SUCCESS"; ++ break; ++ case CUSOLVER_STATUS_NOT_INITIALIZED: ++ text = "CUSOLVER_STATUS_NOT_INITIALIZED"; ++ break; ++ case CUSOLVER_STATUS_ALLOC_FAILED: ++ text = "CUSOLVER_STATUS_ALLOC_FAILED"; ++ break; ++ case CUSOLVER_STATUS_INVALID_VALUE: ++ text = "CUSOLVER_STATUS_INVALID_VALUE"; ++ break; ++ case CUSOLVER_STATUS_ARCH_MISMATCH: ++ text = "CUSOLVER_STATUS_ARCH_MISMATCH"; ++ break; ++ case CUSOLVER_STATUS_MAPPING_ERROR: ++ text = "CUSOLVER_STATUS_MAPPING_ERROR"; ++ break; ++ case CUSOLVER_STATUS_EXECUTION_FAILED: ++ text = "CUSOLVER_STATUS_EXECUTION_FAILED"; ++ break; ++ case CUSOLVER_STATUS_INTERNAL_ERROR: ++ text = "CUSOLVER_STATUS_INTERNAL_ERROR"; ++ break; ++ case CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED: ++ text = "CUSOLVER_STATUS_MATRIX_TYPE_NOT_SUPPORTED"; ++ break; ++ case CUSOLVER_STATUS_NOT_SUPPORTED: ++ text = "CUSOLVER_STATUS_NOT_SUPPORTED"; ++ break; ++ case CUSOLVER_STATUS_ZERO_PIVOT: ++ text = "CUSOLVER_STATUS_ZERO_PIVOT"; ++ break; ++ case CUSOLVER_STATUS_INVALID_LICENSE: ++ text = "CUSOLVER_STATUS_INVALID_LICENSE"; ++ break; ++ case CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED: ++ text = "CUSOLVER_STATUS_IRS_PARAMS_NOT_INITIALIZED"; ++ break; ++ case CUSOLVER_STATUS_IRS_PARAMS_INVALID: ++ text = "CUSOLVER_STATUS_IRS_PARAMS_INVALID"; ++ break; ++ case CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC: ++ text = "CUSOLVER_STATUS_IRS_PARAMS_INVALID_PREC"; ++ break; ++ case CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE: ++ text = "CUSOLVER_STATUS_IRS_PARAMS_INVALID_REFINE"; ++ break; ++ case CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER: ++ text = "CUSOLVER_STATUS_IRS_PARAMS_INVALID_MAXITER"; ++ break; ++ case CUSOLVER_STATUS_IRS_INTERNAL_ERROR: ++ text = "CUSOLVER_STATUS_IRS_INTERNAL_ERROR"; ++ break; ++ case CUSOLVER_STATUS_IRS_NOT_SUPPORTED: ++ text = "CUSOLVER_STATUS_IRS_NOT_SUPPORTED"; ++ break; ++ case CUSOLVER_STATUS_IRS_OUT_OF_RANGE: ++ text = "CUSOLVER_STATUS_IRS_OUT_OF_RANGE"; ++ break; ++ case CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_GMRES: ++ text = "CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_GMRES"; ++ break; ++ case CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED: ++ text = "CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED"; ++ break; ++ case CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED: ++ text = "CUSOLVER_STATUS_IRS_INFOS_NOT_DESTROYED"; ++ break; ++ case CUSOLVER_STATUS_IRS_MATRIX_SINGULAR: ++ text = "CUSOLVER_STATUS_IRS_MATRIX_SINGULAR"; ++ break; ++ case CUSOLVER_STATUS_INVALID_WORKSPACE: ++ text = "CUSOLVER_STATUS_INVALID_WORKSPACE"; ++ break; ++ default: ++ text = "CUSOLVER_STATUS_UNKNOWN"; ++ break; ++ } ++ return format_to(ctx.out(), text); ++ } ++ ++ template ++ constexpr auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { ++ return ctx.begin(); ++ } ++}; ++ ++} // namespace fmt ++ + #endif +diff --git a/cpp/open3d/utility/Logging.h b/cpp/open3d/utility/Logging.h +index 15fe28fa5392d272cbad78af666364e465445dbf..04c70365db60353554bb57768721cd4b3c5404d1 100644 +--- a/cpp/open3d/utility/Logging.h ++++ b/cpp/open3d/utility/Logging.h +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #define DEFAULT_IO_BUFFER_SIZE 1024 + + +From ace94eb860706ff1d5080d391b134d6c20326d08 Mon Sep 17 00:00:00 2001 +From: Zhirui Dai +Date: Mon, 20 May 2024 04:08:08 -0700 +Subject: [PATCH 09/11] format code + +--- + cpp/open3d/core/linalg/LinalgHeadersCUDA.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/cpp/open3d/core/linalg/LinalgHeadersCUDA.h b/cpp/open3d/core/linalg/LinalgHeadersCUDA.h +index 765ef348df7e1b67e72234234ca851d0954844c3..cf1b8d635ba9bf28ebb7484b5441a39040935500 100644 +--- a/cpp/open3d/core/linalg/LinalgHeadersCUDA.h ++++ b/cpp/open3d/core/linalg/LinalgHeadersCUDA.h +@@ -16,7 +16,6 @@ + #include + #include + #include +- + #include + #include + +@@ -90,7 +89,8 @@ struct formatter { + text = "CUSOLVER_STATUS_IRS_OUT_OF_RANGE"; + break; + case CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_GMRES: +- text = "CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_GMRES"; ++ text = "CUSOLVER_STATUS_IRS_NRHS_NOT_SUPPORTED_FOR_REFINE_" ++ "GMRES"; + break; + case CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED: + text = "CUSOLVER_STATUS_IRS_INFOS_NOT_INITIALIZED"; + +From c7c28ecbc3ab503d06d8c4633b72112f80f19fcc Mon Sep 17 00:00:00 2001 +From: Zhirui Dai +Date: Mon, 20 May 2024 15:46:12 -0700 +Subject: [PATCH 10/11] fix build when BUILD_AZURE_KINECT is ON + +--- + 3rdparty/find_dependencies.cmake | 4 ++- + cpp/open3d/io/sensor/azure_kinect/K4aPlugin.h | 35 +++++++++++++++++++ + cpp/open3d/ml/pytorch/CMakeLists.txt | 11 +++++- + cpp/open3d/utility/ParallelScan.h | 8 +++++ + .../visualization/rendering/RendererHandle.h | 2 +- + .../filament/FilamentResourceManager.cpp | 4 +-- + 6 files changed, 59 insertions(+), 5 deletions(-) + +diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake +index d929b27728ab900e30254b97ad9a1af6abe36983..45555b83a84591d4cb273bbc56b72f40af15ed55 100644 +--- a/3rdparty/find_dependencies.cmake ++++ b/3rdparty/find_dependencies.cmake +@@ -1554,7 +1554,9 @@ if(OPEN3D_USE_ONEAPI_PACKAGES) + TARGETS TBB::tbb + ) + list(APPEND Open3D_3RDPARTY_PRIVATE_TARGETS_FROM_SYSTEM Open3D::3rdparty_tbb) +- ++ target_compile_definitions(3rdparty_tbb INTERFACE OPEN3D_USE_ONEAPI_PACKAGES=1) ++ target_compile_definitions(3rdparty_tbb INTERFACE _PSTL_UDR_PRESENT=0) ++ target_compile_definitions(3rdparty_tbb INTERFACE _PSTL_UDS_PRESENT=0) + # 2. oneDPL + # /opt/intel/oneapi/dpl/latest/lib/cmake/oneDPL + open3d_find_package_3rdparty_library(3rdparty_onedpl +diff --git a/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.h b/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.h +index cd9a6eb1db1d17fd6efc305d5c815487a9b7acec..15e461d4285b82456d1c699877f9b76023e12f3a 100644 +--- a/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.h ++++ b/cpp/open3d/io/sensor/azure_kinect/K4aPlugin.h +@@ -295,3 +295,38 @@ k4a_result_t k4a_transformation_depth_image_to_point_cloud( + } // namespace k4a_plugin + } // namespace io + } // namespace open3d ++ ++#include ++ ++namespace fmt { ++ ++template <> ++struct formatter { ++ template ++ auto format(const k4a_wait_result_t &c, FormatContext &ctx) const ++ -> decltype(ctx.out()) { ++ const char *text = nullptr; ++ switch (c) { ++ case K4A_WAIT_RESULT_SUCCEEDED: ++ text = "K4A_WAIT_RESULT_SUCCEEDED"; ++ break; ++ case K4A_WAIT_RESULT_FAILED: ++ text = "K4A_WAIT_RESULT_FAILED"; ++ break; ++ case K4A_WAIT_RESULT_TIMEOUT: ++ text = "K4A_WAIT_RESULT_TIMEOUT"; ++ break; ++ default: ++ text = "Unknown k4a_wait_result_t"; ++ break; ++ } ++ return format_to(ctx.out(), text); ++ } ++ ++ template ++ constexpr auto parse(ParseContext &ctx) -> decltype(ctx.begin()) { ++ return ctx.begin(); ++ } ++}; ++ ++} // namespace fmt +diff --git a/cpp/open3d/ml/pytorch/CMakeLists.txt b/cpp/open3d/ml/pytorch/CMakeLists.txt +index adc9ac48e3d57f0937fc160269540455390855f4..3cb75e531de07421821d87e585be18cea1cbf253 100644 +--- a/cpp/open3d/ml/pytorch/CMakeLists.txt ++++ b/cpp/open3d/ml/pytorch/CMakeLists.txt +@@ -140,9 +140,18 @@ target_link_libraries(open3d_torch_ops PRIVATE + Open3D::3rdparty_eigen3 + Open3D::3rdparty_fmt + Open3D::3rdparty_nanoflann +- Open3D::3rdparty_parallelstl + Open3D::3rdparty_tbb + ) ++if (TARGET Open3D::3rdparty_parallelstl) ++ target_link_libraries(open3d_torch_ops PRIVATE ++ Open3D::3rdparty_parallelstl ++ ) ++endif() ++if (TARGET Open3D::3rdparty_onedpl) ++ target_link_libraries(open3d_torch_ops PRIVATE ++ Open3D::3rdparty_onedpl ++ ) ++endif() + + if (BUILD_CUDA_MODULE) + target_link_libraries(open3d_torch_ops PRIVATE +diff --git a/cpp/open3d/utility/ParallelScan.h b/cpp/open3d/utility/ParallelScan.h +index a98015053f8b816e7dbe862a784da15f09d9bc83..0479d611eb5c3992dc5c55a453d67d85395c1101 100644 +--- a/cpp/open3d/utility/ParallelScan.h ++++ b/cpp/open3d/utility/ParallelScan.h +@@ -13,6 +13,14 @@ + // clang-format off + #if TBB_INTERFACE_VERSION >= 10000 + #ifdef OPEN3D_USE_ONEAPI_PACKAGES ++ #ifdef _PSTL_UDR_PRESENT ++ #undef _PSTL_UDR_PRESENT ++ #endif ++ #define _PSTL_UDR_PRESENT 0 ++ #ifdef _PSTL_UDS_PRESENT ++ #undef _PSTL_UDS_PRESENT ++ #endif ++ #define _PSTL_UDS_PRESENT 0 + #include + #include + #else +diff --git a/cpp/open3d/visualization/rendering/RendererHandle.h b/cpp/open3d/visualization/rendering/RendererHandle.h +index 45b59a70c60355103ba52f1ad20f839b1e9c31e2..dc8b06382e784e72602d44f729a2a9d3118fb7f8 100644 +--- a/cpp/open3d/visualization/rendering/RendererHandle.h ++++ b/cpp/open3d/visualization/rendering/RendererHandle.h +@@ -98,7 +98,7 @@ struct REHandle : public REHandle_abstract { + id = REHandle_abstract::kBadId + 1; + } + +- return std::move(REHandle(id)); ++ return REHandle(id); + } + + static REHandle Concretize(const REHandle_abstract& abstract) { +diff --git a/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.cpp b/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.cpp +index 0c831e9d2d0213eeee70cf797b118f35c5920a83..1dcf171536895da2a1efd08c50f8ab3fc15c30be 100644 +--- a/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.cpp ++++ b/cpp/open3d/visualization/rendering/filament/FilamentResourceManager.cpp +@@ -77,8 +77,8 @@ using ResourcesContainer = + template + std::shared_ptr MakeShared(ResourceType* pointer, + filament::Engine& engine) { +- return std::move(std::shared_ptr( +- pointer, [&engine](ResourceType* p) { engine.destroy(p); })); ++ return std::shared_ptr( ++ pointer, [&engine](ResourceType* p) { engine.destroy(p); }); + } + + template + +From 38afc66580f0b7e3373c3f9fc78b07fd1d79f238 Mon Sep 17 00:00:00 2001 +From: Zhirui Dai +Date: Tue, 21 May 2024 01:39:52 -0700 +Subject: [PATCH 11/11] fix build on Windows with MSVC v142 and CUDA enabled + +--- + 3rdparty/fmt/fmt.cmake | 15 +++++++++------ + cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp | 2 ++ + cpp/open3d/utility/Logging.h | 2 ++ + examples/cpp/OnlineSLAMUtil.h | 2 ++ + 4 files changed, 15 insertions(+), 6 deletions(-) + +diff --git a/3rdparty/fmt/fmt.cmake b/3rdparty/fmt/fmt.cmake +index 767f44c0c4798a66c83cf39944b28c8a8122c2f6..d7698e1a645be30e6960bba564dc6747c1ffdcbc 100644 +--- a/3rdparty/fmt/fmt.cmake ++++ b/3rdparty/fmt/fmt.cmake +@@ -3,12 +3,15 @@ include(ExternalProject) + set(FMT_LIB_NAME fmt) + + if (MSVC AND BUILD_CUDA_MODULE) +- # set(FMT_VER "9.1.0") +- set(FMT_VER "10.1.1") +- set(FMT_SHA256 +- "78b8c0a72b1c35e4443a7e308df52498252d1cefc2b08c9a97bc9ee6cfe61f8b" +- # "5dea48d1fcddc3ec571ce2058e13910a0d4a6bab4cc09a809d8b1dd1c88ae6f2" +- ) ++ if (MSVC_VERSION GREATER_EQUAL 1930) # v143 ++ set(FMT_VER "10.1.1") ++ set(FMT_SHA256 ++ "78b8c0a72b1c35e4443a7e308df52498252d1cefc2b08c9a97bc9ee6cfe61f8b") ++ else() ++ set(FMT_VER "6.0.0") ++ set(FMT_SHA256 ++ "f1907a58d5e86e6c382e51441d92ad9e23aea63827ba47fd647eacc0d3a16c78") ++ endif() + else() + set(FMT_VER "10.2.1") + set(FMT_SHA256 +diff --git a/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp b/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp +index 990b948ee33e71a1fb53fc43d39e56c4cf10eaf5..1bb6dd7608165122a991ef4b5737b2d0b9336435 100644 +--- a/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp ++++ b/cpp/open3d/t/io/sensor/realsense/RSBagReader.cpp +@@ -7,7 +7,9 @@ + + #include "open3d/t/io/sensor/realsense/RSBagReader.h" + ++#if FMT_VERSION >= 100000 + #include ++#endif + #include + + #include +diff --git a/cpp/open3d/utility/Logging.h b/cpp/open3d/utility/Logging.h +index 04c70365db60353554bb57768721cd4b3c5404d1..fdb132f9b06656c3416c2c64b7fa30e404d11b8f 100644 +--- a/cpp/open3d/utility/Logging.h ++++ b/cpp/open3d/utility/Logging.h +@@ -21,7 +21,9 @@ + #include + #include + #include ++#if FMT_VERSION >= 100000 + #include ++#endif + + #define DEFAULT_IO_BUFFER_SIZE 1024 + +diff --git a/examples/cpp/OnlineSLAMUtil.h b/examples/cpp/OnlineSLAMUtil.h +index ecb2d0b52ae9def57ee6a8c890d4cdcf7b2356ef..358256de3df97e6bc8ff776168edc23eb6522ec8 100644 +--- a/examples/cpp/OnlineSLAMUtil.h ++++ b/examples/cpp/OnlineSLAMUtil.h +@@ -5,7 +5,9 @@ + // SPDX-License-Identifier: MIT + // ---------------------------------------------------------------------------- + ++#if FMT_VERSION >= 100000 + #include ++#endif + + #include + #include diff --git a/ports/open3d/6969.patch b/ports/open3d/6969.patch new file mode 100644 index 00000000000000..960477174a01c1 --- /dev/null +++ b/ports/open3d/6969.patch @@ -0,0 +1,65 @@ +Remove in the next release +Modified from https://github.com/isl-org/Open3D/pull/6969 + +From 3773d816260c5912581397a0dadf08da4c943d68 Mon Sep 17 00:00:00 2001 +From: Zhirui Dai +Date: Sat, 14 Sep 2024 20:41:27 -0700 +Subject: [PATCH 1/2] fix build with fmt-v11 + +--- + cpp/open3d/t/geometry/RaycastingScene.cpp | 2 +- + cpp/open3d/utility/IJsonConvertible.h | 3 +-- + cpp/open3d/visualization/rendering/RendererHandle.h | 2 +- + 3 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/cpp/open3d/utility/IJsonConvertible.h b/cpp/open3d/utility/IJsonConvertible.h +index 8febffa566f..3811359147d 100644 +--- a/cpp/open3d/utility/IJsonConvertible.h ++++ b/cpp/open3d/utility/IJsonConvertible.h +@@ -86,8 +86,7 @@ namespace fmt { + template <> + struct formatter { + template +- auto format(const Json::Value &value, FormatContext &ctx) +- -> decltype(ctx.out()) { ++ auto format(const Json::Value &value, FormatContext &ctx) const -> decltype(ctx.out()) { + return format_to(ctx.out(), "{}", open3d::utility::JsonToString(value)); + } + +diff --git a/cpp/open3d/visualization/rendering/RendererHandle.h b/cpp/open3d/visualization/rendering/RendererHandle.h +index dc8b06382e7..be69a3d99a8 100644 +--- a/cpp/open3d/visualization/rendering/RendererHandle.h ++++ b/cpp/open3d/visualization/rendering/RendererHandle.h +@@ -164,7 +164,7 @@ struct formatter< + char>> { + template + auto format(const open3d::visualization::rendering::REHandle_abstract& uid, +- FormatContext& ctx) -> decltype(ctx.out()) { ++ FormatContext& ctx) const -> decltype(ctx.out()) { + return format_to(ctx.out(), "[{}, {}, hash: {}]", + open3d::visualization::rendering::REHandle_abstract:: + TypeToString(uid.type), + +From 8f8a41169f38e740c3b89b0cbd3861ed644efb57 Mon Sep 17 00:00:00 2001 +From: Zhirui Dai +Date: Sat, 14 Sep 2024 20:46:14 -0700 +Subject: [PATCH 2/2] fix code style + +--- + cpp/open3d/utility/IJsonConvertible.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/cpp/open3d/utility/IJsonConvertible.h b/cpp/open3d/utility/IJsonConvertible.h +index 3811359147d..e18e2948a23 100644 +--- a/cpp/open3d/utility/IJsonConvertible.h ++++ b/cpp/open3d/utility/IJsonConvertible.h +@@ -86,7 +86,8 @@ namespace fmt { + template <> + struct formatter { + template +- auto format(const Json::Value &value, FormatContext &ctx) const -> decltype(ctx.out()) { ++ auto format(const Json::Value &value, FormatContext &ctx) const ++ -> decltype(ctx.out()) { + return format_to(ctx.out(), "{}", open3d::utility::JsonToString(value)); + } + diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 9edf0b79b402da..73e5928ee91816 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -12,8 +12,10 @@ vcpkg_from_github( 0003-liblzf.patch 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 + # remove in the next release + 6783.patch + 6969.patch ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_WINDOWS_RUNTIME) diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index cf24872a36b790..511db2dde2c646 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "3e9de6ee1aed3af663dbde7a6264d4c738f052a1", + "git-tree": "c6c45ab888b71a6472c40699b746c7feb22d55e8", "version-semver": "0.18.0", "port-version": 0 } From 933da635fdad8adf4dec60efdb0055bdcf7d444f Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 09:27:09 -0700 Subject: [PATCH 24/31] [open3d] fix curl macro redefinition --- ports/open3d/0008-curl.patch | 17 +++++++++++++++++ ports/open3d/portfile.cmake | 1 + 2 files changed, 18 insertions(+) create mode 100644 ports/open3d/0008-curl.patch diff --git a/ports/open3d/0008-curl.patch b/ports/open3d/0008-curl.patch new file mode 100644 index 00000000000000..fa03435ca11a2c --- /dev/null +++ b/ports/open3d/0008-curl.patch @@ -0,0 +1,17 @@ +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 + #include +-- +2.45.2 + diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 73e5928ee91816..6c05fecf68e2b4 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_from_github( 0004-tiny_gltf.patch 0005-jsoncpp.patch 0007-parallelstl.patch + 0008-curl.patch # remove in the next release 6783.patch 6969.patch From bcd1c4af6dc620f3256ae01d2e9945888be068bc Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 09:27:39 -0700 Subject: [PATCH 25/31] [open3d] add minizip dependency --- ports/open3d/portfile.cmake | 1 + ports/open3d/vcpkg.json | 1 + versions/o-/open3d.json | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 6c05fecf68e2b4..ec1ed70e3d4e8f 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -86,6 +86,7 @@ vcpkg_cmake_configure( -DUSE_SYSTEM_VTK=ON -DUSE_SYSTEM_ZEROMQ=ON -DUSE_SYSTEM_PARALLELSTL=ON + -DWITH_MINIZIP=ON ) vcpkg_cmake_build(TARGET Open3D) diff --git a/ports/open3d/vcpkg.json b/ports/open3d/vcpkg.json index 52e194b0e241f4..d564edbe09b63b 100644 --- a/ports/open3d/vcpkg.json +++ b/ports/open3d/vcpkg.json @@ -16,6 +16,7 @@ "jsoncpp", "libjpeg-turbo", "liblzf", + "minizip", "msgpack", "nanoflann", "opengl", diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index 511db2dde2c646..83c5d8f16c75a3 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "c6c45ab888b71a6472c40699b746c7feb22d55e8", + "git-tree": "8fbfc633fc74b00735aaa53d4d259a2ba6699981", "version-semver": "0.18.0", "port-version": 0 } From 8bfb31a3973233e7d914b5ab43dc4f76e07be64c Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 09:35:31 -0700 Subject: [PATCH 26/31] [open3d] add missing std includes --- ports/open3d/0009-std-includes.patch | 18 ++++++++++++++++++ ports/open3d/portfile.cmake | 1 + 2 files changed, 19 insertions(+) create mode 100644 ports/open3d/0009-std-includes.patch diff --git a/ports/open3d/0009-std-includes.patch b/ports/open3d/0009-std-includes.patch new file mode 100644 index 00000000000000..585a28d9e0ce0e --- /dev/null +++ b/ports/open3d/0009-std-includes.patch @@ -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 ++#include ++#include ++ + #include "open3d/visualization/rendering/MaterialModifier.h" + #include "open3d/visualization/rendering/RendererHandle.h" + +-- +2.45.2 + diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index ec1ed70e3d4e8f..f205d92f09a7a9 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -14,6 +14,7 @@ vcpkg_from_github( 0005-jsoncpp.patch 0007-parallelstl.patch 0008-curl.patch + 0009-std-includes.patch # remove in the next release 6783.patch 6969.patch From 745242c8534acf31b0b88daecc08d37c0366b94a Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 29 Oct 2024 10:08:10 -0700 Subject: [PATCH 27/31] [open3d] fix imgui obsolete functions --- ports/open3d/0010-imgui.patch | 42 +++++++++++++++++++++++++++++++++++ ports/open3d/portfile.cmake | 1 + versions/o-/open3d.json | 2 +- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 ports/open3d/0010-imgui.patch diff --git a/ports/open3d/0010-imgui.patch b/ports/open3d/0010-imgui.patch new file mode 100644 index 00000000000000..f8cc37e4676857 --- /dev/null +++ b/ports/open3d/0010-imgui.patch @@ -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 ++#include // ImMin + + #include + #include +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 + diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index f205d92f09a7a9..35d02e36d38edb 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -15,6 +15,7 @@ vcpkg_from_github( 0007-parallelstl.patch 0008-curl.patch 0009-std-includes.patch + 0010-imgui.patch # remove in the next release 6783.patch 6969.patch diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index 83c5d8f16c75a3..6d9b8e3cd051a3 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "8fbfc633fc74b00735aaa53d4d259a2ba6699981", + "git-tree": "5763912f09c5fccaebdd625c2fca84d28336aca9", "version-semver": "0.18.0", "port-version": 0 } From fd93578c71bb7a76d2d15d526172026d60c84597 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 31 Oct 2024 00:06:14 -0700 Subject: [PATCH 28/31] [open3d] add more llvm paths for libc++ --- ports/open3d/0011-llvm.patch | 31 +++++++++++++++++++++++++++++++ ports/open3d/portfile.cmake | 10 ++++++++++ 2 files changed, 41 insertions(+) create mode 100644 ports/open3d/0011-llvm.patch diff --git a/ports/open3d/0011-llvm.patch b/ports/open3d/0011-llvm.patch new file mode 100644 index 00000000000000..5f2944dd7b91d2 --- /dev/null +++ b/ports/open3d/0011-llvm.patch @@ -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 + diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 35d02e36d38edb..1e5099f93a3a48 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -16,6 +16,7 @@ vcpkg_from_github( 0008-curl.patch 0009-std-includes.patch 0010-imgui.patch + 0011-llvm.patch # remove in the next release 6783.patch 6969.patch @@ -39,6 +40,15 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS "realsense2" BUILD_LIBREALSENSE ) +if(BUILD_GUI) + if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_HOST_IS_FREEBSD OR VCPKG_HOST_IS_OPENBSD) + message(WARNING "open3d with gui feature requires the following packages via the system package manager: + libc++ libc++abi +On Debian/Ubuntu derivatives: + sudo apt-get install libc++-dev libc++abi-dev") + endif() +endif() + vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} OPTIONS From c558d070ec39e1dd23406e2d9060afabd2ef4897 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 31 Oct 2024 00:10:40 -0700 Subject: [PATCH 29/31] [open3d] fix webrtc for Windows --- ports/open3d/0012-webrtc.patch | 21 +++++++++++++++++++++ ports/open3d/portfile.cmake | 1 + 2 files changed, 22 insertions(+) create mode 100644 ports/open3d/0012-webrtc.patch diff --git a/ports/open3d/0012-webrtc.patch b/ports/open3d/0012-webrtc.patch new file mode 100644 index 00000000000000..5314f06762d534 --- /dev/null +++ b/ports/open3d/0012-webrtc.patch @@ -0,0 +1,21 @@ +diff --git a/3rdparty/webrtc/webrtc_download.cmake b/3rdparty/webrtc/webrtc_download.cmake +index 8ac5a0b6e..18380fdcc 100644 +--- a/3rdparty/webrtc/webrtc_download.cmake ++++ b/3rdparty/webrtc/webrtc_download.cmake +@@ -11,13 +11,6 @@ if (APPLE) + ) + set(WEBRTC_SHA256 e9d1f4e4fefb2e28ef4f16cf4a4f0008baf4fe638ca3ad329e82e7fd0ce87f56) + elseif (WIN32) +- if (BUILD_SHARED_LIBS OR NOT STATIC_WINDOWS_RUNTIME) +- message(FATAL_ERROR "Pre-built WebRTC binaries are not available for " +- "BUILD_SHARED_LIBS=ON or STATIC_WINDOWS_RUNTIME=OFF. Please use " +- "(a) BUILD_WEBRTC=OFF or " +- "(b) BUILD_SHARED_LIBS=OFF and STATIC_WINDOWS_RUNTIME=ON or " +- "(c) BUILD_WEBRTC_FROM_SOURCE=ON") +- endif() + set(WEBRTC_URL + https://github.com/isl-org/open3d_downloads/releases/download/webrtc/webrtc_${WEBRTC_VER}_win.zip + ) +-- +2.45.2 + diff --git a/ports/open3d/portfile.cmake b/ports/open3d/portfile.cmake index 1e5099f93a3a48..521edc3fb2647c 100644 --- a/ports/open3d/portfile.cmake +++ b/ports/open3d/portfile.cmake @@ -17,6 +17,7 @@ vcpkg_from_github( 0009-std-includes.patch 0010-imgui.patch 0011-llvm.patch + 0012-webrtc.patch # remove in the next release 6783.patch 6969.patch From 075cce350c5ec4044c197914783946ccf36dbdba Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 31 Oct 2024 00:20:48 -0700 Subject: [PATCH 30/31] [open3d] fix finding libcurl via CMake --- ports/open3d/0008-curl.patch | 16 ++++++++++++++++ versions/o-/open3d.json | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ports/open3d/0008-curl.patch b/ports/open3d/0008-curl.patch index fa03435ca11a2c..2f123e085f11e7 100644 --- a/ports/open3d/0008-curl.patch +++ b/ports/open3d/0008-curl.patch @@ -12,6 +12,22 @@ index 025dbc664..0193d1fa3 100644 #include #include +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 diff --git a/versions/o-/open3d.json b/versions/o-/open3d.json index 6d9b8e3cd051a3..5739bce29851f0 100644 --- a/versions/o-/open3d.json +++ b/versions/o-/open3d.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "5763912f09c5fccaebdd625c2fca84d28336aca9", + "git-tree": "7457dcee0901af626e06d4fac8719472f8bfef0c", "version-semver": "0.18.0", "port-version": 0 } From 9451b48f2348592ae64a7aa2e99e3ac09fe4f7ce Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 31 Oct 2024 01:14:57 -0700 Subject: [PATCH 31/31] [ci] add required libc++ libraries for Open3D --- scripts/azure-pipelines/linux/managed-image.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/azure-pipelines/linux/managed-image.json b/scripts/azure-pipelines/linux/managed-image.json index 7b65bcc09df430..9144b2da4cf107 100644 --- a/scripts/azure-pipelines/linux/managed-image.json +++ b/scripts/azure-pipelines/linux/managed-image.json @@ -3,7 +3,7 @@ { "name": "linux-install-packages", "parameters": { - "packages": "git curl zip unzip tar at libxt-dev gperf libxaw7-dev cifs-utils build-essential g++ gfortran libx11-dev libxkbcommon-x11-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxinerama-dev libxxf86vm-dev libxcursor-dev yasm libnuma1 libnuma-dev libtool-bin libltdl-dev flex bison libbison-dev autoconf libudev-dev libncurses5-dev libtool libxrandr-dev xutils-dev dh-autoreconf autoconf-archive libgles2-mesa-dev ruby-full pkg-config meson nasm cmake ninja-build libxext-dev libxfixes-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-dri3-dev libxcb-present-dev libxcb-glx0-dev libxcb-util0-dev libxkbcommon-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libxcb-cursor-dev libkrb5-dev libxcb-res0-dev libxcb-keysyms1-dev libxcb-xkb-dev libxcb-record0-dev python3-setuptools python3-mako python3-pip python3-venv python3-jinja2 nodejs libwayland-dev python-is-python3 guile-2.2-dev libxdamage-dev libxtst-dev haskell-stack golang-go wayland-protocols libbluetooth-dev" + "packages": "git curl zip unzip tar at libxt-dev gperf libxaw7-dev cifs-utils build-essential g++ gfortran libx11-dev libxkbcommon-x11-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxinerama-dev libxxf86vm-dev libxcursor-dev yasm libnuma1 libnuma-dev libtool-bin libltdl-dev flex bison libbison-dev autoconf libudev-dev libncurses5-dev libtool libxrandr-dev xutils-dev dh-autoreconf autoconf-archive libgles2-mesa-dev ruby-full pkg-config meson nasm cmake ninja-build libxext-dev libxfixes-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-dri3-dev libxcb-present-dev libxcb-glx0-dev libxcb-util0-dev libxkbcommon-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libxcb-cursor-dev libkrb5-dev libxcb-res0-dev libxcb-keysyms1-dev libxcb-xkb-dev libxcb-record0-dev python3-setuptools python3-mako python3-pip python3-venv python3-jinja2 nodejs libwayland-dev python-is-python3 guile-2.2-dev libxdamage-dev libxtst-dev haskell-stack golang-go wayland-protocols libbluetooth-dev libc++-dev libc++abi-dev" } }, {