Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Support python 312

Open swheaton opened this issue 1 year ago • 19 comments

Type

  • [x] Bug fix (non-breaking change which fixes an issue): Fixes #6433
  • [ ] New feature (non-breaking change which adds functionality). Resolves #
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

Motivation and Context

Closes #6433 Add support for python 3.12

Checklist:

  • [x] I have run python util/check_style.py --apply to apply Open3D code style to my code.
  • [ ] This PR changes Open3D behavior or adds new functionality.
    • [ ] Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is updated accordingly.
    • [ ] I have added or updated C++ and / or Python unit tests OR included test results (e.g. screenshots or numbers) here.
  • [x] I will follow up and update the code if CI fails.
  • [x] For fork PRs, I have selected Allow edits from maintainers.

Description

  • Follows template of https://github.com/isl-org/Open3D/pull/6288 to add python3.12 support

swheaton avatar Mar 25 '24 13:03 swheaton

Here is the start of my PR - although the checks do not pass, just opening it up for initial comment.

The current issue I'm seeing in CI is that I don't think there is a single version of scipy for requirements_test.txt that works with both python 3.12 and 3.8 -- current 1.10.1 requires Python <3.12, >=3.8, while the next release 1.11.1 requires Python <3.13, >=3.9.

Python 3.8 goes EOL in October of this year.

