Skip to content

unable to build due to error in concurrent hash map: "value_type of the container must be the same as its allocator's" #9

Description

@keyan3

First, thanks for contributing this awesome package. I just cloned the repository and was following the installation instructions for the python extension (./autobuild --install-python) when I ran into the following error. It seems that the instantiation of TBB's concurrent_hash_map that takes place in src/queue is faulty:

g++ -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot 
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 
-c src/dataset.cpp -o build/temp.macosx-11-x86_64-3.9/src/dataset.o -O3 -std=c++11 -I include -stdlib=libc++

In file included from src/dataset.cpp:1:
In file included from src/dataset.hpp:16:
In file included from /usr/local/include/tbb/concurrent_hash_map.h:17:
/usr/local/include/tbb/../oneapi/tbb/concurrent_hash_map.h:625:5: error: static_assert failed due to requirement 
'std::is_same<std::__1::pair<Message *const, bool>, std::__1::pair<Message *, bool>>::value'
"value_type of the container must be the same as its allocator's"

    static_assert(std::is_same<value_type, typename Allocator::value_type>::value,
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/queue.hpp:76:27: note: in instantiation of template class
'tbb::detail::d2::concurrent_hash_map<Message *, bool, MembershipKeyHashCompare, tbb::detail::d1::scalable_allocator<std::__1::pair<Message *, bool>>>' requested here
    membership_table_type membership;
                          ^

This is using clang 12.0.5 on a MacBook Pro. Here is the output of g++ --version for reference:

(base) keyan@MacBook-Pro-2 gosdt % g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions