Commit Graph

380 Commits

Author SHA1 Message Date
Adam C. Emerson
647819c632 cmake: Don't enable BOOST_USE_VALGRIND when not requested
We were adding the define without support in the library if
WITH_BOOST_VALGRIND was turned off.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2020-03-20 20:40:39 -04:00
Adam C. Emerson
7f573bb334 build: Add WITH_BOOST_VALGRIND option
To build Boost.Context (and other libraries) with support to allow
them to be valground usefully, and to include the define to link
against them.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2020-03-20 00:51:49 -04:00
Kefu Chai
aff9557a70
Merge pull request #33256 from tchaikov/wip-cmake-cares
cmake: should expose ${C-ARES_BINARY_DIR} from c-ares

Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2020-02-21 22:04:23 +08:00
Lucian Petrut
dbdc91db6c cmake: [win32] Fix rocksdb cross compiling
In order to be able to cross compile rocksdb using mingw, we'll
have to do the following:
* pass on specified toolchain files
* pass the CMAKE_PREFIX_PATH. We'll have to replace the ";" separator
  with something else (we went with "!"), otherwise CMake won't be
  able to properly handle the command arguments
* pass on the received LZ4 lib location since it cannot be properly
  detected when cross compiling.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2020-02-19 08:24:21 +00:00
Lucian Petrut
d15481f1a5 cmake: [win32] Update cmake files
We'll update the cmake files in order to be able to build ceph
components for Windows targets.

Cross compiling using MINGW is the easiest approach for now.
Subsequently, we'll add support for Clang and MSVC.

This patch provides the following changes:
* include winsock2.h, which provides ntohl on Windows
* avoid unsupported compiler flags when using msvc
* add a custom toolchain file for mingw
* update install command for ceph-common in order to work with mingw
* avoid running test sample when cross compiling
* link against the ws_32 lib
* set argeted Windows version
* skip yasm checks when targeting Windows
* allow multiple redefinitions when using mingw, picking the first one.
  this is a workaround for a mingw TLS bug:
  https://sourceforge.net/p/mingw-w64/bugs/816/

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2020-02-19 08:24:21 +00:00
Kefu Chai
12e738f5a1
Merge pull request #32693 from CongMinYin/update-pmdk-version
cmake: Update pmdk version to 1.7

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-02-13 19:24:05 +08:00
Yin Congmin
6a102677e7 cmake: Update pmdk version to 1.7
nvml is renamed to pmdk and upgrading to 1.7 to fix gcc9 build issue

Signed-off-by: Yin, Congmin <congmin.yin@intel.com>
2020-02-14 01:50:07 +08:00
Kefu Chai
01129acbf0 cmake: should expose ${C-ARES_BINARY_DIR} from c-ares
as it's public header `ares.h` includes `ares_build.h`, which is
generated in the build directory.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-02-13 17:51:45 +08:00
Ulrich Weigand
c58fc258a2 cmake: Improve test for 16-byte atomic support on IBM Z
Commit d1b9d14324 added a check for
16-byte atomics without library support on IBM Z.  Unfortunately
it turns out this test only works correctly when the test case
is built without optimization.  (This is normally true, but it
may not be the case when passing explicit CXXFLAGS to cmake.)

The underlying reason is that GCC may choose to use either an
inline implementation of the 16-byte atomics or library calls,
depending on whether or not it is able to prove the atomic
variable is properly aligned.  At -O0 it is never able to prove
that, but at higher optimization levels it depends on the complexity
of the expression (in particular, whether GCC can track down the
definition of the underlying object).

As the test case uses a very simple expression, it may happen that
this test can be built without requiring library support, but some
of the "real" uses of atomics in Ceph code cannot.   This defeats
the whole purpose of the test at configure time.

Fixed by making the access pattern in the test more complex, so
that the test fails even at high optimization levels.

