Commit Graph

561 Commits

Author SHA1 Message Date
Kefu Chai
ea4ae6d2f1 cmake/modules: use exact version of python3 when finding cython
* CMakeLists.txt:
    always pass "EXACT" to find_package(Python3).
    because per cmake document, "EXACT" only takes effect when
    <Package>_FIND_VERSION_COUNT is greater than 1, where <Package>
    is "Python3". see also cmake/modules/FindPython/Support.cmake
* cmake/modules/AddCephTest.cmake:
    drop redundant find_package(Python3) calls. since Python3 is
    a mandatory requirement for building Ceph, we only need a
    single call of find_package(Python3..) in the top of the source
    tree. the only possible case to repeat it is to ensure that we
    have the correct version of Python3 used in following CMake
    script. but there is no need to repeat it if we just want to
    ensure that we have a python3 interpretor in place.
* cmake/modules/Distutils.cmake:
    always pass "EXACT" to find_package(Python3).
    we should always pass EXACT to find_package() when finding python3,
    this is a follow-up of e2babdfae8

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-04-21 06:52:18 +08:00
Kefu Chai
8b7ee35c3a
Merge pull request #44230 from optimistyzy/122_add_dml
blk/pmem: use DML library to offload read/write operations in pmem

Reviewed-by: Kefu Chai <tchaikov@gmail.com>
2022-04-20 18:47:00 +08:00
Ziye Yang
86cb8c75c3 Add the support to use DML library for PMEM device.
The purpose of this patch is to add the initial support to
offload memory/pmem operations by sync usage through hardware path
in DML library.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2022-04-19 14:51:12 +08:00
Kefu Chai
e2babdfae8 cmake/modules: always use the python3 specified in command line
if another python3 with higher version is found by
find_package(Python3), the cmake's install script would just
install the python modules/extensions into that python3's
dist-package directory, and the packaging script would fail
to find these artifacts when trying to package them.

so we need to ensure that the install directories for python
modeules/extensions are always "versioned" with WITH_PYTHON3
cmake option.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-04-16 09:15:03 +08:00
Kefu Chai
637dd7b404 cmake/modules: avoid using distutils
to address following warning from python 3.9:

<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-03-25 23:49:12 +08:00
Kefu Chai
f0fc04fbea cmake/modules: drop a cmake variable
less redirections

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-03-25 23:49:12 +08:00
Casey
5da406a4ee cmake: move Arrow targets into find_package modules
Signed-off-by: Casey <cbodley@redhat.com>
2022-03-14 10:19:02 -04:00
Casey
433782dbd5 cmake: use arrow's find_package modules
Signed-off-by: Casey <cbodley@redhat.com>
2022-03-14 10:19:02 -04:00
Casey Bodley
b10364dc21 cmake: add submodule for utf8proc at v2.2.0
adds utf8proc submodule, needed by the arrow submodule in centos. add a
WITH_SYSTEM_UTF8PROC option that controls whether or not utf8proc is
built from submodule

non-system utf8proc is built as a static library to avoid conflicts with
system-provided libraries

ceph.spec.in sets WITH_SYSTEM_UTF8PROC=OFF until it's available in
centos

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-03-14 10:19:02 -04:00
Casey Bodley
2ca6d75521 cmake: add submodule for Apache Arrow at v6.0.1
adds an arrow submodule. when WITH_RADOSGW_SELECT_PARQUET is enabled,
the submodule is built as an external project and rgw links against its
imported Arrow::Parquet target

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2022-03-14 10:19:02 -04:00
Kefu Chai
91a616b26e cmake: pass RTE_DEVEL_BUILD=n when building dpdk
ceph is still using the Makefile based building system for building
DPDK. and DPDK enables -Werror if RTE_DEVEL_BUILD is 'y' which is
enabled by default when the dpdk is built from a git repo.

but newer GCC is more picky than the older versions, to prevent
the possible FTBFS when we switch to newer GCC for building old
branches whose dpdk submodule might be include the changes addressing
those warnings. let's just disable this option.