Here's a few options I see:

  • (don't recommend) Remove python 3.8 support despite it not being EOL for several more months
  • Wait to support python 3.12 (hold this PR) until 3.8 becomes EOL
  • (don't recommend) Don't pin packages for tests
  • Have 2 sets of test requirements: requirements_test_py312.txt that is used for python 3.12 instead of requirements_test.txt

I'm sure there may be other compatibility issues with packages but the CI just hasn't gotten far enough to see them yet. @ssheorey

swheaton avatar Mar 25 '24 13:03 swheaton

Here is the start of my PR - although the checks do not pass, just opening it up for initial comment.

The current issue I'm seeing in CI is that I don't think there is a single version of scipy for requirements_test.txt that works with both python 3.12 and 3.8 -- current 1.10.1 requires Python <3.12, >=3.8, while the next release 1.11.1 requires Python <3.13, >=3.9.

Python 3.8 goes EOL in October of this year.

Here's a few options I see:

* (don't recommend) Remove python 3.8 support despite it not being EOL for several more months

* Wait to support python 3.12 (hold this PR) until 3.8 becomes EOL

* (don't recommend) Don't pin packages for tests

* Have 2 sets of test requirements: `requirements_test_py312.txt` that is used for python 3.12 instead of `requirements_test.txt`

I'm sure there may be other compatibility issues with packages but the CI just hasn't gotten far enough to see them yet. @ssheorey

Hi @swheaton thanks for contributing Python 3.12 support! See the requirements.txt file format docs for specifying different package versions based on different Python versions:

https://pip.pypa.io/en/stable/reference/requirements-file-format/

ssheorey avatar Mar 25 '24 15:03 ssheorey

Hi @swheaton thanks for contributing Python 3.12 support! See the requirements.txt file format docs for specifying different package versions based on different Python versions:

https://pip.pypa.io/en/stable/reference/requirements-file-format/

Ah thanks, learned something today!

swheaton avatar Mar 25 '24 15:03 swheaton

It goes further but looks like there are some C API changes in 3.12 that affect open3d. Googling around, this appears to be a common issue with python 3.12. https://github.com/swheaton/Open3D/actions/runs/8423001029/job/23063629915#step:4:3856

This seems like a related S/O post (with no answer), since python/pyproject.toml also has jupyter related requirements in nit.

Seems related to https://github.com/cython/cython/issues/5238, but I'm not sure what dependency to bump to get any available fixes there

swheaton avatar Mar 25 '24 19:03 swheaton

TensorFlow updated to v2.16.1 PyTorch updated to v2.2.0 CUDA updated to 11.8

ssheorey avatar Mar 25 '24 23:03 ssheorey

Note to self, also need to update open3d-ml repo, similar to https://github.com/isl-org/Open3D-ML/pull/619 Since this repo always checks out the ML repo's main branch, I'm not sure the order these things are supposed to happen.

swheaton avatar Mar 27 '24 02:03 swheaton

Thanks for working on this! Python 3.12 support requests for Open3D will likely increase once Ubuntu 24.04 LTS is released on April 25 (in two weeks).

This is because Ubuntu 24.04 ships with Python 3.12 installed by default

  • https://launchpad.net/ubuntu/noble/+source/python3.12

johnthagen avatar Apr 10 '24 11:04 johnthagen

Hi, my engineering team is moving all our projects to Python 3.12 and Open3D is one of the projects that isn't supported by Python 3.12 yet. I am wondering if support for 3.12 will come soon, or should we consider going down 1 version and use Python 3.11 instead. Thanks!

jtkbong avatar Jun 05 '24 22:06 jtkbong

Will support for 3.12 have to wait until the 0.19 release or will 3.12 support be available for 0.18 once this PR is completed?

jweaston avatar Jun 17 '24 21:06 jweaston

@jweaston Very likely 3.12 support will only be for the 0.19 release and not back ported to 0.18.

This is based on observing how new Python support has been added past and is also much less work for those maintaining Open3D.

johnthagen avatar Jul 01 '24 11:07 johnthagen

@johnthagen thank you for the updates- is there an estimate for when 0.19 might drop? It would help people plan their upgrade paths for Ubuntu 24.04.

apockill avatar Jul 01 '24 18:07 apockill

@apockill I am only an occasional contributor to Open3D. @ssheorey would know more about release plans, but you can track the issues the team has assigned to the 0.19 milestone here: https://github.com/isl-org/Open3D/milestone/14

johnthagen avatar Jul 01 '24 18:07 johnthagen

Hi @benjaminum can you take a look at the python ml_ops test failures: They are mostly like this:

../python/test/ml_ops/test_cconv.py:103: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../python/test/ml_ops/mltest.py:95: in run_op
    ans = fn(*args, **kwargs)
../../../../../.pyenv/versions/3.12.2/envs/o3d-312/lib/python3.12/site-packages/keras/src/utils/traceback_utils.py:122: in error_handler
    raise e.with_traceback(filtered_tb) from None
../../../../../.pyenv/versions/3.12.2/envs/o3d-312/lib/python3.12/site-packages/open3d/ml/tf/python/layers/neighbor_search.py:131: in call
    table = ops.build_spatial_hash_table(
../../../../../.pyenv/versions/3.12.2/envs/o3d-312/lib/python3.12/site-packages/open3d/ml/tf/python/ops/ops.py:183: in build_spatial_hash_table
    return _lib.open3d_build_spatial_hash_table(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

points = <tf.Tensor: shape=(231, 3), dtype=float32, numpy=
array([[0.        , 0.        , 0.        ],
       [0.        , 0. ...1.        ],
       [9.        , 1.8       , 2.        ],
       [9.        , 1.8       , 2.3333333 ]], dtype=float32)>
radius = <tf.Tensor: shape=(), dtype=float64, numpy=0.51>, points_row_splits = <tf.Tensor: shape=(2,), dtype=int64, numpy=array([  0, 231])>
hash_table_size_factor = 0.015625, max_hash_table_size = 33554432, name = None

>   ???
E   tensorflow.python.framework.errors_impl.InvalidArgumentError: Exception encountered when calling FixedRadiusSearch.call().
E   
E   cannot compute Open3DBuildSpatialHashTable as input #1(zero-based) was expected to be a float tensor but is a double tensor [Op:Open3DBuildSpatialHashTable] name: 
E   
E   Arguments received by FixedRadiusSearch.call():
E     • points=tf.Tensor(shape=(231, 3), dtype=float32)
E     • queries=tf.Tensor(shape=(5, 3), dtype=float32)
E     • radius=tf.Tensor(shape=(), dtype=float64)
E     • points_row_splits=None
E     • queries_row_splits=None
E     • hash_table_size_factor=0.015625
E     • hash_table=None

<string>:2239: InvalidArgumentError
________________ test_cconv_gradient[float32-filter_size2-5-3-False-True-False-True-False-ball_to_cube_volume_preserving-linear_border-ml0] ________________

ssheorey avatar Jul 16 '24 18:07 ssheorey

Yep, I need this one also.

jloveric avatar Aug 09 '24 21:08 jloveric

Thoughts on potentially merging this into a 0.18 support branch, and releasing a 0.18.1 with python 3.12 support? Looking at the Projects page it seems like it 0.19 is quite ambitious and might take many more months to complete and release.

apockill avatar Aug 12 '24 15:08 apockill

We can release v0.19 pretty soon after Python 3.12 support. Most of the other features / updates are close to done.

PS: You can help by resolving some of the CI errors here (they seem to be mainly about API changes in PyTorch / TensorFlow)

ssheorey avatar Aug 12 '24 21:08 ssheorey

Just a note for other people trying this branch to get Open3D on Ubuntu 24.04 and can not switch to Python3.11 (e.g. due to using ROS 2 Jazzy): The current compiler version that is shipped with Ubuntu 24.04 will result in this error in tbb build/tbb/src/ext_tbb/include/tbb/task.h:300:20: error: declaration of ‘tbb::task& tbb::internal::task_prefix::task()’ changes meaning of ‘task’ You can get around it by using an older version. To do this first install the older version sudo apt install g++-11 gcc-11 And then add this to the CMakeLists.txt

set(CMAKE_C_COMPILER "gcc-11")
set(CMAKE_CXX_COMPILER "g++-11")

Then follow the normal build instructions (https://www.open3d.org/docs/latest/compilation.html).

I know this is not the perfect way to do it, but a good workaround for people that quickly need to get this running on their machine. The problem also seems to be related to this issue https://github.com/isl-org/Open3D/issues/6140

SammyRamone avatar Aug 21 '24 07:08 SammyRamone

Hi @SammyRamone the recent merged PR #6809 should have fixed the TBB error. We just updated this branch with main. Can you please check again? [Starting with a clean build folder may help].

ssheorey avatar Aug 21 '24 23:08 ssheorey

It does resolve the mentioned tbb error. However, building still fails with the following error:

[ 73%] Built target visualization
[ 73%] Building CXX object cpp/open3d/core/CMakeFiles/core.dir/nns/NanoFlannIndex.cpp.o
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/c++allocator.h:33,
                 from /usr/include/c++/13/bits/allocator.h:46,
                 from /usr/include/c++/13/vector:63,
                 from /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannIndex.h:10,
                 from /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannIndex.cpp:8:
In member function ‘void std::__new_allocator<_Tp>::deallocate(_Tp*, size_type) [with _Tp = float]’,
    inlined from ‘static void std::allocator_traits<std::allocator<_Tp1> >::deallocate(allocator_type&, pointer, size_type) [with _Tp = float]’ at /usr/include/c++/13/bits/alloc_traits.h:517:23,
    inlined from ‘void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:390:19,
    inlined from ‘std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:369:15,
    inlined from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:738:7,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_KnnSearchCPU<float, int, open3d::core::nns::NeighborSearchAllocator<float, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const float*, size_t, const float*, size_t, int, bool, bool, open3d::core::nns::NeighborSearchAllocator<float, int>&)::<lambda(const float*, const float*, size_t)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:126:5,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_RadiusSearchCPU<float, int, open3d::core::nns::NeighborSearchAllocator<float, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const float*, size_t, const float*, size_t, const float*, bool, bool, bool, bool, open3d::core::nns::NeighborSearchAllocator<float, int>&)::<lambda(const tbb::detail::d1::blocked_range<long unsigned int>&)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:258:41:
/usr/include/c++/13/bits/new_allocator.h:172:33: error: ‘void operator delete(void*, std::size_t)’ called on pointer ‘<unknown>’ with nonzero offset [4, 9223372036854775804] [-Werror=free-nonheap-object]
  172 |         _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n));
      |                                 ^
In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = float]’,
    inlined from ‘static _Tp* std::allocator_traits<std::allocator<_Tp1> >::allocate(allocator_type&, size_type) [with _Tp = float]’ at /usr/include/c++/13/bits/alloc_traits.h:482:28,
    inlined from ‘std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:381:33,
    inlined from ‘void std::vector<_Tp, _Alloc>::_M_range_initialize(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const float*; _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:1692:25,
    inlined from ‘std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = const float*; <template-parameter-2-2> = void; _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:711:23,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_KnnSearchCPU<float, int, open3d::core::nns::NeighborSearchAllocator<float, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const float*, size_t, const float*, size_t, int, bool, bool, open3d::core::nns::NeighborSearchAllocator<float, int>&)::<lambda(const float*, const float*, size_t)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:123:24,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_RadiusSearchCPU<float, int, open3d::core::nns::NeighborSearchAllocator<float, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const float*, size_t, const float*, size_t, const float*, bool, bool, bool, bool, open3d::core::nns::NeighborSearchAllocator<float, int>&)::<lambda(const tbb::detail::d1::blocked_range<long unsigned int>&)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:258:41:
/usr/include/c++/13/bits/new_allocator.h:151:55: note: returned from ‘void* operator new(std::size_t)’
  151 |         return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
      |                                                       ^
In member function ‘void std::__new_allocator<_Tp>::deallocate(_Tp*, size_type) [with _Tp = float]’,
    inlined from ‘static void std::allocator_traits<std::allocator<_Tp1> >::deallocate(allocator_type&, pointer, size_type) [with _Tp = float]’ at /usr/include/c++/13/bits/alloc_traits.h:517:23,
    inlined from ‘void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:390:19,
    inlined from ‘std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:369:15,
    inlined from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:738:7,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_KnnSearchCPU<float, int, open3d::core::nns::NeighborSearchAllocator<float, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const float*, size_t, const float*, size_t, int, bool, bool, open3d::core::nns::NeighborSearchAllocator<float, int>&)::<lambda(const float*, const float*, size_t)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:126:5,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_RadiusSearchCPU<float, long int, open3d::core::nns::NeighborSearchAllocator<float, long int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const float*, size_t, const float*, size_t, const float*, bool, bool, bool, bool, open3d::core::nns::NeighborSearchAllocator<float, long int>&)::<lambda(const tbb::detail::d1::blocked_range<long unsigned int>&)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:258:41:
