yugabyte / cassandra-cpp-driver

YugabyteDB C++ Driver for YCQL, based on the DataStax Driver
https://docs.yugabyte.com/latest/develop/client-drivers/cpp/
Apache License 2.0
8 stars 11 forks source link

Installation Failing on Centos8 #16

Open WarrenN1 opened 1 year ago

WarrenN1 commented 1 year ago

The installation make for this is not working despite me following the process. I tried to do the following:

sudo yum install automake cmake gcc-c++ git libtool openssl-devel zlib-devel
sudo yum install https://downloads.datastax.com/cpp-driver/centos/8/dependencies/libuv/v1.35.0/libuv-1.35.0-1.el8.x86_64.rpm
sudo yum install https://downloads.datastax.com/cpp-driver/centos/8/dependencies/libuv/v1.35.0/libuv-devel-1.35.0-1.el8.x86_64.rpm
git clone https://github.com/yugabyte/cassandra-cpp-driver.git
cd cassandra-cpp-driver
mkdir build
pushd build
cmake ..
make
sudo make install
popd

And I got the following error upon make:

/home/warrenniles/Desktop/project/webserver/yugabyte/cql/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/project/webserver/yugabyte/cql/cassandra-cpp-driver/src/hash.hpp:20,
                 from /home/warrenniles/Desktop/project/webserver/yugabyte/cql/cassandra-cpp-driver/src/address.hpp:20,
                 from /home/warrenniles/Desktop/project/webserver/yugabyte/cql/cassandra-cpp-driver/src/serialization.hpp:20,
                 from /home/warrenniles/Desktop/project/webserver/yugabyte/cql/cassandra-cpp-driver/src/buffer.hpp:21,
                 from /home/warrenniles/Desktop/project/webserver/yugabyte/cql/cassandra-cpp-driver/src/request.hpp:20,
                 from /home/warrenniles/Desktop/project/webserver/yugabyte/cql/cassandra-cpp-driver/src/batch_request.hpp:23,
                 from /home/warrenniles/Desktop/project/webserver/yugabyte/cql/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

...
use 'new' and 'delete' instead [-Werror=class-memaccess]
   68 |     return static_cast<pointer>(realloc(p, n * sizeof(value_type)));

This is the only thing blocking progress for my startup right now and I need to be able to connect to yugabyte via c++ for my application.

jayant07-yb commented 1 year ago

CentOS 8 comes with GCC 8. The problem seems not to be with CentOS 8 but with the GCC 8+ version. The class-memaccess warning was added in GCC 8.