the only effect of this option is to add -Werror to CFLAGS. but
the building warnings from DPDK is not our focus when developing
Ceph in the most cases. so it should be fine.

see also
eac901ce29/doc/build-sdk-quick.txt (L18)

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-03-05 12:57:24 +08:00
Kefu Chai
f356cc8869 cmake: use string(JOIN ..) to compose URL for boost download
* since the minimum required cmake version is now 3.16, there is no
  need to check for cmake version for using multiple URLs for
  downloading external project.
* use string(JOIN ..) to compose URL option for downloading boost

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-03-02 23:49:52 +08:00
Miaomiao Liu
9a9001a08f compressor: fix compilation issues about QATzip
Signed-off-by: Miaomiao Liu <miaomiao.liu@intel.com>
Signed-off-by: Hualong Feng <hualong.feng@intel.com>
2022-02-18 17:45:30 +08:00
Miaomiao Liu
082dcf0a58 cmake: replace BuildQatDrv.cmake with FindQatDrv.cmake
because QAT driver with version v1.7.l.4.14.0 or higher cannot be dowmloaded
directly by URL, FindQatDrv.cmake can find the locally installed QAT package and libraries

Signed-off-by: Miaomiao Liu <miaomiao.liu@intel.com>
Signed-off-by: Hualong Feng <hualong.feng@intel.com>
2022-02-08 14:06:07 +08:00
Tongliang Deng
e82b0a7b09 cmake/modules/BuildSPDK.cmake: link whole-archive
We build spdk as static library, linking against them requires the
use of `-Wl,--whole-archive` as argument, otherwise we will have error
`nvme.c: nvme_probe_internal: *ERROR*: NVMe trtype 256 not available`.
This is due to the use of constructor functions in spdk to register
NVMe transports. So we need to do so to ensure we call all the
constructors.

Signed-off-by: Tongliang Deng <dengtongliang@sensetime.com>
2022-01-20 19:39:27 +08:00
Clément Péron
96a8b4d846 cmake: dpdk: only append common dir if it has been found
Signed-off-by: Clément Péron <peron.clem@gmail.com>
2022-01-13 14:40:17 +01:00
Clément Péron
c37f15f54d cmake: dpdk: use STREQUAL and not EQUAL when comparing strings
Signed-off-by: Clément Péron <peron.clem@gmail.com>
2022-01-13 14:32:34 +01:00
Clément Péron
a24a4a0563 cmake: dpdk: fix typo in HINTS when looking for DPDK
Signed-off-by: Clément Péron <peron.clem@gmail.com>
2022-01-13 14:32:30 +01:00
Kefu Chai
76c35c6dd9 cmake: detect linux/blk/zoned support
* add find_package() support for detecting the existence of
  linux/blkzoned.h before using it.
* link against Linux::ZNS for adding the compilation definition of
  HAVE_ZNS instead of including it in the global config.h
* move the CMake option closer to where it is used for
  better readability. as this option takes effect only if
  crimson is compiled.
* make WITH_ZNS an option which depends on the value of
  CMAKE_SYSTEM_NAME. it is hidden and off if CMAKE_SYSTEM_NAME
  is not "Linux".

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2021-12-25 16:13:47 +08:00
Josh Durgin
facf0d35b1
Merge pull request #43598 from ideepika/wip-opentelemetry
migrate from using opentracing-cpp to opentelemetry-cpp static as distributed tracing API

Reviewed-by: Yuval Lifshitz <ylifshit@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2021-12-22 07:25:13 -08:00
Yuri Weinstein
ebb64e4a3d
Merge pull request #43612 from adamemerson/wip-unleveling
build: Remove LevelDB support

Reviewed-by: Kefu Chai <kchai@redhat.com>
2021-12-10 15:33:05 -08:00
Deepika Upadhyay
e78a4e2cea cmake: cleanup BuildJaeger as external project
replaced by Opentelemetry project, remove building and linking of jaeger
libraries.

