Commit Graph

14 Commits

Author SHA1 Message Date
Kefu Chai
5a71bbbe59 cmake: refactor RocksDB related script
* rename Findrocksdb.cmake to FindRocksDB.cmake to match its name
* add RocksDB::RocksDB target to BuildRocksDB.cmake and
  FindRocksDB.cmake
* use RocksDB::RocksDB target instead of accessing its property
  directly, and do not link against its dependencies explicitly.
  let its INTERFACE_LINK_LIBRARIES do the job.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-08-06 19:37:43 +08:00
Kefu Chai
a61493062c cmake: link against libsnappy.a if WITH_STATIC_LIBSTDCXX
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-29 01:44:18 +08:00
Kefu Chai
265b6d179d cmake: disable -Werror-stringop-truncation for rocksdb
this option was introduced in GCC-8.1, and is enabled by default.
otherwise we will have:

src/rocksdb/util/status.cc:28:15: error: ‘char* strncpy(char*, const
char*, size_t)’ output truncated before terminating nul copying as many
bytes from a string as its length [-Werror=string
op-truncation]
   std::strncpy(result, state, cch - 1);
   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/var/ssd/ceph/src/rocksdb/util/status.cc:19:18: note: length computed
here
       std::strlen(state) + 1; // +1 for the null terminator
       ~~~~~~~~~~~^~~~~~~
cc1plus: all warnings being treated as errors

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-06-18 14:18:47 +08:00
Igor Fedotov
83841bf3de build/cmake: enable RTTI for both debug and release RocksDB builds.
Overwise ceph build in Release mode is failing.

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
2018-05-28 23:00:42 +03:00
Kefu Chai
71462ddf05 cmake/modules/BuildRocksDB.cmake: enable compressions for rocksdb
we should enable them if they are found.

currently, we don't have bzip2 compressor plugin, so it's not detected
in the cmake script. we can always enable it for rocksdb in future.

Fixes: http://tracker.ceph.com/issues/24025
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-05-23 23:59:41 +08:00
Kefu Chai
4d646ef579 cmake: do not check for aligned_alloc() anymore
this reverts 16f0a67d

Fixes: http://tracker.ceph.com/issues/23653
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-05-17 10:33:04 +08:00
Kefu Chai
3178bb9638 cmake: disable gflags support in rocksdb
to silence the warnings like

CMake Warning at CMakeLists.txt:73 (find_package):
  By not providing "Findgflags.cmake" in CMAKE_MODULE_PATH this project
has
  asked CMake to find a package configuration file provided by "gflags",
but
  CMake did not find one.

  Could not find a package configuration file provided by "gflags" with
any
  of the following names:

    gflagsConfig.cmake
    gflags-config.cmake

  Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set
  "gflags_DIR" to a directory containing one of the above files.  If
"gflags"
  provides a separate development package or SDK, be sure it has been
  installed.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-21 01:17:37 +08:00
Kefu Chai
6559a85051 cmake: disable FAIL_ON_WARNINGS for rocksdb
otherwise -Werror=implicit-fallthrough will fail the build with GCC-7

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-12-11 14:09:45 +08:00
Kefu Chai
70b5b4bfbf cmake: should check the availability of aligned_alloc() by running the test
this mimics the failure of rocksdb without a working
aligned_alloc()/free().

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-10-31 17:39:09 +08:00
Kefu Chai
16f0a67d83 cmake: check for aligned_alloc()
in case developer is using patched tcmalloc.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-10-27 11:13:15 +08:00
Kefu Chai
04697cdbdc cmake: update the error message for gperftools bug
it's a follow-up of #17788

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-09-22 10:40:29 +08:00
Kefu Chai
ff8d6a730b cmake: error out if rocksdb is incompatible w/ tcmalloc
the commit d406f228 in gperf implements a c11 feature used by a
recent change in rocksdb: 16e03882, which uses aligned_alloc().
and 16e03882 in rocksdb was merged after v5.7 was tagged, while
16e03882 in gperf was merged after v2.6.1 was tagged.

because aligned_alloc() is not implemented by tcmalloc until the
not-yet-released 2.6.2, if we call aligned_alloc() in an application
linked against tcmalloc, what gets called will be the glibc's
aligned_alloc(). but if we free() the memory chunk allocated by
aligned_alloc(), the tcmalloc's implementation kicks in, then
InvalidFree() is called, because the memory chunk being freed was
allocated by tcmalloc. in short, "mixing allocators", quote from
Dan Mick.

in rocksdb, aligned_alloc() is used if _ISOC11_SOURCE is defined, this
makes sense, because aligned_alloc() is a C11 function. we could avoid
using it by not defining _ISOC11_SOURCE. but as long as _GNU_SOURCE is
defined, glibc defines _ISOC11_SOURCE. and libstdc++ requires
_GNU_SOURCE, because it uses a fair amount of GNU extensions.

Fixes: http://tracker.ceph.com/issues/21422
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-09-20 10:23:16 +08:00
Kefu Chai
987c1b3ec2 cmake: detect rocksdb's version
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-09-19 13:46:50 +08:00
Kefu Chai
aa603621bd cmake: extract BuildRocksDB into BuildRocksDB.cmake
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-09-19 13:46:50 +08:00