/usr/include/c++/13/bits/new_allocator.h:172:33: error: ‘void operator delete(void*, std::size_t)’ called on pointer ‘<unknown>’ with nonzero offset [4, 9223372036854775804] [-Werror=free-nonheap-object]
  172 |         _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n));
      |                                 ^
In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = float]’,
    inlined from ‘static _Tp* std::allocator_traits<std::allocator<_Tp1> >::allocate(allocator_type&, size_type) [with _Tp = float]’ at /usr/include/c++/13/bits/alloc_traits.h:482:28,
    inlined from ‘std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:381:33,
    inlined from ‘void std::vector<_Tp, _Alloc>::_M_range_initialize(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const float*; _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:1692:25,
    inlined from ‘std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = const float*; <template-parameter-2-2> = void; _Tp = float; _Alloc = std::allocator<float>]’ at /usr/include/c++/13/bits/stl_vector.h:711:23,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_KnnSearchCPU<float, int, open3d::core::nns::NeighborSearchAllocator<float, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const float*, size_t, const float*, size_t, int, bool, bool, open3d::core::nns::NeighborSearchAllocator<float, int>&)::<lambda(const float*, const float*, size_t)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:123:24,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_RadiusSearchCPU<float, long int, open3d::core::nns::NeighborSearchAllocator<float, long int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const float*, size_t, const float*, size_t, const float*, bool, bool, bool, bool, open3d::core::nns::NeighborSearchAllocator<float, long int>&)::<lambda(const tbb::detail::d1::blocked_range<long unsigned int>&)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:258:41:
/usr/include/c++/13/bits/new_allocator.h:151:55: note: returned from ‘void* operator new(std::size_t)’
  151 |         return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
      |                                                       ^
In member function ‘void std::__new_allocator<_Tp>::deallocate(_Tp*, size_type) [with _Tp = double]’,
    inlined from ‘static void std::allocator_traits<std::allocator<_Tp1> >::deallocate(allocator_type&, pointer, size_type) [with _Tp = double]’ at /usr/include/c++/13/bits/alloc_traits.h:517:23,
    inlined from ‘void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:390:19,
    inlined from ‘std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:369:15,
    inlined from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:738:7,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_KnnSearchCPU<double, int, open3d::core::nns::NeighborSearchAllocator<double, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const double*, size_t, const double*, size_t, int, bool, bool, open3d::core::nns::NeighborSearchAllocator<double, int>&)::<lambda(const double*, const double*, size_t)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:126:5,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_RadiusSearchCPU<double, int, open3d::core::nns::NeighborSearchAllocator<double, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const double*, size_t, const double*, size_t, const double*, bool, bool, bool, bool, open3d::core::nns::NeighborSearchAllocator<double, int>&)::<lambda(const tbb::detail::d1::blocked_range<long unsigned int>&)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:258:41:
/usr/include/c++/13/bits/new_allocator.h:172:33: error: ‘void operator delete(void*, std::size_t)’ called on pointer ‘<unknown>’ with nonzero offset [8, 9223372036854775800] [-Werror=free-nonheap-object]
  172 |         _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n));
      |                                 ^