* remove externalProject building
* linking of jaegertracing dependencies to ceph project

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-11-24 19:59:18 +05:30
Deepika Upadhyay
4128106de3 debian: remove libjaeger packaging
we no longer need to package libjaeger, as we would be using
libopentelemetry static libraries(until we support shared).

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-11-24 19:59:18 +05:30
Deepika Upadhyay
2749ab0635 cmake: replace opentracing-cpp with opentelemetry-cpp
we build and use targets needed for jaeger to work with opentelemetry
referring:
https://github.com/open-telemetry/opentelemetry-cpp/blob/main/examples/jaeger/CMakeLists.txt

right now we need a patch for using thrift from distro packages, hence
we are using GIT_FETCH based externalProject method, for development
purpose, which will be replace by more reliable method in future.

NOTE: phase 1, still needs to be tested.

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-11-24 19:59:18 +05:30
Kefu Chai
709a77f220 cmake: test for 16-byte atomic support on mips also
it's reported that a mips64el build host is able to pass the test of
CheckCxxAtomic without linking against libatomic, while librbd.so
fails to link due to failures like

/usr/bin/ld: ../../../lib/librbd.so.1.16.0: undefined reference to `__atomic_store_16'
/usr/bin/ld: ../../../lib/librbd.so.1.16.0: undefined reference to `__atomic_load_16'
/usr/bin/ld: ../../../lib/librbd.so.1.16.0: undefined reference to `__atomic_compare_exchange_16'

so we have to check the existence of __atomic_load_16 instruction on
mips architecture.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2021-11-24 00:44:04 +08:00
Kefu Chai
66b1e8cecd cmake: check for python(\d)\.(\d+) when building boost
now that python3.10 has two digits as its minor version, we should be
able to match it.

this change fixes the build with python3.10. without this change, we'd
have

error: wrong library name 'python310' in the --with-<library> option.

when building with python3.10

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2021-11-19 00:27:34 +08:00
Adam C. Emerson
447564e4db build: Remove LevelDB support
Whereas new LevelDB packages are build with -fno-rtti and break our
attempts to compile against them,

and whereas LevelDB has been deprecated for some time, with the Ceph
team expending great effort to migrating OSDs off of it,

let it be therefore removed.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2021-11-01 12:42:17 -04:00
Kefu Chai
c2c7297360
Merge pull request #31877 from rosinL/wip-fix-dpdk-link
cmake: link against DPDK shared libraries to avoid DPDK EAL double initialization

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2021-10-29 06:58:20 +08:00
Kai Kang
fe12f39721 cmake: add support for python 3.10
Signed-off-by: Kai Kang <Kai.Kang@windriver.com>
2021-10-22 14:59:28 +08:00
Chunsong Feng
6fdb468b85 cmake: link DPDK shared libraries to avoid DPDK initialization failure
The common_async_dpdk library depends on the dpdk librte_eal file.
If the static library is used, the dependency is transferred to
libceph-common. By default, libceph-common uses the PUBLIC keyword,
the keyword PUBLIC determines that both the application and
libceph-common link to dpdk librte_eal.a. As a result, the global
variables in dpdk librte_eal.a has two copies. So link DPDK shared
libs to avoid DPDK initialization failure.

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

Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Signed-off-by: luorixin <luorixin@huawei.com>
2021-10-14 20:45:34 +08:00
Kefu Chai
f2477d97c2 cmake: only pass --verbose when VERBOSE env variable is set
so that the setuptools is less chatty by default when building python
bindings.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2021-10-14 14:39:57 +08:00
Deepika Upadhyay
463193bcaf cmake,rgw: use jaeger-base target, as a dependency for building dbstore
* dbstore also has tracing dependencies and missing linking for libraries
* use `using` keyword in common/tracer.cc to silence unused method
  warnings
* log building of external project jaegertracing, opentracing into build
  file, (done to reduce external project build verbosity)

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-10-04 13:52:49 +05:30
Kefu Chai
81d52a2d65
Merge pull request #42870 from ktdreyer/cmake-thread-libs-init
cmake: link Threads::Threads instead of CMAKE_THREAD_LIBS_INIT

Reviewed-by: Deepika Upadhyay <dupadhya@redhat.com>
Reviewed-by: Kefu Chai <tchaikov@gmail.com>
2021-09-04 22:02:19 +08:00
Kefu Chai
1b9ad6ca97 arch,cmake: compile ppc.c on all powerpc machines
* cmake/modules/SIMDExt.cmake: define HAVE_PPC for 32-bit PowerPC.
* src/arch/CMakeLists.txt: compile ppc.c for all PowerPC architectures,
  including powerpc (32-bit PowerPC), ppc64el (64-bit Little Endian
  PowerPC) and ppc64 (64-bit Big Endian PowerPC).

before this change, ppc.c is only compiled if HAVE_POWER8 is defined.
but Power8 is a 64-bit PowerPC architecture. while in src/arch/probe.cc,
we check for `defined(__powerpc__) || defined(__ppc__)`, if this is
true, ceph_arch_ppc_probe() is used to check for the support of
Altivec. but on non-power8 PowerPC machines, the linker fails to find the
symbols like ceph_arch_ppc_probe(), as ppc.c is not compiled on them.

in this change, ppc.c is compiled on all PowerPC architectures, so that
ceph_arch_ppc_probe() is also available on non-power8 machines. this
change does not impact the behavior of non-power8 machines. because
on them, the runtime check would fail to detect the existence of
PPC_FEATURE2_VEC_CRYPTO instructions.

Reported-by: Mattias Ellert <mattias.ellert@physics.uu.se>
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2021-08-29 22:40:27 +08:00
Kefu Chai
d7771002ef cmake: use ceph repo with tag
to address following warning:

fatal: reference is not a tree: 7f02f21f53ccd5e2448086f8e9015489693dd2dc
CMake Error at /home/jenkins-build/build/workspace/ceph-pull-requests/build/fio_ext-prefix/tmp/fio_ext-gitclone.cmake:40 (message):
  Failed to checkout tag: '7f02f21f53ccd5e2448086f8e9015489693dd2dc'

it seems that the shallow option does not work with a sha1 tag option,
let's continue using the ceph repo with a tag.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2021-08-28 00:14:58 +08:00
Kefu Chai
b65d0747b5 cmake: use upstream repo for fio
this change partially reverts 10baab3fc8,
but since the fix for C++ build is not included by any tag or branche so
far. let's just use the sha1 for now.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2021-08-26 23:58:25 +08:00
Ken Dreyer
6c4f31eccf cmake: link Threads::Threads instead of CMAKE_THREAD_LIBS_INIT
CMAKE_THREAD_LIBS_INIT can be empty. On newer platforms, this leads to
an error:

  CMake Error at cmake/modules/Buildpmem.cmake:47 (set_target_properties):
  set_target_properties called with incorrect number of arguments.

This is because glibc 2.34 merged libpthread.so into libc.so.
Fedora 35 and RHEL 9 have glibc 2.34.

Fixes: https://tracker.ceph.com/issues/52353
Signed-off-by: Ken Dreyer <kdreyer@redhat.com>
Co-authored-by: Kefu Chai <kchai@redhat.com>
2021-08-24 13:12:10 -04:00
Kefu Chai
6cfdd40cad common/options: validate see-also
y2c.py is like a compiler which translates .yaml to .cc and .h files,
it does not have access to all .yaml files. to validate the dangling
see-also issue, we need to do this with a "linker".

in this change, validate-options.py is introduced to check if any of
option name included by the see-also property is valid.

Fixes: https://tracker.ceph.com/issues/51483
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-24 22:22:37 +08:00
Kefu Chai
89d8c79f50 cmake: do not quote string
otherwise we have

CMake Error at /home/jenkins-build/build/workspace/ceph-pull-requests/build/spdk-ext-prefix/src/spdk-ext-stamp/spdk-ext-build-.cmake:37 (message):
  Command failed: 2

   'env' '-i' 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' 'CC=/usr/bin/clang-10' '/usr/bin/make' 'EXTRA_CFLAGS=' '-fPIC' '-Wno-address-of-packed-member""'

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-16 21:27:57 +08:00
Kefu Chai
1fdd632d0c cmake: silence build output when building external deps
when download/building grafonnet-lib, dpdk, spdk, liburing and fio,
they dump lots of output during configuration and building phrases,
all of which is irrelevant to us. so let's just silence it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-16 21:27:57 +08:00
Kefu Chai
33545a7b1c cmake: use -Wno-unused-but-set-variable when compiling SPDK if supported
to silence warnings like:

In file included from nvme_tcp.c:52:
/home/jenkins-build/build/workspace/ceph-pull-requests/src/spdk/include/spdk_internal/nvme_tcp.h:369:17: warning: variable 'plen' set but not used [-Wunused-but-set-variable]
        uint32_t hlen, plen;
                       ^

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-16 17:32:34 +08:00
Kefu Chai
706997b7e6 cmake: use string(APPEND ..) to append to string
more readable and less repeating this way.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-16 17:29:37 +08:00
Kefu Chai
d3c315703a cmake: pass -Wunused-but-set-variable when building dpdk
otherwise we have:

src/spdk/dpdk/lib/librte_eal/linux/eal.c:591:11: error: variable 'total_mem' set but not used [-Werror,-Wunused-but-set-variable]
        uint64_t total_mem = 0;
                 ^
1 error generated.

when building dpdk with Clang. dpdk passes -Werror to compiler, so
we have to disable this option.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-16 14:23:17 +08:00
Kefu Chai
10baab3fc8 cmake/modules/BuildFIO: use ceph fork
to pick up the clang build fix. we should use the upstream repo, once the
clang build fix gets merged.

bumping up the fio helps to address following error, as this part was rewritten:

src/test/fio/CMakeFiles/fio_ceph_objectstore.dir/fio_ceph_objectstore.cc.o.d -o src/test/fio/CMakeFiles/fio_ceph_objectstore.dir/fio_ceph_objectstore.cc.o -c ../src/test/fio/fio_ceph_objectstore.cc
In file included from ../src/test/fio/fio_ceph_objectstore.cc:26:
In file included from src/fio/fio.h:18:
In file included from src/fio/thread_options.h:6:
In file included from src/fio/options.h:8:
src/fio/parse.h:128:13: error: arithmetic on a pointer to void
        return ret + offset;
               ~~~ ^
1 error generated.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-16 14:23:17 +08:00
Kefu Chai
08179fd9f3 cmake: fail on unknown attribute
on Clang, the option for detecting unknown attribute is
-Wunknown-attributes, so "-Wattributes -Werror" does not fail the test
when the C compiler is Clang.

in this change, we just turn all warnings into errors.
this should fail the test if the compiler does not understand
`__attribute__((__symver__ ...))`

Fixes: https://tracker.ceph.com/issues/40060
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-06 18:01:47 +08:00
Kefu Chai
8b94e73e12
Merge pull request #42602 from b-ranto/wip-lto
rados+rpm: Update symver defs and re-enable LTO

Reviewed-by: Brad Hubbard <bhubbard@redhat.com>
Reviewed-by: Nathan Cutler <ncutler@suse.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2021-08-06 13:45:01 +08:00
Boris Ranto
5bcfd5caee cmake: Check -flto flags
We should check if -flto-partition=none is defined when the compiler
does not support symver attribute and fail the build if it is not.

Fixes: https://tracker.ceph.com/issues/40060
Co-authored-by: Kefu Chai <tchaikov@gmail.com>
Signed-off-by: Boris Ranto <branto@redhat.com>
2021-08-05 15:46:50 +02:00
Boris Ranto
f90e26cb4b librados/librados_c: Use symver attribute if available
Fixes: https://tracker.ceph.com/issues/40060
Signed-off-by: Boris Ranto <branto@redhat.com>
2021-08-05 15:46:50 +02:00
Soumya Koduri
fa65fded5b cmake: Remove duplicate SQLite module
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
2021-08-03 23:22:47 +05:30
Kefu Chai
bc4aacbbbd
Merge pull request #42572 from tchaikov/wip-cmake-mgr-cleanup
cmake: initialize dpdk_LIBRARIES with empty list

Reviewed-by: Xiubo Li <xiubli@redhat.com>
2021-08-02 11:09:47 +08:00