Fixes: https://tracker.ceph.com/issues/43747

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2020-01-23 13:13:58 +01:00
Daniel Gryniewicz
0f4cb207bb CMake - Workaround set Boost_component_FOUND
BuildBoost.cmake (used when we're building the submodule) doesn't
provide parity with FindBoost.cmake (used with system Boost).
Specifically, it doesn't set the _FOUND variables for the various
components, making it hard to depend on finding those features.

Set Boost_<component>_FOUND for all the components we're building in
BuildBoost.cmake to make using these variables possible.

Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
2020-01-08 11:31:04 -05:00
Kefu Chai
e461bda6c9 cmake: build boost v1.72 instead of v1.67
so we can drop two patches which are already included by v1.72

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-24 01:22:07 +08:00
Kefu Chai
be192fba4a cmake: update FindBoost.cmake for 1.72
adapted from
https://github.com/Kitware/CMake/blob/master/Modules/FindBoost.cmake
commit e51232b739b3eeae642be8a7e89079f7c2e8c1b2

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-22 23:56:52 +08:00
Kotresh HR
886b18a9a2 cmake/Boost: Fix python3 version
Signed-off-by: Kotresh HR <khiremat@redhat.com>
2019-12-19 14:40:11 +05:30
Kefu Chai
46358e04d2 cmake: drop Find{Python,Python2}.cmake
since we are python3 only, there is no need to check Python2 anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-19 11:52:56 +08:00
Kefu Chai
79584862f6 src,qa: install python bindings into lib/cython_modules/lib.3
instead of checking for the WITH_PYTHON* options, just hardwire to lib.3

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-19 11:52:54 +08:00
Kefu Chai
5fc657b40d cmake: drop WITH_PYTHON2 option
* drop WITH_PYTHON2 option
* print warning message if WITH_PYTHON3 is disabled
* drop MGR_PYTHON_VERSION option, as we don't support use different
  python version for python binding and ceph-mgr embedded python
  interpreter anymore. as before switching to python3-only build,
  we can build python3 and python2 python bindings, and ceph-mgr
  can use either of them. but after switching to python3-only
  build, ceph-mgr has to use whatever python version used to
  build python binding.
* move WITH_PYTHON3 option to $top_srcdir/CMakeLists.txt, as ceph-mgr
  and python binding will share this option.
* hardware ${PYTHON_VERSION} to 3
* hardware ${Python${PYTHON_VERSION}_VERSION_MAJOR} to 3
* only build boost library with python3
* s/Python_EXECUTABLE/Python3_EXECUTABLE/
* update the build scripts and packagings accordingly
* rename all cython${PYTHON_VERSION}_* targets to cython_*
* update distutils_install_module() so it does not take python_version
  parameter anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-19 10:58:58 +08:00
Kefu Chai
47d0e1e16d cmake: CMAKE_ROLE defaults to "PROJECT"
so we can use exported targets like "Python3::Python", which is defined
only if CMAKE_ROLE is "PROJECT". but this global property was introduced
by CMake 3.14, but the minimum required version of CMake is 3.10.2 in
Ceph project at this moment. let's set it if it's not defined.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-19 10:58:58 +08:00
Kefu Chai
1f8e3bd5e7 cmake: check version of librdkafka
Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-15 22:16:08 +08:00
Kefu Chai
1c0bc5dad4 cmake: silence messages when cppcheck/IWYU is not found
* remove messages spit when these tools are not found
  they are not necessary for building Ceph. and the messages in the cmake
  output are distracting.
* fix a typo

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-10 11:08:02 +08:00
Kefu Chai
f5b2ec5d8f cmake: do not use CMP0093 unless it is supported
CMake CMP0093 was introduced by CMake 3.15, but we only require CMake
v3.10.2. so use the old `Boost_VERSION_MACRO` variable by default,
unless specified otherwise.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-03 20:00:59 +08:00
Kefu Chai
dd0cdb3eb6 cmake: do not use CMP0074 unless it is supported
CMake CMP0074 was introduced by CMake 3.12, but we only require CMake
v3.10.2. so default to check `Boost_ROOT` unless specified otherwise.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-12-03 09:51:17 +08:00
Kefu Chai
c93b0881e6
Merge pull request #31317 from wjwithagen/wjw-update-FindBoost.cmake
cmake: update FindBoost.cmake for 1.71

Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-12-02 16:46:00 +08:00
Kefu Chai
a56efc1610
Merge pull request #31841 from rosinL/wip-support-dpdk-numa
cmake: Add dpdk numa support

Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-12-02 16:45:11 +08:00
luo rixin
32f967b420 cmake: Add shared library as dpdk dependency
librte_eal.a refers to libpthread.so and libdl.so, and libceph-common.so
refers to librte_eal.a. Many test application link libceph-common.so
without linking pthread, it will cause link error.
Such as unittest_interval_set, target_link_libraries (unittest_interval_set
ceph-common)

Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
2019-11-28 20:18:09 +08:00
Chunsong Feng
4f3606f87b cmake: Add dpdk numa support
Find and link the numa library for DPDK.

Fixes: https://tracker.ceph.com/issues/42275

Signed-off-by: Hu Ye <yehu5@huawei.com>
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
2019-11-28 20:15:39 +08:00
Sage Weil
cf676c73ab Merge PR #31781 into master
* refs/pull/31781/head:
	cmake/modules: look for GNU make first instead of BSD make
	cmake: support parallel build for rocksdb

Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-11-25 21:49:31 -06:00
Sage Weil
0e0a3853c9 Merge PR #31579 into master
* refs/pull/31579/head:
	cmake: add cppcheck and iwyu static analysis targets

Reviewed-by: Brad Hubbard <bhubbard@redhat.com>
2019-11-25 21:49:18 -06:00
Deepika Upadhyay
abf3dc0cf9 cmake/modules: look for GNU make first instead of BSD make
* BuildDPDK.cmake, BuildSPDK.cmake:
      * give priority to build with gmake
      * throw error if make not found

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2019-11-25 13:16:04 +05:30
Deepika Upadhyay
a930706aa6 cmake: support parallel build for rocksdb
* cmake/modules/BuildRocksDB.cmake: if "make" detected
use concurrent processing, by passing the jobserver to
sub-make using `$(MAKE)`

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2019-11-25 13:14:22 +05:30
Casey Bodley
8aa638b0fa
Merge pull request #30960 from yuvalif/wip-yuval-add-kafka-notif-endpoint
rgw/pubsub: add kafka notification endpoint

Reviewed-by: Matt Benjamin <mbenjamin@redhat.com>
2019-11-21 14:42:23 -05:00
Willem Jan Withagen
9c0a948900 cmake: update FindBoost.cmake for 1.71
This comes from cmake v 3.15.3

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2019-11-20 17:13:13 +01:00
Yuval Lifshitz
c876a0d817 cmake: add cppcheck and iwyu static analysis targets
Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
2019-11-18 19:43:14 +02:00
Kefu Chai
d6998a3b95 cmake: detect librt for POSIX time functions
per clock_gettime(3),

> On POSIX systems on which these functions are available, the symbol
> _POSIX_TIMERS is defined in <unistd.h> to a value greater than 0.

and

> Most systems require the program be linked with the librt library to
> use these functions.

so, we should detect this symbol and link against librt for using these
functions.

in this change, librt is linked for checking the existence of
clock_gettime(), if it exists. RT_LIBRARY is defined.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-11-14 21:26:57 +08:00
Kefu Chai
4c42b4d49d
Merge pull request #31544 from ifed01/wip-ifed-gettid2
test/fio: bump to fio-3.15

Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-11-13 18:58:36 +08:00
Yingxin Cheng
bf958abc0f crimson: build seastar dpdk from src/seastar/dpdk
src/spdk/dpdk and src/seastar/dpdk are both at their private branches
with project-specific modifications, so select proper dpdk source
directory according to flags WITH_SPDK and Seastar_DPDK.

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
2019-11-13 15:53:43 +08:00
Yingxin Cheng
ab84158fc0 crimson: link required dpdk components for seastar
see https://github.com/scylladb/seastar/blob/
809b3ef875e7edb7c56643812dc8347ff9a82cee/cmake/Finddpdk.cmake#L60-L85

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
2019-11-13 15:53:31 +08:00
Igor Fedotov
fcfb0c9442 cmake: detect gettid() presense
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
2019-11-12 12:42:14 +03:00
Igor Fedotov
710e5da85b test/fio: bump to fio 3.15
Signed-off-by: Igor Fedotov <ifedotov@suse.com>
2019-11-12 02:24:45 +03:00
Yuval Lifshitz
354d775e04 rgw/pubsub: add kafka notification endpoint
Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
2019-11-05 19:25:03 +02:00
Kefu Chai
a123c85256 cmake: enable Finddpdk to find DPDK to be built
find_package(dpdk...) is used by seastar to find DPDK if Seastar_DPDK is
enabled. but `build_dpdk()` only exposes `dpdk::dpdk`, and it does not
set the variables like `dpdk_INCLUDE_DIRS` and `dpdk_LIBRARIES` when it
gets called. so we need to adapt Finddpdk to query them from `dpdk::dpdk`
target.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-10-24 17:54:05 +08:00
Kefu Chai
aa25f6202f cmake: define dpdk_LIBRARIES properly
dpdk_LIBRARIES should not be a list of dpdk library target, it should be
a list of paths to them. this also align with the definition of
`Finddpdk.cmake` in seastar project. so, if `Seastar_DPDK` is defined,
we should be able to offer the expected `dpdk_LIBRARIES` for seastar, as
our `Finddpdk.cmake` has higher priority than the one in seastar, and is
used when `find_package(dpdk...)` is called.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-10-24 15:15:51 +08:00
Kefu Chai
d82ea5d738 cmake: refactor BuildDPDK
* extract `do_export_dpdk()` into a separated function
* no need to check for `dpdk-ext` target before calling `build_dpdk()`,
  as the name of this target should be hidden from the caller of this
  function.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-10-24 15:15:51 +08:00
Sage Weil
da0473e251 Merge PR #30772 into master
* refs/pull/30772/head:
	cmake/modules/GetGitRevisionDescription: update to work with git-worktree

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
2019-10-22 15:57:02 -05:00
Kefu Chai
a826efc52f cmake: detect linker support
check the linker support of `--version-script` and `--exclude-libs`
flags. and use them only if they are supported.

llvm-ld does not support `--version-script` at this moment. and it's
reported that old versions of llvm-ld do not support `--exclude-libs`
as well.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-10-08 21:53:03 +08:00
Sage Weil
165f09d7e7 cmake/modules/GetGitRevisionDescription: update to work with git-worktree
Found this here: https://phabricator.kde.org/D9172

Signed-off-by: Sage Weil <sage@redhat.com>
2019-10-07 14:26:07 -05:00
Patrick Donnelly
bbe3a33775
Merge PR #30552 into master
* refs/pull/30552/head:
	cmake: fix libtsan detection
	test: librados startup/shutdown racer test

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2019-09-30 20:46:14 -07:00
Jeff Layton
09bd258a9f cmake: fix libtsan detection
This variable is case-sensitive.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2019-09-30 14:49:12 -04:00
Ulrich Weigand
d1b9d14324 cmake: Test for 16-byte atomic support on IBM Z
On IBM Z the Boost tagged pointer implementation cannot use
"pointer compression" as there are no unused bits in an address;
the whole 64-bit address space is available to user space code.

Instead, Boost uses 16-byte atomics.  This is always supported
on IBM Z, but depending on the particular compiler (version)
it may require linking against libatomic.  The existing checks
in CheckCxxAtomic.cmake do not catch this, however, as they only
test for (up to) 8-byte atomic support.

Fixed by adding a test for 16-byte atomic support on IBM Z.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2019-09-29 16:22:52 +02:00
Ulrich Weigand
0065f76d53 headers: Remove __le16/__le32/__le64
These types should no longer be used; use ceph_le16/32/64 instead.

Also removes the cmake check whether those types are provided by
kernel headers (likewise for the __be types, which already were
not used anywhere).

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2019-09-18 13:35:21 +02:00
Kefu Chai
01ffda8fff
Merge pull request #30362 from uweigand/fix-unaligned-check
cmake: Fix unaligned check on big-endian systems

Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-09-14 09:46:41 +08:00