In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = double]’,
    inlined from ‘static _Tp* std::allocator_traits<std::allocator<_Tp1> >::allocate(allocator_type&, size_type) [with _Tp = double]’ at /usr/include/c++/13/bits/alloc_traits.h:482:28,
    inlined from ‘std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:381:33,
    inlined from ‘void std::vector<_Tp, _Alloc>::_M_range_initialize(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const double*; _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:1692:25,
    inlined from ‘std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = const double*; <template-parameter-2-2> = void; _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:711:23,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_KnnSearchCPU<double, int, open3d::core::nns::NeighborSearchAllocator<double, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const double*, size_t, const double*, size_t, int, bool, bool, open3d::core::nns::NeighborSearchAllocator<double, int>&)::<lambda(const double*, const double*, size_t)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:123:24,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_RadiusSearchCPU<double, int, open3d::core::nns::NeighborSearchAllocator<double, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const double*, size_t, const double*, size_t, const double*, bool, bool, bool, bool, open3d::core::nns::NeighborSearchAllocator<double, int>&)::<lambda(const tbb::detail::d1::blocked_range<long unsigned int>&)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:258:41:
/usr/include/c++/13/bits/new_allocator.h:151:55: note: returned from ‘void* operator new(std::size_t)’
  151 |         return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
      |                                                       ^
In member function ‘void std::__new_allocator<_Tp>::deallocate(_Tp*, size_type) [with _Tp = double]’,
    inlined from ‘static void std::allocator_traits<std::allocator<_Tp1> >::deallocate(allocator_type&, pointer, size_type) [with _Tp = double]’ at /usr/include/c++/13/bits/alloc_traits.h:517:23,
    inlined from ‘void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:390:19,
    inlined from ‘std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:369:15,
    inlined from ‘std::vector<_Tp, _Alloc>::~vector() [with _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:738:7,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_KnnSearchCPU<double, int, open3d::core::nns::NeighborSearchAllocator<double, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const double*, size_t, const double*, size_t, int, bool, bool, open3d::core::nns::NeighborSearchAllocator<double, int>&)::<lambda(const double*, const double*, size_t)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:126:5,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_RadiusSearchCPU<double, long int, open3d::core::nns::NeighborSearchAllocator<double, long int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const double*, size_t, const double*, size_t, const double*, bool, bool, bool, bool, open3d::core::nns::NeighborSearchAllocator<double, long int>&)::<lambda(const tbb::detail::d1::blocked_range<long unsigned int>&)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:258:41:
