Skip to content

Commit 9ab5146

Browse files
authored
Merge branch 'main' into johnnynunez/main
2 parents bc8dde4 + 07fa91f commit 9ab5146

File tree

109 files changed

+2069
-1970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+2069
-1970
lines changed

.github/workflows/macos.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,6 @@ jobs:
7373
ln -s $(brew --prefix gcc)/bin/gfortran-* /usr/local/bin/gfortran
7474
fi
7575
76-
# Install libomp 11.1.0 from old brew bottle for x64 catalina (10.15)
77-
# / arm64 big sur (11.0). Directly installing the Ruby formula will
78-
# install for the current OS.
79-
# https://github.com/microsoft/LightGBM/issues/4229
80-
if [[ ${{ runner.arch}} == "X64" ]]; then
81-
# x64 catalina (10.15) bottle
82-
export LIBOMP_BOTTLE_HASH=45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05
83-
else # ARM64
84-
# arm64 big_sur (11.0) bottle
85-
export LIBOMP_BOTTLE_HASH=f87f7841eb8b72650fa771af39642361aec371ea1a1f94f081ecc0e8168a0e75
86-
fi
87-
curl -L -H "Authorization: Bearer QQ==" -o libomp-11.1.0.bottle.tar.gz \
88-
https://ghcr.io/v2/homebrew/core/libomp/blobs/sha256:$LIBOMP_BOTTLE_HASH
89-
brew install -f libomp-11.1.0.bottle.tar.gz
90-
9176
ccache -M 2G # See .github/workflows/readme.md for ccache strategy.
9277
- name: Config and build
9378
run: |
@@ -204,17 +189,6 @@ jobs:
204189
ln -s $(which gfortran-13) /usr/local/bin/gfortran
205190
fi
206191
207-
# Install libomp 11.1.0. See comment above.
208-
if [[ ${{ runner.arch}} == "X64" ]]; then
209-
# x64 catalina (10.15) bottle
210-
export LIBOMP_BOTTLE_HASH=45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05
211-
else # ARM64
212-
# arm64 big_sur (11.0) bottle
213-
export LIBOMP_BOTTLE_HASH=f87f7841eb8b72650fa771af39642361aec371ea1a1f94f081ecc0e8168a0e75
214-
fi
215-
curl -L -H "Authorization: Bearer QQ==" -o libomp-11.1.0.bottle.tar.gz \
216-
https://ghcr.io/v2/homebrew/core/libomp/blobs/sha256:$LIBOMP_BOTTLE_HASH
217-
brew install -f libomp-11.1.0.bottle.tar.gz
218192
brew install ccache
219193
ccache -M 2G # See .github/workflows/readme.md for ccache strategy.
220194

.github/workflows/style.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Style Check
2-
permissions: {}
32

43
on:
54
workflow_dispatch:
@@ -16,18 +15,49 @@ concurrency:
1615
jobs:
1716
style-check:
1817
permissions:
19-
contents: read
18+
contents: write
2019
runs-on: ubuntu-latest
2120
steps:
2221
- name: Checkout source code
2322
uses: actions/checkout@v4
23+
with:
24+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
25+
ref: ${{ github.event.pull_request.head.sha || github.ref }}
26+
token: ${{ secrets.GITHUB_TOKEN }}
2427
- name: Set up Python version
2528
uses: actions/setup-python@v5
2629
with:
2730
python-version: '3.12'
2831
- name: Install dependencies
2932
run: |
3033
pip install -U -r python/requirements_style.txt
31-
- name: Run style check
34+
- name: Apply style formatting
35+
if: github.event_name == 'pull_request'
36+
run: |
37+
python util/check_style.py --apply
38+
- name: Check style formatting
39+
if: github.event_name != 'pull_request'
3240
run: |
3341
python util/check_style.py
42+
- name: Commit and push changes
43+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
44+
run: |
45+
git config --global user.name 'github-actions[bot]'
46+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
47+
git add -u
48+
if ! git diff --staged --quiet; then
49+
git commit -m "Apply automatic code formatting"
50+
git push || exit 1
51+
else
52+
echo "No formatting changes needed"
53+
fi
54+
- name: Check for formatting changes from fork
55+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
56+
run: |
57+
git add -u
58+
if ! git diff --staged --quiet; then
59+
echo "::error::This PR requires formatting changes but is from a fork. Please run 'python util/check_style.py --apply' locally and push the changes."
60+
exit 1
61+
else
62+
echo "No formatting changes needed"
63+
fi

