Commit Graph

326 Commits

Author SHA1 Message Date
Boris Ranto
1ade714910 cmake: Support grafana dashboard installation
We are currently hosting the grafana dashboards in our repo but we do
not install them. This patch adds the cmake support.

Signed-off-by: Boris Ranto <branto@redhat.com>
2018-10-25 17:09:02 +02:00
Kefu Chai
86af98f42d
Merge pull request #24692 from tchaikov/wip-cmake-with-asan
cmake: fixes to enable WITH_ASAN with clang and GCC

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2018-10-23 19:26:59 +08:00
Kefu Chai
b605210b97 cmake: pass Sanitizers flags to linker for linking .so
see
https://github.com/google/sanitizers/wiki/AddressSanitizer#using-addresssanitizer

to be specific,

> In order to use AddressSanitizer you will need to compile and link your
> program using `clang` with the `-fsanitize=address` switch.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-10-22 14:40:03 +08:00
Alan Somers
e31acf6567 blkdev: FreeBSD support
Signed-off-by: Alan Somers <asomers@gmail.com>
2018-10-19 19:37:42 +08:00
Marcin Juszkiewicz
ee3af68dd9 cmake: mark gcc 7 as minimum C++ compiler (due to std++17)
Ceph requires C++17 support from compiler. This means gcc 7.x being
minimal version supported.

This also allows to fail quick on Debian 'stretch' with it's gcc 6.3
compiler.

Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2018-10-16 16:34:03 +02:00
Kefu Chai
1fb419ca76 cmake: use OpenSSL::Crypto instead of OPENSSL_LIBRARIES
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-10-10 00:20:14 +08:00
Patrick Donnelly
5cdf9c3380
Merge PR #24020 into master
* refs/pull/24020/head:
	*: set missing CLOEXEC on opened fds
	msg: set O_NONBLOCK on file status flags

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
2018-09-25 09:20:22 -07:00
Sage Weil
c3f70dc4a8 common/ceph_mutex: ceph::{mutex,condition_variable,lock_guard}
If CEPH_DEBUG_MUTEX is defined, use the [recursive_]mutex_debug classes
that implement lockdep and a bucnh of other random debug checks.  Also
typedef ceph::condition_variable to std::condition_variable_debug, which
adds addition assertions and debug checks.

If CEPH_DEBUG_MUTEX is not defined, then use the bare-bones C++ std::mutex
primitives... or as close as we can get to them.

Since the [recursive_]mutex_debug classes take a string argument for the
lockdep piece, define factory functions ceph::make_[recursive_]mutex that
either pass arguments to the debug implementations or toss them out.

Signed-off-by: Sage Weil <sage@redhat.com>
2018-09-21 11:55:56 -05:00
Patrick Donnelly
86dbd9e755
*: set missing CLOEXEC on opened fds
Otherwise these descriptors may leak across execve() during e.g. MDS respawn.

Fixes: http://tracker.ceph.com/issues/35850

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2018-09-20 08:06:08 -07:00
Kefu Chai
07a3e8d7a6
Merge pull request #23650 from tchaikov/wip-dpdk-cmake
cmake: fix the build WITH_DPDK=ON

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2018-09-14 23:44:01 +08:00
Kefu Chai
195470a295 cmake: always add ${Boost_INCLUDE_DIRS} to include dirs
we need to -I${Boost_INCLUDE_DIRS} if WITH_SYSTEM_BOOST=ON and boost is
found by FindBoost.cmake.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-09-11 22:22:47 +08:00
Kefu Chai
a4c396d111 cmake: support multi-arch lib directory used along with BOOST_ROOT
by default, debian packaging creates ${prefix}/lib/x86_64-linux-gnu for
multi-arch support. but FindBoost.cmake does not check in such a
directory if $BOOST_ROOT is set. in this change, this directory is added
to the search path.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-09-11 22:22:47 +08:00
Kefu Chai
2c823a18cb cmake: pass DPDK_DIR explicitly
so we don't rely on build_dpdk() to be a macro to set variables in
its parent scope.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-09-05 17:33:59 +08:00
Willem Jan Withagen
39d831f95d core: make pthread_get_name_np work when available
FreeBSD will have a pthread_get_name_np() in libpthread
Code for that was submitted

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2018-08-19 12:07:56 +02:00
Kefu Chai
65f6a3c564 cmake: honour CMAKE_REQUIRED_LIBRARIES in CheckIncludeFiles
to silence cmake warning regarding to CMP0075

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-08-17 14:08:57 +08:00
Kefu Chai
e2e6a77b38
Merge pull request #23510 from tchaikov/wip-cmake-boost-build
cmake: fix build WITH_SYSTEM_BOOST=ON

Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
2018-08-13 21:42:10 +08:00
Kefu Chai
46c8b04a98 cmake: fix build WITH_SYSTEM_BOOST=ON
FindBoost.cmake from upstream cmake now finds python libraries like

