Since some of the GCC versions will throw warnings and cause the build to fail, which compiler should I use to compile the library?
Note for my use case I will still need to compile my own client code that will use this library with C++20, but I am wondering what GCC I should use to compile this driver with?
[warrenniles@localhost build]$ cmake ..
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 11.2.1
-- The CXX compiler identification is GNU 11.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/rh/gcc-toolset-11/root/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/rh/gcc-toolset-11/root/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Deprecation Warning at cmake/modules/CppDriver.cmake:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
CMakeLists.txt:10 (include)
CMake Deprecation Warning at cmake/modules/CppDriver.cmake:289 (cmake_policy):
The OLD behavior for policy CMP0042 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
CMakeLists.txt:13 (CassPolicies)
CMake Deprecation Warning at cmake/modules/CppDriver.cmake:294 (cmake_policy):
The OLD behavior for policy CMP0048 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
CMakeLists.txt:13 (CassPolicies)
-- PROJECT version: 2.9.0
-- Found Libuv: /usr/lib64/libuv.so
-- LIBUV version: 1.35.0
-- Found OpenSSL: /usr/lib64/libssl.so (found version "1.1.1k")
CMake Deprecation Warning at cmake/modules/CppDriver.cmake:690 (cmake_policy):
The OLD behavior for policy CMP0054 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
CMakeLists.txt:127 (CassSetCompilerFlags)
-- Using std::atomic implementation for atomic operations
CMake Deprecation Warning at src/third_party/sparsehash/CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- Checking to see if CXX compiler accepts flag -std=c++11
-- Checking to see if CXX compiler accepts flag -std=c++11 - yes
-- Using hash header <functional> and namespace "std"
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for memcpy
-- Looking for memcpy - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long long
-- Check size of long long - done
-- Check size of uint16_t
-- Check size of uint16_t - done
-- Check size of u_int16_t
-- Check size of u_int16_t - done
-- Check size of __uint16_t
-- Check size of __uint16_t - done
-- Looking for GRND_NONBLOCK
-- Looking for GRND_NONBLOCK - found
-- Looking for SO_NOSIGPIPE
-- Looking for SO_NOSIGPIPE - not found
-- Looking for sigtimedwait
-- Looking for sigtimedwait - found
-- Performing Test HAVE_BUILTIN_BSWAP32
-- Performing Test HAVE_BUILTIN_BSWAP32 - Success
-- Performing Test HAVE_BUILTIN_BSWAP64
-- Performing Test HAVE_BUILTIN_BSWAP64 - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/build
[warrenniles@localhost build]$ make
[ 1%] Building CXX object CMakeFiles/cassandra.dir/src/abstract_data.cpp.o
[ 2%] Building CXX object CMakeFiles/cassandra.dir/src/address.cpp.o
[ 3%] Building CXX object CMakeFiles/cassandra.dir/src/auth.cpp.o
[ 5%] Building CXX object CMakeFiles/cassandra.dir/src/auth_requests.cpp.o
[ 6%] Building CXX object CMakeFiles/cassandra.dir/src/auth_responses.cpp.o
[ 7%] Building CXX object CMakeFiles/cassandra.dir/src/batch_request.cpp.o
In file included from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/internal/densehashtable.h:101,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/dense_hash_set:108,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/address.hpp:22,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/serialization.hpp:20,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/buffer.hpp:21,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/request.hpp:20,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/batch_request.hpp:23,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/batch_request.cpp:17:
/home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/internal/libc_allocator_with_realloc.h: In instantiation of ‘T* sparsehash::libc_allocator_with_realloc<T>::reallocate(sparsehash::libc_allocator_with_realloc<T>::pointer, sparsehash::libc_allocator_with_realloc<T>::size_type) [with T = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >; sparsehash::libc_allocator_with_realloc<T>::pointer = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >*; sparsehash::libc_allocator_with_realloc<T>::size_type = long unsigned int]’:
/home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/internal/densehashtable.h:1202:40: required from ‘sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::alloc_impl<sparsehash::libc_allocator_with_realloc<U> >::pointer sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::alloc_impl<sparsehash::libc_allocator_with_realloc<U> >::realloc_or_die(sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::alloc_impl<sparsehash::libc_allocator_with_realloc<U> >::pointer, sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::alloc_impl<sparsehash::libc_allocator_with_realloc<U> >::size_type) [with A = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >; Value = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >; Key = std::__cxx11::basic_string<char>; HashFcn = std::hash<std::__cxx11::basic_string<char> >; ExtractKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SelectKey; SetKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SetKey; EqualKey = std::equal_to<std::__cxx11::basic_string<char> >; Alloc = sparsehash::libc_allocator_with_realloc<std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> > >; sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::alloc_impl<sparsehash::libc_allocator_with_realloc<U> >::pointer = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >*; sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::alloc_impl<sparsehash::libc_allocator_with_realloc<U> >::size_type = long unsigned int]’
/home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/internal/densehashtable.h:628:36: required from ‘void sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::resize_table(sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::size_type, sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::size_type, sparsehash::true_type) [with Value = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >; Key = std::__cxx11::basic_string<char>; HashFcn = std::hash<std::__cxx11::basic_string<char> >; ExtractKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SelectKey; SetKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SetKey; EqualKey = std::equal_to<std::__cxx11::basic_string<char> >; Alloc = sparsehash::libc_allocator_with_realloc<std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> > >; sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::size_type = long unsigned int; sparsehash::true_type = sparsehash::integral_constant<bool, true>]’
/home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/internal/densehashtable.h:785:21: required from ‘void sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::clear_to_size(sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::size_type) [with Value = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >; Key = std::__cxx11::basic_string<char>; HashFcn = std::hash<std::__cxx11::basic_string<char> >; ExtractKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SelectKey; SetKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SetKey; EqualKey = std::equal_to<std::__cxx11::basic_string<char> >; Alloc = sparsehash::libc_allocator_with_realloc<std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> > >; sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::size_type = long unsigned int]’
/home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/internal/densehashtable.h:638:5: required from ‘void sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::copy_from(const sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>&, sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::size_type) [with Value = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >; Key = std::__cxx11::basic_string<char>; HashFcn = std::hash<std::__cxx11::basic_string<char> >; ExtractKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SelectKey; SetKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SetKey; EqualKey = std::equal_to<std::__cxx11::basic_string<char> >; Alloc = sparsehash::libc_allocator_with_realloc<std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> > >; sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::size_type = long unsigned int]’
/home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/internal/densehashtable.h:729:5: required from ‘sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::dense_hashtable(const sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>&, sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::size_type) [with Value = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >; Key = std::__cxx11::basic_string<char>; HashFcn = std::hash<std::__cxx11::basic_string<char> >; ExtractKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SelectKey; SetKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SetKey; EqualKey = std::equal_to<std::__cxx11::basic_string<char> >; Alloc = sparsehash::libc_allocator_with_realloc<std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> > >; sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::size_type = long unsigned int]’
/home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/internal/densehashtable.h:620:21: required from ‘bool sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::resize_delta(sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::size_type) [with Value = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >; Key = std::__cxx11::basic_string<char>; HashFcn = std::hash<std::__cxx11::basic_string<char> >; ExtractKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SelectKey; SetKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SetKey; EqualKey = std::equal_to<std::__cxx11::basic_string<char> >; Alloc = sparsehash::libc_allocator_with_realloc<std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> > >; sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::size_type = long unsigned int]’
/home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/internal/densehashtable.h:998:16: required from ‘sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::value_type& sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::find_or_insert(const key_type&) [with DefaultValue = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::DefaultValue; Value = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >; Key = std::__cxx11::basic_string<char>; HashFcn = std::hash<std::__cxx11::basic_string<char> >; ExtractKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SelectKey; SetKey = sparsehash::dense_hash_map<std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >::SetKey; EqualKey = std::equal_to<std::__cxx11::basic_string<char> >; Alloc = sparsehash::libc_allocator_with_realloc<std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> > >; sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::value_type = std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >; sparsehash::dense_hashtable<Value, Key, HashFcn, ExtractKey, SetKey, EqualKey, Alloc>::key_type = std::__cxx11::basic_string<char>]’
/home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/dense_hash_map:264:53: required from ‘sparsehash::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::data_type& sparsehash::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::operator[](const key_type&) [with Key = std::__cxx11::basic_string<char>; T = cass::SharedRefPtr<const cass::PreparedMetadata::Entry>; HashFcn = std::hash<std::__cxx11::basic_string<char> >; EqualKey = std::equal_to<std::__cxx11::basic_string<char> >; Alloc = sparsehash::libc_allocator_with_realloc<std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> > >; sparsehash::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::data_type = cass::SharedRefPtr<const cass::PreparedMetadata::Entry>; sparsehash::dense_hash_map<Key, T, HashFcn, EqualKey, Alloc>::key_type = std::__cxx11::basic_string<char>]’
/home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/prepared.hpp:113:26: required from here
/home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/third_party/sparsehash/src/sparsehash/internal/libc_allocator_with_realloc.h:68:40: error: ‘void* realloc(void*, size_t)’ moving an object of non-trivially copyable type ‘struct std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >’; use ‘new’ and ‘delete’ instead [-Werror=class-memaccess]
68 | return static_cast<pointer>(realloc(p, n * sizeof(value_type)));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/rh/gcc-toolset-11/root/usr/include/c++/11/utility:70,
from /opt/rh/gcc-toolset-11/root/usr/include/c++/11/algorithm:60,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/hash.hpp:20,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/address.hpp:20,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/serialization.hpp:20,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/buffer.hpp:21,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/request.hpp:20,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/batch_request.hpp:23,
from /home/warrenniles/Desktop/project1/project1-webserver/external_libraries/src/cassandra-cpp-driver/src/batch_request.cpp:17:
/opt/rh/gcc-toolset-11/root/usr/include/c++/11/bits/stl_pair.h:211:12: note: ‘struct std::pair<const std::__cxx11::basic_string<char>, cass::SharedRefPtr<const cass::PreparedMetadata::Entry> >’ declared here
211 | struct pair
| ^~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/cassandra.dir/build.make:146: CMakeFiles/cassandra.dir/src/batch_request.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:127: CMakeFiles/cassandra.dir/all] Error 2
make: *** [Makefile:156: all] Error 2