3rdparty/find_dependencies.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ endfunction()
161161
# CMake arguments for configuring ExternalProjects. Use the second _hidden
162162
# version by default.
163163
set(ExternalProject_CMAKE_ARGS
164+
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 # for VTK 9.1
164165
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
165166
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
166167
-DCMAKE_CUDA_COMPILER=${CMAKE_CUDA_COMPILER}

3rdparty/uvatlas/uvatlas.cmake

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ include(ExternalProject)
44
ExternalProject_Add(
55
ext_directxheaders
66
PREFIX uvatlas
7-
GIT_REPOSITORY https://github.com/microsoft/DirectX-Headers.git
8-
GIT_TAG v1.606.3
9-
GIT_SHALLOW TRUE
7+
URL https://github.com/microsoft/DirectX-Headers/archive/v1.606.3/DirectX-Headers-v1.606.3.tar.gz
8+
URL_HASH
9+
SHA256=bf0183981e505336e918609374907c934b99eb61c0826d75a5649f41568abc4b
1010
DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/uvatlas"
1111
UPDATE_COMMAND ""
1212
CMAKE_ARGS
@@ -22,9 +22,9 @@ ExternalProject_Add(
2222
ExternalProject_Add(
2323
ext_directxmath
2424
PREFIX uvatlas
25-
GIT_REPOSITORY https://github.com/microsoft/DirectXMath.git
26-
GIT_TAG may2022
27-
GIT_SHALLOW TRUE
25+
URL https://github.com/microsoft/DirectXMath/archive/may2022/DirectXMath-may2022.tar.gz
26+
URL_HASH
27+
SHA256=b2c5b419ca2c567860f7c204c9c0890573e8a58c8d877473e4f3ba6b851ca4ce
2828
DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/uvatlas"
2929
UPDATE_COMMAND ""
3030
CMAKE_ARGS
@@ -63,4 +63,4 @@ if(NOT WIN32)
6363
list(APPEND UVATLAS_INCLUDE_DIRS "${INSTALL_DIR}/include/wsl/stubs/")
6464
endif()
6565
set(UVATLAS_LIB_DIR ${INSTALL_DIR}/${Open3D_INSTALL_LIB_DIR})
66-
set(UVATLAS_LIBRARIES UVAtlas)
66+
set(UVATLAS_LIBRARIES UVAtlas)

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@
6363
- Exposed `get_plotly_fig` and modified `draw_plotly` to return the `Figure` it creates. (PR #7258)
6464
- Fix build with librealsense v2.44.0 and upcoming VS 2022 17.13 (PR #7074)
6565
- Fix `deprecated-declarations` warnings when compiling code with C++20 standard (PR #7303)
66+
- Fix advanced indexing bug with sliced boolean masks on CUDA devices (PR #7340)
67+
- Fix logic for adding -allow-unsupported-compiler to nvcc (PR #7337)
68+
- Fix linker error "library limit of 65535 objects exceeded" with Ninja generator on MSVC (PR #7335)
69+
- Download tarballs instead of Git repos for "3rdparty/uvatlas" (PR #7371)
6670
- macOS x86_64 not longer supported, only macOS arm64 is supported.
71+
72+
6773
## 0.13
6874

6975
- CUDA support 10.1 -> 11.0. Tensorflow 2.3.1 -> 2.4.1. PyTorch 1.6.0 -> 1.7.1 (PR #3049). This requires a custom PyTorch wheel from <https://github.com/isl-org/open3d_downloads/releases/tag/torch1.7.1> due to PyTorch issue #52663

CMakeLists.txt

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ option(USE_SYSTEM_VTK "Use system pre-installed VTK" OFF
125125
option(USE_SYSTEM_ZEROMQ "Use system pre-installed ZeroMQ" OFF)
126126
if(LINUX_AARCH64 OR APPLE_AARCH64)
127127
option(BUILD_VTK_FROM_SOURCE "Build VTK from source" ON )
128-
else()
129-
option(BUILD_VTK_FROM_SOURCE "Build VTK from source" OFF)
130-
endif()
128+
else()
129+
option(BUILD_VTK_FROM_SOURCE "Build VTK from source" OFF)
130+
endif()
131131
if(LINUX_AARCH64)
132132
option(BUILD_FILAMENT_FROM_SOURCE "Build filament from source" ON )
133133
else()
@@ -395,14 +395,21 @@ cmake_language(EVAL CODE "cmake_language(DEFER CALL open3d_patch_findthreads_mod
395395

396396
# Build CUDA module by default if CUDA is available
397397
if(BUILD_CUDA_MODULE)
398-
# Suppress nvcc unsupported compiler error for MSVC 2022 with CUDA 11.7 to 12.4
399-
# https://forums.developer.nvidia.com/t/problems-with-latest-vs2022-update/294150/12
400-
if (MSVC AND MSVC_VERSION VERSION_LESS_EQUAL "1949")
401-
# Set this before any CUDA checks
402-
add_compile_definitions(_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH)
403-
set(CMAKE_CUDA_FLAGS "--allow-unsupported-compiler" CACHE STRING "Additional flags for nvcc" FORCE)
404-
message(WARNING "Using --allow-unsupported-compiler flag for nvcc with MSVC 2022. "
405-
"Set $Env:NVCC_PREPEND_FLAGS='--allow-unsupported-compiler' if nvcc still fails.")
398+
if(MSVC)
399+
# Handle/suppress nvcc unsupported compiler error for MSVC>=1940 with CUDA 11.7 to 12.4:
400+
# (https://forums.developer.nvidia.com/t/problems-with-latest-vs2022-update/294150/12)
401+
# Find CUDAToolkit first to get CUDAToolkit_VERSION:
402+
find_package(CUDAToolkit REQUIRED)
403+
if (CUDAToolkit_VERSION VERSION_LESS "12.5" AND MSVC_VERSION GREATER_EQUAL 1940)
404+
# Set required nvcc flags before enable_language(CUDA).
405+
# Note: CMake >=3.29.4 might be needed for CMAKE_CUDA_FLAGS to be passed correctly to
406+
# CMake's try_compile environment.
407+
set(CMAKE_CUDA_FLAGS
408+
"${CMAKE_CUDA_FLAGS} -allow-unsupported-compiler -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH"
409+
CACHE STRING "Flags for NVCC" FORCE)
410+
message(WARNING "Using --allow-unsupported-compiler flag and -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH for nvcc<=12.4 with MSVC>=1940. "
411+
"Set $Env:NVCC_PREPEND_FLAGS='--allow-unsupported-compiler' if nvcc still fails.")
412+
endif()
406413
endif()
407414
if (CMAKE_CUDA_ARCHITECTURES)
408415
message(STATUS "Building with user-provided CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}")
@@ -498,6 +505,10 @@ if(WIN32)
498505
#
499506
# See: https://github.com/tensorflow/tensorflow/pull/10962
500507
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:/bigobj;/Ob2>")
508+
# MSBuild adds /Zc:inline by default, but it needs to be added explicitly for other generators (e.g. Ninja),
509+
# for Open3D to compile (the linker fails otherwise with a "fatal error LNK1189: library limit of 65535
510+
# objects exceeded"). /Zc:inline will remove unreferenced data and functions from object files.
511+
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:/Zc:inline>)
501512
endif()
502513
if (STATIC_WINDOWS_RUNTIME)
503514
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

cpp/benchmarks/t/geometry/PointCloud.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ void EstimateNormals(benchmark::State& state,
189189
const core::Device& device,
190190
const core::Dtype& dtype,
191191
const double voxel_size,
192-
const utility::optional<int> max_nn,
193-
const utility::optional<double> radius) {
192+
const std::optional<int> max_nn,
193+
const std::optional<double> radius) {
194194
t::geometry::PointCloud pcd;
195195
t::io::ReadPointCloud(path, pcd, {"auto", false, false, false});
196196

@@ -496,30 +496,30 @@ BENCHMARK_CAPTURE(EstimateNormals,
496496
core::Float32,
497497
0.02,
498498
30,
499-
utility::nullopt)
499+
std::nullopt)
500500
->Unit(benchmark::kMillisecond);
501501
BENCHMARK_CAPTURE(EstimateNormals,
502502
CPU F64 KNN[0.02 | 30],
503503
core::Device("CPU:0"),
504504
core::Float64,
505505
0.02,
506506
30,
507-
utility::nullopt)
507+
std::nullopt)
508508
->Unit(benchmark::kMillisecond);
509509
BENCHMARK_CAPTURE(EstimateNormals,
510510
CPU F32 Radius[0.02 | 0.06],
511511
core::Device("CPU:0"),
512512
core::Float32,
513513
0.02,
514-
utility::nullopt,
514+
std::nullopt,
515515
0.06)
516516
->Unit(benchmark::kMillisecond);
517517
BENCHMARK_CAPTURE(EstimateNormals,
518518
CPU F64 Radius[0.02 | 0.06],
519519
core::Device("CPU:0"),
520520
core::Float64,
521521
0.02,
522-
utility::nullopt,
522+
std::nullopt,
523523
0.06)
524524
->Unit(benchmark::kMillisecond);
525525
#ifdef BUILD_CUDA_MODULE
@@ -545,30 +545,30 @@ BENCHMARK_CAPTURE(EstimateNormals,
545545
core::Float32,
546546
0.02,
547547
30,
548-
utility::nullopt)
548+
std::nullopt)
549549
->Unit(benchmark::kMillisecond);
550550
BENCHMARK_CAPTURE(EstimateNormals,
551551
CUDA F64 KNN[0.02 | 30],
552552
core::Device("CUDA:0"),
553553
core::Float64,
554554
0.02,
555555
30,
556-
utility::nullopt)
556+
std::nullopt)
557557
->Unit(benchmark::kMillisecond);
558558
BENCHMARK_CAPTURE(EstimateNormals,
559559
CUDA F32 Radius[0.02 | 0.06],
560560
core::Device("CUDA:0"),
561561
core::Float32,
562562
0.02,
563-
utility::nullopt,
563+
std::nullopt,
564564
0.06)
565565
->Unit(benchmark::kMillisecond);
566566
BENCHMARK_CAPTURE(EstimateNormals,
567567
CUDA F64 Radius[0.02 | 0.06],
568568
core::Device("CUDA:0"),
569569
core::Float64,
570570
0.02,
571-
utility::nullopt,
571+
std::nullopt,
572572
0.06)
573573
->Unit(benchmark::kMillisecond);
574574
#endif

0 commit comments

Comments
 (0)