/usr/include/c++/13/bits/new_allocator.h:172:33: error: ‘void operator delete(void*, std::size_t)’ called on pointer ‘<unknown>’ with nonzero offset [8, 9223372036854775800] [-Werror=free-nonheap-object]
  172 |         _GLIBCXX_OPERATOR_DELETE(_GLIBCXX_SIZED_DEALLOC(__p, __n));
      |                                 ^
In member function ‘_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = double]’,
    inlined from ‘static _Tp* std::allocator_traits<std::allocator<_Tp1> >::allocate(allocator_type&, size_type) [with _Tp = double]’ at /usr/include/c++/13/bits/alloc_traits.h:482:28,
    inlined from ‘std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:381:33,
    inlined from ‘void std::vector<_Tp, _Alloc>::_M_range_initialize(_ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const double*; _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:1692:25,
    inlined from ‘std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = const double*; <template-parameter-2-2> = void; _Tp = double; _Alloc = std::allocator<double>]’ at /usr/include/c++/13/bits/stl_vector.h:711:23,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_KnnSearchCPU<double, int, open3d::core::nns::NeighborSearchAllocator<double, int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const double*, size_t, const double*, size_t, int, bool, bool, open3d::core::nns::NeighborSearchAllocator<double, int>&)::<lambda(const double*, const double*, size_t)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:123:24,
    inlined from ‘open3d::core::nns::impl::{anonymous}::_RadiusSearchCPU<double, long int, open3d::core::nns::NeighborSearchAllocator<double, long int>, 1>(open3d::core::nns::NanoFlannIndexHolderBase*, int64_t*, size_t, const double*, size_t, const double*, size_t, const double*, bool, bool, bool, bool, open3d::core::nns::NeighborSearchAllocator<double, long int>&)::<lambda(const tbb::detail::d1::blocked_range<long unsigned int>&)>’ at /home/best_mr/open3d/Open3D/cpp/open3d/core/nns/NanoFlannImpl.h:258:41:
/usr/include/c++/13/bits/new_allocator.h:151:55: note: returned from ‘void* operator new(std::size_t)’
  151 |         return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
      |                                                       ^
cc1plus: all warnings being treated as errors
make[2]: *** [cpp/open3d/core/CMakeFiles/core.dir/build.make:1116: cpp/open3d/core/CMakeFiles/core.dir/nns/NanoFlannIndex.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2301: cpp/open3d/core/CMakeFiles/core.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I used a basically completly fresh Ubuntu 24.04 (+clean build folder) this branch on the most recent commit and the normal build instructions.

SammyRamone avatar Aug 22 '24 08:08 SammyRamone

looking forward to open3d being available in 3.12

dyollb avatar Sep 16 '24 07:09 dyollb

[Needs minor cleanup before merge]

ssheorey avatar Oct 04 '24 06:10 ssheorey

Needs corresponding update to Python 3.12 in Open3D-ML for some CI checks (macOS Python test) to pass. https://github.com/isl-org/Open3D-ML/pull/657

ssheorey avatar Oct 04 '24 21:10 ssheorey

Thanks everyone, especially @swheaton @johnthagen for the help!

ssheorey avatar Oct 04 '24 21:10 ssheorey

Thanks for taking my PR to the finish line, apologies I wasn't able to finish it myself. Just glad we will have py312 support soon!

swheaton avatar Oct 21 '24 01:10 swheaton