find_package(Boost 1.67 python36)

and it export targets like Boost::python36

but we are still linking against Boost::python, so to be compatible
with FindBoost.cmake, we need to update BuildBoost.cmake and
mgr/CMakeLists.txt accordingly. in other words, to export
Boost::python36 and to link Boost::python36.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-08-09 18:57:04 +08:00
Kefu Chai
72cc4cedd4
Merge pull request #23441 from tchaikov/wip-cmake-rocksdb-cleanup
cmake: rocksdb related cleanup

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2018-08-09 00:46:53 +08:00
Sage Weil
3988351227 Merge PR #23432 into master
* refs/pull/23432/head:
	Revert "rocksdb: pickup change to link against libsnappy.a"
	cmake,make-dist: revert "build gperftools if WITH_STATIC_LIBSTDCXX"
	cmake: cleanup snappy related script
	debian: strip "-Wl,-Bsymbolic-functions" from LDFLAGS
2018-08-07 08:59:39 -05:00
Willem Jan Withagen
3b776457fe FreeBSD: update build script to current state
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2018-08-06 23:42:06 +02:00
Kefu Chai
c81f143411 cmake: add ALLOCATOR option
ALLOCATOR is in fact an option..

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-08-06 19:37:43 +08:00
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
4b09b2fbc4 cmake,make-dist: revert "build gperftools if WITH_STATIC_LIBSTDCXX"
as the higher version of libstdc++ is backward compatible with the lower
ones. so there is no need to statically link against C++ libraries. they
can always use the libstdc++ ships with the distro.

This reverts commit a6c73b6ac1

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-08-06 18:30:38 +08:00
Kefu Chai
a7326ee0f4 cmake: extract sanitizer detection out
also, we don't need to pass '-lasan' or '-ltsan' to linker. it's
suggested to use the "-fsanitize=${sanitizer}".

please note, this module is compatible with the one used in seastar on
purpose, as seastar is included in ceph using add_subdirectory(), and it
in turn add its own cmake modules directory using list(APPEND ...), so
cmake/modules/FindSantitizers.cmake is prefered over
src/seastar/cmake/FindSantitizers.cmake.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-08-02 14:43:47 +08:00
Kefu Chai
0912caefa9
Merge pull request #23300 from tchaikov/wip-cmake-cleanup
cmake: cleanups

Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
Reviewed-by: Casey Bodley <cbodley@redhat.com>
2018-08-02 10:14:09 +08:00
Kefu Chai
a6c73b6ac1 cmake,make-dist: build gperftools if WITH_STATIC_LIBSTDCXX
we could create a mini project to build a shared library, and use
try_compile() to test if the found gperftools is compiled with -fPIC.
but as we are targeting mostly xenial when enabling
WITH_STATIC_LIBSTDCXX, and google-perftools on xenial by default
is built without -fPIC. so let's keep it simple.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-29 21:25:52 +08:00
Kefu Chai
e6c7e0f521 cmake: extract std::filesystem linkage checking into module
see
https://libcxx.llvm.org/docs/UsingLibcxx.html#using-libc-experimental-and-experimental,

> Note that as of libc++ 7.0 using the <experimental/filesystem>
> requires linking libc++fs instead of libc++experimental.

do not build ceph_test_admin_socket_output if we are not able to find
the library for std::experimental::filesystem . it is a workaround of
https://reviews.freebsd.org/D10840 where FreeBSD 11.2 does not ship
libc++experimental.a .

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-29 20:25:32 +08:00
Kefu Chai
d245ffb0e6 cmake: fix "WITH_STATIC_LIBSTDCXX"
- do not link libkv with ALLOC_LIBS, it turns out that if we link
tcmalloc *before* -static-libstdc++ -static-libgcc, libstdc++ and gcc
libs will show up in `ldd` output
- add `-static-libstdc++ -static-libgcc` to CMAKE_SHARED_LINKER_FLAGS
and CMAKE_EXE_LINKER_FLAGS instead of adding them to all shared
libraries and executable. simpler this way.
- link against libtcmalloc statically, because libtcmalloc is a C++
library, linking against it dynamically and linking against C++ runtime
statically will pull in depdencies on two versions of C++ runtime, which
will bring down the app at run-time.
- do not pass '-pie' to linker when building executable if
`WITH_STATIC_LIBSTDCXX` and tcmalloc is used, because the static tcmalloc
is not compiled with PIC.
- only apply '-pie' if ENABLE_SHARED is enabled.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-29 01:44:18 +08:00
Kefu Chai
a92fee76f1 cmake: set HAVE_DPDK if it's available
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-28 16:53:10 +08:00
Kefu Chai
b21903eabf cmake: make heap_profiler a library target
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-26 15:16:48 +08:00
Kefu Chai
8db629a14b cmake: import allocator libraries in a better way
* instead expose the paths, it'd better to expose a library target.
* remove HAVE_LIBJEMALLOC, as it not used anywhere.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-26 15:16:48 +08:00
Kefu Chai
16976bd42a cmake: should link against libatomic if libcxx/libstdc++ does not offer atomic ops
for instance,  GCC-8 on riscv64 does not offer atomic ops like
__atomic_fetch_or_1, so we need to link against libatomic to get access
to these symbols.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-10 01:37:00 +08:00
Kefu Chai
34f1ee7897 cmake: remove workarounds for supporting cmake 2.x
and bump up the required cmake version to 3.5.1

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-07 01:24:02 +08:00
Kefu Chai
38d0e22685 cmake: consolidate WITH_{VERBS,RDMACM}
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-06-28 23:26:28 +08:00
Kefu Chai
572a740a03
Merge pull request #20297 from tanghaodong25/rdma-cm
msg/async/rdma: add iWARP RDMA protocol support

