Skip to content

build failure with robin_map 1.4.0 #26

@emollier

Description

@emollier

Hi César,

As noted in Debian bug #1118378, veryfasttree fails to build with robin_map 1.4.0 with the following error:

/usr/bin/c++ -DCLI11_BOOST_OPTIONAL=0 -DNDEBUG -I/build/reproducible-path/veryfasttree-4.0.5+dfsg/libs/CLI11/include -I/build/reproducible-path/veryfasttree-4.0.5+dfsg/libs/bxzstr/include -g -O2 -ffile-prefix-map=/build/reproducible-path/veryfasttree-4.0.5+dfsg=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -O3 -DUSE_CUDA=0 -mavx512f -std=gnu++11 -fopenmp -MD -MT CMakeFiles/VeryFastTree.dir/src/impl/VeryFastTreeDoubleSSE128.cpp.o -MF CMakeFiles/VeryFastTree.dir/src/impl/VeryFastTreeDoubleSSE128.cpp.o.d -o CMakeFiles/VeryFastTree.dir/src/impl/VeryFastTreeDoubleSSE128.cpp.o -c /build/reproducible-path/veryfasttree-4.0.5+dfsg/src/impl/VeryFastTreeDoubleSSE128.cpp
In file included from /usr/include/tsl/robin_map.h:34,
                 from /build/reproducible-path/veryfasttree-4.0.5+dfsg/src/impl/../HashTable.h:7,
                 from /build/reproducible-path/veryfasttree-4.0.5+dfsg/src/impl/../VeyFastTreeImpl.h:13,
                 from /build/reproducible-path/veryfasttree-4.0.5+dfsg/src/impl/VeryFastTreeDouble.cpp:3:
/usr/include/tsl/robin_hash.h: In member function ‘tsl::detail_robin_hash::bucket_entry<ValueType, StoreHash>::value_type& tsl::detail_robin_hash::bucket_entry<ValueType, StoreHash>::value()’:
/usr/include/tsl/robin_hash.h:251:18: error: ‘launder’ is not a member of ‘std’ [-Wtemplate-body]
  251 |     return *std::launder(
      |                  ^~~~~~~
/usr/include/tsl/robin_hash.h:251:18: note: ‘std::launder’ is only available from C++17 onwards
/usr/include/tsl/robin_hash.h: In member function ‘const tsl::detail_robin_hash::bucket_entry<ValueType, StoreHash>::value_type& tsl::detail_robin_hash::bucket_entry<ValueType, StoreHash>::value() const’:
/usr/include/tsl/robin_hash.h:257:18: error: ‘launder’ is not a member of ‘std’ [-Wtemplate-body]
  257 |     return *std::launder(
      |                  ^~~~~~~
/usr/include/tsl/robin_hash.h:257:18: note: ‘std::launder’ is only available from C++17 onwards
/usr/include/tsl/robin_hash.h: In member function ‘void tsl::detail_robin_hash::robin_hash<ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy>::min_load_factor(float)’:
/usr/include/tsl/robin_hash.h:1020:30: error: ‘clamp’ is not a member of ‘std’ [-Wtemplate-body]
 1020 |     m_min_load_factor = std::clamp(ml, float(MINIMUM_MIN_LOAD_FACTOR),
      |                              ^~~~~
/usr/include/tsl/robin_hash.h: In member function ‘void tsl::detail_robin_hash::robin_hash<ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy>::max_load_factor(float)’:
/usr/include/tsl/robin_hash.h:1025:30: error: ‘clamp’ is not a member of ‘std’ [-Wtemplate-body]
 1025 |     m_max_load_factor = std::clamp(ml, float(MINIMUM_MAX_LOAD_FACTOR),
      |                              ^~~~~

On quick analysis, this looks to be caused by robin_map's usage of capabilities introduced in standard C++ 2017, but veryfasttree encodes instructions in the CMakeLists.txt to stick to C++ 2011. See the reference documentation:

I considered the option of uploading a modified veryfasttree with the below patch to address the release critical bug, but I thought that a bump of C++ version might have other implications, in which case you want to be aware of such change:

--- veryfasttree.orig/CMakeLists.txt
+++ veryfasttree/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.5...3.27)
 project(VeryFastTree)
 
-set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD 17)
 
 option(USE_SHARED "enable/disable linking of system shared libraries" OFF)
 option(USE_NATIVE "enable/disable system's processor architecture optimization (linux)" ON)

This does not directly impact your tree upstream, given that you vendor the robin_map along your libs/, which is why I have not pushed a merge request, but that should be useful to be aware of, when you will wish to bump your local copy of the library.

Have a nice day, :)
Étienne.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions