Commit Graph

444 Commits

Author SHA1 Message Date
Kefu Chai d72c9205dc cmake: only display the result of checking nasm once
if nasm is able to emit AVX512 instructions, we can assume that it's
able to generate AVX2 instructions as well. so no need to print "Found
nasm" multiple times.

and by chaining mutual exclusive branches with "elseif", we can have
better readability.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-04 01:34:46 +08:00
Kefu Chai de78439775 cmake: drop duplicated variable
not_arch_x32 replicates ${_support_x64}. and a variable starts with
"not" is just difficult to parse. so drop it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-01-04 01:34:46 +08:00
Kefu Chai 6cdf25b4ab cmake: install python scripts into /usr/sbin even if DESTDIR is empty
it's reported that on Alphine, "make install" installs
`ceph-volume-systemd` into `/usr/bin` instead of `/usr/sbin`, and this
breaks `systemd/ceph-volume@.service`. so in this change, we always
install this script into `/usr/sbin`, even if `DESTDIR` is not defined.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-21 01:26:46 +08:00
Josh Durgin 8a74a937dd
Merge pull request #31358 from ideepika/wip-jaegertracing-in-ceph
jaegertracing build/ops integration

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2020-12-15 16:29:26 -08:00
Deepika Upadhyay 4b69d3a184 jaeger, build/op: add jaeger and it's dependencies as submodules
* This commit introduces Jaegertracing library as package libjaeger,
  pickwhich would be consumed by other ceph pacakges such as ceph-common0

* adds the following dependencies, which would be build from source
  using ExternalProjectHelper.cmake +IncludeJaeger.cmake +
  Build<package>.cmake scripts:

  jaegertracing: v0.6.0 [added as a submodule]
  opentracing: v1.6.0 [added as a submodule]
  thrift: 0.13.0 [added as a submodule]
  yaml-cpp: 0.6.0
  json(optional)

* updates Boost to be installed instead of being build only, because
  jaegertracing them during their build process.

* ceph.spec.in: introduces a default enabled jaeger packaging option,
  which could be disabled using --without-jaeger flag during rpmbuild

* note: libjaeger package if enabled will be a dependency on ceph-common, ceph-mon, rgw_common and transitively will be a dependency for modules that have them as  a dependency.

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2020-12-11 07:55:46 +00:00
Kefu Chai 3f1aa66ee2
Merge pull request #38501 from tchaikov/wip-cmake-crimson-test
test/crimson: do not link against crimson-{os,common}

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2020-12-11 15:52:22 +08:00
Kefu Chai 461ad210b3 cmake: exclude unit tests from the "all" target
no need to build unit tests when "make all", unless required explicitly,
like "make tests".

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-10 18:26:39 +08:00
Kefu Chai 244784fb36 cmake: stop rebuilding rocksdb everytime
this change was originally introduced as a part of
418bfd7bb5, and latter migrated / changed
in the current form. but the idea is the same: to rebuild rocksdb even
if the stamp file shows that it has been built. there is no need to do
so, as we don't hack RocksDB as we used to. also,it is distracting to
check this log message when rebuilding the tree. so drop it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-10 12:26:00 +08:00
Brad Hubbard 6e20e5ed5a cmake: Alter GIT_REPOSITORY for liburing
https://git.kernel.dk/liburing appears, at least currently, to be
unavailable. This could be reverted once it comes back.

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
2020-12-03 11:56:43 +10:00
Kefu Chai a92a27a5b0
Merge pull request #38320 from tchaikov/wip-cmake-std-fs
cmake: do not always require extra link flags for std::filesystem

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2020-12-02 22:03:26 +08:00
Kefu Chai 6cf7ebd0ca cmake: do not always require extra link flags for std::filesystem
since GCC-9

> Using the types and functions in <filesystem> does not require linking
> with -lstdc++fs now.

see https://gcc.gnu.org/gcc-9/changes.html#libstdcxx

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-02 19:42:34 +08:00
Kefu Chai 3429c2b586
Merge pull request #38380 from lixiaoy1/pkg_fix
cmake: fix unknown pkg_search_module

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-12-02 15:38:31 +08:00
lixiaoy1 e8fd8a31b2 cmake: fix unknown pkg_search_module
Signed-off-by: Li, Xiaoyan <xiaoyan.li@intel.com>
2020-12-02 06:18:52 -05:00
Brad Hubbard e0240b9af4 cmake: Stop 'configure' running every time
Currently the configure script is run on 'liburing_ext' not only for the
initial build but for subsequent incremental builds.

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
2020-11-24 13:38:37 +10:00
Or Ozeri ea3c1bfb9e librbd: add LUKS support
This commit introduces internal (not yet part of the api) librbd functions for:
1. formating an RBD image in LUKS format
2. parsing an RBD image in LUKS format

 The actual implementation of the LUKS format is done via libcryptsetup, which is added as a new dependency.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
2020-11-23 10:32:14 -05:00
Kefu Chai 504da5d5dd cmake: set advice.detachedHead=false when cloning liburing
silence "detached HEAD" warning like:

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-18 17:53:43 +08:00
Kefu Chai b6a94da614 cmake: add 1.74 to known versions
sync with
685fa8bec0/Modules/FindBoost.cmake

for boost 1.74 support

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-16 15:36:09 +08:00
Yanfei Xu 8f0a3fa1ff cmake: add support for python3.9
add support for python3.9.

Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
2020-11-11 10:43:37 +08:00
Kefu Chai dd073a0061
Merge pull request #37984 from tchaikov/wip-fio
cmake: drop WITH_SYSTEM_FIO option

Reviewed-by: Igor Fedotov <ifedotov@suse.com>
2020-11-09 21:08:13 +08:00
Kefu Chai 3510433f9c cmake: build liburing with -fPIC
in liburing,
75cad68b95
partially reverts
4e360f7113,
which builds liburing.a with -fPIC.

so we need to pass -fPIC by ourselves. otherwise we'd have

/usr/bin/ld: ../../liburing/src/liburing.a(setup.ol): relocation R_X86_64_PC32 against symbol `io_uring_queue_mmap' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
src/test/fio/CMakeFiles/fio_ceph_objectstore.dir/build.make:154: recipe for target 'lib/libfio_ceph_objectstore.so' failed

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-09 17:10:59 +08:00
Kefu Chai c976f142f0 cmake: expose FIO_INCLUDE_DIR via libfio
always use the fio built from source for better consistency.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-09 16:01:59 +08:00
Kefu Chai d16f7fb524 cmake: drop WITH_SYSTEM_FIO option
there is no well-known distro packaging fio.h, so drop this option.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-09 16:01:59 +08:00
Kefu Chai b6bae7ba13 cmake: use make explicitly to build fio
we cannot assume that user uses "make" as the generator of cmake, if,
for instance, ninja is used, `$(MAKE)` is not a valid variable in the
generated `build.ninja`. so we should use "make" explicitly.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-09 15:49:26 +08:00
Kefu Chai 68eb5bcdce cmake: use src/liburing for building liburing if it exists
so we can build with liburing enabled if the dist tarball contains
liburing.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-09 13:11:35 +08:00
Kefu Chai 3f2a844da4 cmake: set GIT_SHALLOW and UPDATE_DISCONNECTED
* GIT_SHALLOW=TRUE, so we don't pull the full git history,
  as we don't care about it.
* UPDATE_DISCONNECTED=TRUE, to skip the UPDATE step, this change
  somehow works around
  https://gitlab.kitware.com/cmake/cmake/-/issues/19703. otherwise
  cmake keeps building liburing.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-06 01:20:25 +08:00
Kefu Chai eb81ab4d1c blk/kernel/io_uring: bump liburing to v0.7
* use functions exposed by liburing instead of using syscalls
* v0.7 is the latest release at the time of writing, as liburing is under
  active development. it'd be better to use a newer release.
* also use https://git.kernel.dk/liburing instead of
  http://git.kernel.dk/liburing.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-11-06 01:20:06 +08:00
Changcheng Liu 497b4d6f72 cmake: remove yasm since it's been replaced by nasm
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2020-10-29 12:36:20 +08:00
Changcheng Liu bf5794b2f0 cmake: define cmake macro to check nasm assembler
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2020-10-29 12:34:38 +08:00
Changcheng Liu a62f8d8ea0 cmake: check whether yasm support AVX512
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2020-10-29 08:57:54 +08:00
Changcheng Liu c98a925053 common: rename variable name to improve readability
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2020-10-29 08:57:54 +08:00
Changcheng Liu 9d94548b4c cmake: refine yasm support x86_64 and AVX2 info
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2020-10-29 08:57:54 +08:00
Changcheng Liu 4738722d1e cmake: more quiet when checking for yasm
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2020-10-29 08:57:54 +08:00
Kefu Chai 7c1544c04c cmake: do not always add py3 to TOX_ENVS
before this change add_tox_test() always add "py3" to testenv, even the
caller specifies TOX_ENVS explicitly.

after this change, py3 is added only if the caller does not specify any
TOX_ENVS.

this change helps with the readability.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-10-14 15:30:37 +08:00
Kefu Chai 23e3358e3d
Merge pull request #36955 from agayev/zbc-to-zbd
os/bluestore: Switch from libzbc library to libzbd library

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-09-08 21:24:11 +08:00
Abutalib Aghayev bb488b06c9 os/bluestore: Switch from libzbc library to libzbd library
Libzbc maintainers recommend switching to libzbd, which is lighter and supports
both ZNS SSDs and HM-SMR HDDs.

Signed-off-by: Abutalib Aghayev <agayev@cs.cmu.edu>
2020-09-06 12:35:05 -04:00
Kefu Chai 2931862bd8
Merge pull request #36924 from ddiss/sigabbrev_np
cmake: detect and use sigdescr_np() if available

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Nathan Cutler <ncutler@suse.com>
2020-09-06 18:45:58 +08:00
Kefu Chai 968df0cae6
Merge pull request #36775 from tchaikov/wip-spdk
spdk: pick up spdk v20.07

Reviewed-by: Neha Ojha <nojha@redhat.com>
2020-09-03 11:03:02 +08:00
David Disseldorp b9b6faf66a cmake: detect and use sigdescr_np() if available
sys_siglist is deprecated with glibc 2.32. A new thread-safe and
async-signal safe sigdescr_np() function is provided, so use it if
available.

Fixes: https://tracker.ceph.com/issues/47187
Signed-off-by: David Disseldorp <ddiss@suse.de>
2020-09-01 15:13:31 +02:00
Kefu Chai fc6f35a840 cmake: expose Sanitizers_COMPILE_OPTIONS as a list
* cmake/modules/FindSanitizers.cmake: do not pollute CMAKE_REQUIRED_FLAGS
* cmake/modules/FindSanitizers.cmake: expose Sanitizers_COMPILE_OPTIONS
  as a list
* CMakeLists.txt: append Sanitizers_COMPILE_OPTIONS to
  *_LINKER_FLAGS after replacing ";" with " " in it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-08-31 16:11:33 +08:00
Kefu Chai 8e7a7e3076 cmake: use core2 when targeting amd64
instead of sticking to the building host's march (native), use a safer
guess.

Fixes: https://tracker.ceph.com/issues/24948
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-08-27 20:08:03 +08:00
Roman Penyaev 8b1c06dce9 cmake: update list of libraries compiled from DPDK/SPDK
on the newest DPDK/SPDK some libraries were removed, while some of them
were added. so update the list accordingly to address linking errors.

Signed-off-by: Roman Penyaev <rpenyaev@suse.de>
2020-08-27 20:08:03 +08:00
Kefu Chai 47b76ce24e cmake: silence "detached HEAD" warning
git complains when checking out a tag in "detached HEAD", like:

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them
...

but this does not help, as, in general, we don't hack fio in Ceph,
so disable this warning. and also clone the repo in shallow mode
for the same reason -- we don't care about the whole history of
fio repo. we just use it for testing.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-08-25 12:38:03 +08:00
Dan Mick e7e950aa36 cmake: don't include tags for Python imports, .tox, build/ dirs
For things like cephadm, where there is a lot of "from X import Y",
the import tags become cumbersome.  .tox dirs and
python-common/build are just repeats of source files found elsewhere
so result in duplicate tags

Signed-off-by: Dan Mick <dmick@redhat.com>
2020-08-10 22:53:03 +00:00
Lucian Petrut 22310e0304 cmake: fix lz4 params when building rocksdb
Recent RocksDB version use slightly different parameter names for
the LZ4 include/lib dirs, we'll have to pass the right ones.

We'll also have to fix the "CMAKE_TOOLCHAIN_FILE" parameter,
which isn't passed properly.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2020-07-27 16:05:09 +00:00
Kefu Chai 7fe16eb0e6 cmake: download and build boost 1.73 if it is not installed
Fixes: https://tracker.ceph.com/issues/46208
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-26 17:36:54 +08:00
Kefu Chai 40f08b3b0e cmake: update FindBoost.cmake for 1.73
adapted from
https://github.com/Kitware/CMake/blob/master/Modules/FindBoost.cmake
commit b76b4dea1cd60e9899fd641602901ded9e0d7a7b

Fixes: https://tracker.ceph.com/issues/46208
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-26 17:36:54 +08:00
Kefu Chai 91bccedc32 cmake: use add_compile_options()
instead of appending compile flags to CMAKE_C_FLAGS, use
add_compile_options(), as COMPILE_OPTIONS is a list, it'd simpler to
append options to it and to access it in a structured way.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-06-18 16:40:14 +08:00
Patrick Donnelly 2f82b45c44
Merge PR #34719 into master
* refs/pull/34719/head:
	ceph-fuse: compatible with libfuse3.5 or higher
	cmake: to get the header and library from specified path
	libfuse: check the libfuse version from the pkconfig/fuse{3}.pc file

Reviewed-by: Zheng Yan <zyan@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-06-02 17:46:26 -07:00
Xiubo Li ee3307431f cmake: to get the header and library from specified path
Since the pkg_search_module will help us set the header and lib
path, which we should get the headers and lib from. To check from
other paths will make no sense.

Fixes: https://tracker.ceph.com/issues/45396
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-05-24 21:40:18 -04:00
Xiubo Li 7a3cc61de0 libfuse: check the libfuse version from the pkconfig/fuse{3}.pc file
Since libfuse 3.2 to 3.8 the minor version for FUSE library has
stopped updating together with the releases. So we cannot check
version by using the FUSE_VERSION macro in the fuse_common.h header
file directly.

This will check the major/minor version from the fuse{3}.pc pkconfig
file.

Fixes: https://tracker.ceph.com/issues/45396
Signed-off-by: Xiubo Li <xiubli@redhat.com>
2020-05-24 21:39:47 -04:00