Reviewed-by: Haomai Wang <haomai@xsky.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-06-27 20:37:48 +08:00
haodong
f54e42f3a3 msg/async/rdma: cmake find_package for librdmacm
Signed-off-by: Haodong Tang <haodong.tang@intel.com>
2018-06-20 14:08:26 +08:00
Kefu Chai
54216f3c25 cmake: only build extra boost libraries only if WITH_SEASTAR
unit_test_framework is an alias of test, and Boost::test is only
necessary if seastar's tests are built. but SEASTAR_ENABLE_TESTS is
reset by us, so drop tests/unit_test_framework here.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-06-12 12:38:05 +08:00
Kefu Chai
7967416eea
Merge pull request #22454 from tchaikov/wip-seastar-denc
common: add adaptor for seastar::temporary_buffer

Reviewed-by: Sage Weil <sage@redhat.com>
2018-06-09 20:38:49 +08:00
Kefu Chai
8aac132dc4 cmake: update for accomodate seastar
* add unit_test_framework for appease seastar's find_package() call,
  even we don't build seastar's tests
* some seastar functions declare their return value like:
  const size_t str_len(...). and GCC does not like the "const" in it.
  so silence it

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-06-08 20:58:15 +08:00
Casey Bodley
37de3cad4d cmake: add WITH_SEASTAR option
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-06-08 20:58:15 +08:00
Kefu Chai
ca78ab2254 cmake: find liboath using the correct name
we should reference liboath by the $name in Find${name}.cmake, also the
$name should be consistent when calling find_package_handle_standard_args().
in this change
* rename Findliboath.cmake to FindOATH.cmake to be consistent with other
  find_package() moduless.
* use "OATH" in find_package_handle_standard_args() instead of "oath"
* set the interface properties for OATH::OATH, so the target linking
  against it can reference its header directories and libraries automatically.
* remove the stale comment for find_package_handle_standard_args()
* set OATH_INCLUDE_DIRS and OATH_LIBRARIES to follow the convention of
  find_package(), even they are not used directly in this project.

Reported-by: Erwan Velu <erwan@redhat.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-06-06 22:49:35 +08:00
Kefu Chai
4af37d4730 cmake: bump up the required boost version to 1.67
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-06-04 22:27:55 +08:00
Radoslaw Zarzynski
4860bb70e1 auth: CryptoAESKeyHandler switches from NSS to OpenSSL.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2018-05-18 10:48:32 -04:00
Dan Mick
39b2626c7a Remove embedded 'cephd' code
Signed-off-by: Dan Mick <dan.mick@redhat.com>
2018-05-11 13:10:26 -07:00
Sage Weil
6ae51aed13 Merge remote-tracking branch 'gh/mimic' 2018-05-10 12:18:29 -05:00
Kefu Chai
50a052d79e
Merge pull request #19714 from qwren/qatzip-compressor
compressor: add QAT support

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2018-05-04 09:17:17 +08:00
Jenkins Build Slave User
1f43eda5fd 13.1.0 2018-05-03 17:57:34 +00:00
Kefu Chai
791af5459e cmake: enable CMP0051
the new behavior of get_target_property(<var> <target> SOURCES) will be
enforced in future versions of cmake, so let ready for this change now
by removing the generator expressions from the returned source file
list.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-26 16:47:54 +08:00
Kefu Chai
4aea3bed7f cmake: enable CMP0046
so cmake will error on "non-existent dependency in add_dependencies", we
add dependency on CONFIGURE_FILE() output, which is wrong, as its output
is not a target, and is generated when cmake runs. so remove them from
dependencies.

regarding to ceph_ver.h, its path is also wrong. it is created under
${CMAKE_BINARY_DIR}/src/include. so this is another reason to remove it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-26 16:44:09 +08:00
Kefu Chai
750c301e1c cmake: use CMP0028 NEW
it's intended behavior to use imported or alias target for dependencies
with name with "::" in it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-18 15:10:54 +08:00