Skip to content

Commit 7632f3e

Browse files
Davide Faconticlaude
andcommitted
fix(cmake): vendor ankerl::unordered_dense to fix ROS buildfarm
ROS buildfarm sets FETCHCONTENT_FULLY_DISCONNECTED=ON, so the prior CPMAddPackage(unordered_dense) silently no-op'd and left unordered_dense::unordered_dense undefined, breaking all four ROS2 distro builds on PR #100. unordered_dense is a single-header library with exactly one consumer (applyVizLossyPreprocessing in ros_msg_utils.cpp), and Ubuntu 22.04 (humble) has no apt package, so vendoring is the most reliable fix and matches the existing pattern under cloudini_lib/include/cloudini_lib/contrib/ (span.hpp, nanocdr.hpp). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e3a06b4 commit 7632f3e

4 files changed

Lines changed: 2323 additions & 14 deletions

File tree

cloudini_lib/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ find_or_download_zstd(${CLOUDINI_FORCE_VENDORED_DEPS})
3737
include(cmake/find_or_download_lz4.cmake)
3838
find_or_download_lz4(${CLOUDINI_FORCE_VENDORED_DEPS})
3939

40-
# ankerl::unordered_dense — single-header MIT, used by ros_msg_utils.cpp's
41-
# applyVizLossyPreprocessing for fast voxel-dedup hash set.
42-
find_package(unordered_dense QUIET)
43-
if(NOT TARGET unordered_dense::unordered_dense)
44-
CPMAddPackage(
45-
NAME unordered_dense
46-
GITHUB_REPOSITORY martinus/unordered_dense
47-
VERSION 4.8.1
48-
)
49-
endif()
50-
51-
5240
##################################################################################
5341

5442
# ---- Trick to pass an absolute path to C++ code ----
@@ -130,7 +118,6 @@ target_link_libraries(cloudini_lib
130118
PRIVATE
131119
$<BUILD_INTERFACE:LZ4::lz4_static>
132120
$<BUILD_INTERFACE:${CLOUDINI_ZSTD_TARGET}>
133-
$<BUILD_INTERFACE:unordered_dense::unordered_dense>
134121
PUBLIC
135122
${PCL_COMMON_LIBRARIES}
136123
${PCL_IO_LIBRARIES}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
///////////////////////// ankerl::unordered_dense::{map, set} /////////////////////////
2+
3+
// A fast & densely stored hashmap and hashset based on robin-hood backward shift deletion.
4+
// Version 4.8.1
5+
// https://github.com/martinus/unordered_dense
6+
//
7+
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
8+
// SPDX-License-Identifier: MIT
9+
// Copyright (c) 2022 Martin Leitner-Ankerl <martin.ankerl@gmail.com>
10+
//
11+
// Permission is hereby granted, free of charge, to any person obtaining a copy
12+
// of this software and associated documentation files (the "Software"), to deal
13+
// in the Software without restriction, including without limitation the rights
14+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15+
// copies of the Software, and to permit persons to whom the Software is
16+
// furnished to do so, subject to the following conditions:
17+
//
18+
// The above copyright notice and this permission notice shall be included in all
19+
// copies or substantial portions of the Software.
20+
//
21+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27+
// SOFTWARE.
28+
29+
#ifndef ANKERL_STL_H
30+
#define ANKERL_STL_H
31+
32+
#include <array> // for array
33+
#include <cstdint> // for uint64_t, uint32_t, std::uint8_t, UINT64_C
34+
#include <cstring> // for size_t, memcpy, memset
35+
#include <functional> // for equal_to, hash
36+
#include <initializer_list> // for initializer_list
37+
#include <iterator> // for pair, distance
38+
#include <limits> // for numeric_limits
39+
#include <memory> // for allocator, allocator_traits, shared_ptr
40+
#include <optional> // for optional
41+
#include <stdexcept> // for out_of_range
42+
#include <string> // for basic_string
43+
#include <string_view> // for basic_string_view, hash
44+
#include <tuple> // for forward_as_tuple
45+
#include <type_traits> // for enable_if_t, declval, conditional_t, ena...
46+
#include <utility> // for forward, exchange, pair, as_const, piece...
47+
#include <vector> // for vector
48+
49+
// <memory_resource> includes <mutex>, which fails to compile if
50+
// targeting GCC >= 13 with the (rewritten) win32 thread model, and
51+
// targeting Windows earlier than Vista (0x600). GCC predefines
52+
// _REENTRANT when using the 'posix' model, and doesn't when using the
53+
// 'win32' model.
54+
#if defined __MINGW64__ && defined __GNUC__ && __GNUC__ >= 13 && !defined _REENTRANT
55+
// _WIN32_WINNT is guaranteed to be defined here because of the
56+
// <cstdint> inclusion above.
57+
# ifndef _WIN32_WINNT
58+
# error "_WIN32_WINNT not defined"
59+
# endif
60+
# if _WIN32_WINNT < 0x600
61+
# define ANKERL_MEMORY_RESOURCE_IS_BAD() 1 // NOLINT(cppcoreguidelines-macro-usage)
62+
# endif
63+
#endif
64+
#ifndef ANKERL_MEMORY_RESOURCE_IS_BAD
65+
# define ANKERL_MEMORY_RESOURCE_IS_BAD() 0 // NOLINT(cppcoreguidelines-macro-usage)
66+
#endif
67+
68+
#if defined(__has_include) && !defined(ANKERL_UNORDERED_DENSE_DISABLE_PMR)
69+
# if __has_include(<memory_resource>) && !ANKERL_MEMORY_RESOURCE_IS_BAD()
70+
# define ANKERL_UNORDERED_DENSE_PMR std::pmr // NOLINT(cppcoreguidelines-macro-usage)
71+
# include <memory_resource> // for polymorphic_allocator
72+
# elif __has_include(<experimental/memory_resource>)
73+
# define ANKERL_UNORDERED_DENSE_PMR std::experimental::pmr // NOLINT(cppcoreguidelines-macro-usage)
74+
# include <experimental/memory_resource> // for polymorphic_allocator
75+
# endif
76+
#endif
77+
78+
#if defined(_MSC_VER) && defined(_M_X64)
79+
# include <intrin.h>
80+
# pragma intrinsic(_umul128)
81+
#endif
82+
83+
#endif

0 commit comments

Comments
 (0)