Commit Graph

602 Commits

Author SHA1 Message Date
Deepika Upadhyay
a92a7aa236 cmake: change debian DESTDIR for installing jaeger deps
debian uses debian/tmp as destination dir for installing build files,
but since we are using common path($build_dir/external) available both
for rpm and debian based dependency installation, it becomes far more
complicated to maintain include/link path for these external projects.

elaborating on it:
path we are configuring for both rpm and debian installing including,
and linking of external librarires:
/build/ceph-17.0.0-5779-g928f9e55/obj-x86_64-linux-gnu/external/
debian appends DESTDIR to this path, and hence our predefined target
artificats cannot find correct path for external libs, I tried adding
ENV${DESTDIR} so that it could include correct external lib install
path, but it still cannot find them:

failed to link in case of:
-  install(DIRECTORY $ENV{DESTDIR}${CMAKE_BINARY_DIR}/external/include/jaegertracing
-                $ENV{DESTDIR}${CMAKE_BINARY_DIR}/external/include/opentracing
-          DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-  include_directories(SYSTEM ${CMAKE_INSTALL_INCLUDEDIR}/jaegertracing)
-  include_directories(SYSTEM ${CMAKE_INSTALL_INCLUDEDIR}/opentracing)

-- Installing: /build/ceph-17.0.0-5790-g6bc03cbd/debian/tmp/build/ceph-17.0.0-5790-g6bc03cbd/obj-x86_64-linux-gnu/external/include/jaegertracing/Tracer.h

cd /build/ceph-17.0.0-5790-g6bc03cbd/obj-x86_64-linux-gnu/src && /usr/bin/c++  -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -D__CEPH__ -D__STDC_FORMAT_MACROS -D__linux__ -I/build/ceph-17.0.0-5790-g6bc03cbd/obj-x86_64-linux-gnu/src/include -I/build/ceph-17.0.0-5790-g6bc03cbd/src -isystem /build/ceph-17.0.0-5790-g6bc03cbd/obj-x86_64-linux-gnu/boost/include -isystem /build/ceph-17.0.0-5790-g6bc03cbd/obj-x86_64-linux-gnu/include -isystem /build/ceph-17.0.0-5790-g6bc03cbd/src/xxHash -isystem /build/ceph-17.0.0-5790-g6bc03cbd/src/rapidjson/include -isystem /build/ceph-17.0.0-5790-g6bc03cbd/src/include/jaegertracing -isystem /build/ceph-17.0.0-5790-g6bc03cbd/src/include/opentracing  -g -O2 -fdebug-prefix-map=/build/ceph-17.0.0-5790-g6bc03cbd=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC   -U_FORTIFY_SOURCE -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -ftemplate-depth-1024 -Wpessimizing-move -Wredundant-move -Wstrict-null-sentinel -Woverloaded-virtual -fno-new-ttp-matching -fstack-protector-strong -fdiagnostics-color=auto -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -std=c++17 -o CMakeFiles/common-objs.dir/mds/mdstypes.cc.o -c /build/ceph-17.0.0-5790-g6bc03cbd/src/mds/mdstypes.cc
In file included from /build/ceph-17.0.0-5790-g6bc03cbd/src/osd/OpRequest.h:21,
                 from /build/ceph-17.0.0-5790-g6bc03cbd/src/osd/OpRequest.cc:3:
/build/ceph-17.0.0-5790-g6bc03cbd/src/common/tracer.h:10:10: fatal error: jaegertracing/Tracer.h: No such file or directory

Since the install path is in our build environment for these librarires,
skipping DESTDIR looks to me hacky fix, but does the job.
with empty destdir:

-- Installing: /build/ceph-17.0.0-5791-gb97b9640/obj-x86_64-linux-gnu/external/include/jaegertracing/Tracer.h

cd /build/ceph-17.0.0-5791-gb97b9640/obj-x86_64-linux-gnu/src/mon && /usr/bin/c++  -DBOOST_ASIO_DISABLE_THREAD_KEYWORD_EXTENSION -DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_REENTRANT -D_THREAD_SAFE -D__CEPH__ -D__STDC_FORMAT_MACROS -D__linux__ -I/build/ceph-17.0.0-5791-gb97b9640/obj-x86_64-linux-gnu/src/include -I/build/ceph-17.0.0-5791-gb97b9640/src -isystem /build/ceph-17.0.0-5791-gb97b9640/obj-x86_64-linux-gnu/boost/include -isystem /build/ceph-17.0.0-5791-gb97b9640/obj-x86_64-linux-gnu/include -isystem /build/ceph-17.0.0-5791-gb97b9640/src/xxHash -isystem /build/ceph-17.0.0-5791-gb97b9640/src/rapidjson/include -isystem /build/ceph-17.0.0-5791-gb97b9640/obj-x86_64-linux-gnu/external/include -isystem /build/ceph-17.0.0-5791-gb97b9640/src/rocksdb/include  -g -O2 -fdebug-prefix-map=/build/ceph-17.0.0-5791-gb97b9640=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC   -U_FORTIFY_SOURCE -Wall -fno-strict-aliasing -fsigned-char -Wtype-limits -Wignored-qualifiers -Wpointer-arith -Werror=format-security -Winit-self -Wno-unknown-pragmas -Wnon-virtual-dtor -Wno-ignored-qualifiers -ftemplate-depth-1024 -Wpessimizing-move -Wredundant-move -Wstrict-null-sentinel -Woverloaded-virtual -fno-new-ttp-matching -fstack-protector-strong -fdiagnostics-color=auto -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -std=c++17 -o CMakeFiles/mon.dir/MgrMonitor.cc.o -c /build/ceph-17.0.0-5791-gb97b9640/src/mon/MgrMonitor.cc

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-07-22 11:09:09 +05:30
Deepika Upadhyay
ffc3764606 cmake: adds BUILD_BYPRODUCT for external build jaegertracing libs
* adds BUILD_BYPRODUCT which tells ninja which library will be generated
after the build(needed for dependent build libs)

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-07-22 11:09:09 +05:30
Deepika Upadhyay
1e2278e158 cmake: minor reorder of boost path in jaeger build external projet
* Boost is a dependency for jaeger, to use the right version, we pass
ceph build boost path to cmake jaeger build step

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-07-22 11:08:17 +05:30
Deepika Upadhyay
2eea50800e cmake: target name Jaeger >> jaegertracing
since jaegertracing is the original target that jaeger submodule uses in
it's cmake, cmake build complained if named otherwise

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-07-22 11:02:18 +05:30
Deepika Upadhyay
f51480b223 cmake: move ExternalProjectHelper & IncludeJaeger to BuildJaeger
set_library_properties_for_external_project assists with setting right target
properties for all jaeger dependencies.
IncludeJaeger would take care of linking and creating these targets
having them spread out when they are highly coupled seems not optimal.

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-07-22 11:01:08 +05:30
Deepika Upadhyay
84ad544433 cmake: add find_package(thrift) support for thrift 0.13
adds Findthrift.cmake which is used to find thrift 0.13, as a dependency
for building jaegertracing

* bump up submodule version for jaeger-client-cpp for thrift compiler
removal

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-07-22 10:59:48 +05:30
Deepika Upadhyay
80e82686eb ceph.spec, cmake, debian: use thrift 0.13+ from distro pkg
the change to build and ship libthift was added when we didn't have 0.13.0
version shipped via distro pkgs, now that centos 8 and F34 supports req.
version, we do not need to build and ship it with jaeger library.

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-07-22 10:59:45 +05:30
Deepika Upadhyay
00f44782af cmake, ceph.spec, debian: use yaml-cpp >= 0.6
* since focal and centos both have yaml-cpp 0.6 available, which dropped
having boost as it's dependency, moving to 0.6 seems a good upgrade.

* cmake: delete Buildyaml, since distro suppilies v0.6 this is not needed

This fixes the build failure, as jaegertracing requires yaml-cpp v0.6+
```
Could NOT find yaml-cpp: Found unsuitable version "", but required is at
  least "0.5.1" (found yaml-cpp_LIBRARY-NOTFOUND)

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-07-22 10:58:08 +05:30
Deepika Upadhyay
4e0b4da1a2 cmake: update build<lib>.cmake for supporting ninja
* affects cmake builds for: yaml-cpp, thrift, jaeger, opentracing external
projects

changes done:
* artificat BUILD_BYPRODUCT which tells ninja which library will be generated
after the build(needed for dependent build libs)
* use cmake_command if `make` not found so that we use default generator, cmake
will identify and use ninja directly in this case.
* minor reorder of boost path in jaeger build external projet

fixes: https://tracker.ceph.com/issues/51029

Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
2021-07-06 14:22:28 +00:00
Kefu Chai
d2b0382ec6 cmake: stop detecting <experimental/filesystem>
since we've dropped the support of GCC older than v8.0, there is no need
to detect <experimental/filesystem>

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-06-09 23:25:22 +08:00
Kefu Chai
b6e6d15a28 cmake: require GCC-8.1 and up
for better C++17 support, for instance for a better std::filesystem
support.

the reason why 8.1 is required is that ubuntu focal provides GCC-8.1,
and RHEL/CentOS8 provides GCC-8.4.1. so we only test the build on
GCC-8.1 and up so far.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-06-09 23:25:22 +08:00
Kefu Chai
7577fec7fd cmake: increase the MAX_{LINK,COMPILE}_MEM
based on recent observation, quite a few C++ source file take
around more than 3.0GiB to compile. for instance,
test_mock_HttpClient.cc could take up to 6270MiB memory to compile.

so increase MAX_{LINK,COMPILE}_MEM accordingly.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-06-03 21:03:03 +08:00
Kefu Chai
b9e8015904 cmake/modules/FindSanitizers: prefer libasan.6
libasan.6 is shipped as part of GCC-11, so prefer it over older versions

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-24 16:19:37 +08:00
Casey Bodley
a335304042 rgw: remove the fcgi frontend
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2021-05-17 15:00:33 -04:00
Kefu Chai
078b30e1f1
Merge pull request #41166 from tchaikov/wip-cmake-cython-cflags
cmake: remove cflags from CC

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2021-05-08 21:17:19 +08:00
Rafał Wądołowski
c2c6678e48 cmake: Replace boost download url
Boost has moved downloads to JFrog Artifactory
https://www.boost.org/users/news/boost_has_moved_downloads_to_jfr.html

Signed-off-by: Rafał Wądołowski <rwadolowski@cloudferro.com>
2021-05-07 10:12:43 +02:00
Kefu Chai
1f6cf5e403 cmake: remove cflags from CC
this change make it more explicit how we override CC, CFLAGS and
CPPFLAGS:

* CC only for the compiler
* CFLAGS only for the flags consumed by C compiler
* CPPFLAGS only used for the preprocessor, it is used by both C and C++
  compilers.

this change does not address any specific test failure. it just
improves the correctness and readability.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-05 15:19:27 +08:00
Kefu Chai
d0858dbfb4 librados/librados_c: check .symver support using cmake
the __asm__(".asmver ..") is a support provided by the compiler, so
would be better to detect it by either checking the compiler identifer
or just try it out.

in this change, instead of checking the building platform, we check this
feature using check_c_source_compiles().

in future, we could support versioned symbols using function attriubte
or symbol tables or version-script.

on platform where symbol versioning is not supported, we might need to
go with a different approach.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-02 08:16:12 +08:00
Kefu Chai
fab337c1d0 common/compat: detect memset_s() using check_function_exists()
more robust this way.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-02 08:16:12 +08:00
Kefu Chai
d275875b0e cmake: check for empty string by its value
the behavior of cmake 3.17 is a little bit different as it consider

NOT _library STREQUAL ""

as true, if ${_library} is "".

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-02 08:15:15 +08:00
Kefu Chai
a06f8edeca common/pick_address: define in_addr_t if it is not defined
neither mingw not not have in_addr_t defined, see
https://docs.microsoft.com/en-us/windows/win32/api/winsock2/ns-winsock2-in_addr,
so define it if it is not defined.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-05-01 23:30:53 +08:00
Kefu Chai
8ba7087585
Merge pull request #41071 from tchaikov/wip-cmake-disable-vta
cmake: disable "variable tracking" when building rados python binding

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2021-05-01 09:09:05 +08:00
Kefu Chai
59624b0fd9
Merge pull request #41038 from tchaikov/wip-cmake-liburing
cmake: pass "CC" using configure when building liburing

Reviewed-by: Ronen Friedman <rfriedma@redhat.com>
2021-04-29 22:20:09 +08:00
Kefu Chai
c2b3f7f5e7 cmake: disable "variable tracking" when building rados python binding
to silence the warning like:

/home/jenkins-build/build/workspace/ceph-pull-requests/build/src/pybind/rados/rados.c: In function '__pyx_pymod_exec_rados':
/home/jenkins-build/build/workspace/ceph-pull-requests/build/src/pybind/rados/rados.c:78903:30: note: variable tracking size limit exceeded with '-fvar-tracking-assignments', retrying without
78903 | static CYTHON_SMALL_CODE int __pyx_pymod_exec_rados(PyObject *__pyx_pyinit_module)
      |                              ^~~~~~~~~~~~~~~~~~~~~~
cc: warning: /usr/bin/cc: linker input file unused because linking not done

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-29 00:11:33 +08:00
Yingxin Cheng
636ab08f26 cmake: bump to PMDK v1.10
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
Signed-off-by: Yin Congmin <congmin.yin@intel.com>
2021-04-28 17:31:41 +08:00
Kefu Chai
e25c046f31 cmake: pass "CC" using configure when building liburing
since liburing's configure checks the CC and CXX env variables, let's
pass them when calling "configure". otherwise "make" still uses gcc and
g++ by default as they are specified in the "configure" script. this
also matches with the way how debian/rules calls "make".

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-27 13:36:23 +08:00
Kefu Chai
ad85af2ef8 cmake/modules/Findpmem: always set pmem_VERSION_STRING
before this change, `pmem_VERSION_STRING` is not set if it is not able
to fulfill the specified version requirement. the intention was to check
if the version is able to satisfy the requirement. but actually, passing
an empty `pmem_VERSION_STRING` to `find_package_handle_standard_args()`
as the option of `VERSION_VAR` does not fail this check. on the
contrary, it prints

-- Found pmem: pmem_pmemobj_INCLUDE_DIR;pmem_pmem_INCLUDE_DIR (Required
is at least version "1.17")

if we requires pmem 1.17, while the found version is, for instance,
1.10.

if the required version is 1.7, and the found version is 1.10, the
output from cmake is:

-- Found pmem: pmem_pmemobj_INCLUDE_DIR;pmem_pmem_INCLUDE_DIR (found
suitable version "1.10", minimum required is "1.7")

in this change, the version spec is not specified when calling
`pkg_check_modules()`. so, `PKG_${component}_VERSION` is always set.
and we can always delegate the version checking to
`find_package_handle_standard_args()`. please note, we use the lower
version returned by pkg-config if multiple components are required and
both pkg-config settings return their versions.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-26 16:38:09 +08:00
Kefu Chai
117838c91d
Merge pull request #40866 from hualongfeng/pmdk_in_dist
make-dist: add pmdk to dist tarball

Reviewed-by: Kefu Chai <kchai@redhat.com>
2021-04-15 16:43:28 +08:00
Feng Hualong
14c2a2e59f cmake: use src/pmdk for building pmdk if it exists
so we can build with pmdk enabled if the dist tarball
contains pmdk

Signed-off-by: Feng Hualong <hualong.feng@intel.com>
2021-04-15 10:40:06 +08:00
Kefu Chai
e09f8d7dd0
Merge pull request #40149 from tchaikov/wip-cmake-job-pool
cmake: use ninja job pool

Reviewed-by: Patrick Donnelly <pdonnell@redhat.com>
2021-04-14 15:06:50 +08:00
Kefu Chai
8c44876be4 cmake: s/HAVE_MSGHDR/WITH_SYSTEMD/
as FreeBSD also has msghdr but it does not have systemd, or
flags like MFD_ALLOW_SEALING, O_TMPFILE or F_SEAL_GROW. so
use WITH_SYSTEMD for enabling journald backend of logging system.

also move the option of "WITH_SYSTEMD" up so that the src/CMakeLists.txt
is able to see the variable of WITH_SYSTEMD defined by it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-08 16:58:50 +08:00
Kefu Chai
c6e8fc5933
Merge pull request #40487 from tchaikov/wip-boost-1.75
install-deps.sh: install boost 1.75

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2021-04-07 15:10:34 +08:00
Kefu Chai
80c4a1cd37 common: disable journald logging backend if struct msghdr is not found
* cmake/modules/CephChecks.cmake: detect the existence of struct msghdr,
  define HAVE_MSGHDR if it is found
* src/common/CMakeLists.txt: do not compile journald.cc if HAVE_MSGHDR
  is FALSE. as in that case, we cannot use sendmsg() to write to
  journald unix domain socket
* src/test/CMakeLists.txt, src/test/common/CMakeLists.txt: disable test
  exercising journald logging backend if HAVE_MSGHDR is not defined
* src/common/Journald.h: define a dummy JournaldLogger and a dummy
  JournaldClusterLogger when HAVE_MSGHDR is not defined, in order to
  minimize the change in Log.h and Log.cc, otherwise the source code of
  Log.h and Log.cc would be segmented into smaller chunks by
  `ifdef HAVE_MSGHDR` macros.
* src/include/config-h.in.cmake: define a new macro named
  HAVE_MSGHDR.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-06 14:46:33 +08:00
Kefu Chai
37a015a9ed cmake: dedup components when finding pmem
otherwise we always find libpmem twice if libpmem is explicitly
specified when find_package()

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-05 17:33:10 +08:00
Kefu Chai
89121189ac cmake,install-deps,make-dist: use boost 1.75
so we can use the latest boost

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-05 15:09:29 +08:00
Kefu Chai
7e1ef0c0c9 cmake: require libpmem 1.7
detect the libpmem libraries' version using pkg-config

please note, the version is not identical to the ones defined in
libpmem.h or libpmemobj/base.h

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-03 23:59:32 +08:00
Kefu Chai
6dfc80737d cmake: consolidate the find logic in Findpmem.cmake
less repeating this way

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-03 23:58:53 +08:00
Kefu Chai
bf56cddce5 cmake: use .pc for hints for finding pmem libraries
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-04-03 22:00:17 +08:00
Kefu Chai
16fd07244d cmake: allow use libzstd in system
since we are moving the test nodes from bionic to focal, we are able to
use the prebuilt libzstd libraries when running "make check". to speed
up the build and test, in this change:

* add FindZstd.cmake which allows us to use the libzstd in system
* extract BuildZstd.cmake for better readability
* add an option named "WITH_SYSTEM_ZSTD", which defaults to "OFF",
  so user can enable it on demand.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-31 12:53:39 +08:00
Kefu Chai
65776d3112 cmake: pass unparsed args to add_ceph_test()
this allows us to pass extra argument to the script or executable to
further customize its behavior when testing.

also fix all the callers of add_ceph_unittest(), as there is no need to
repeat the executable, which is also used as the name of the test.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-30 17:33:56 +08:00
Kefu Chai
1a422d4478 cmake: pass PARALLEL to add_ceph_unittest()
and parse it using cmake_parse_arguments(), more flexible this way.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-30 16:44:32 +08:00
Kefu Chai
6152076c22
Merge pull request #40336 from tchaikov/wip-cmake-fio
cmake: pass compile options by fio interface library

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
2021-03-26 09:28:31 +08:00
Kefu Chai
47cec18613 cmake: use fixture for preparing venv
this change should allow us to decouple "ninja tests" from "ctest".
in other words, we can just run

ctest -R run-tox-python-common -V

without running "ninja tests" first. before this change

${name}-venv is added as a dependency of "tests" target.

after this change,

setup-venv-for-${name} is added as a test, which is in turn a test of
run-tox-${name}, so we can just

ctest -R run-tox-${name}

now for preparing the venv and then testing the tox test of ${name}.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-24 22:19:31 +08:00
Kefu Chai
c190fee53d cmake: pass compile options by fio interface library
for better readability and maintainability

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-23 16:25:47 +08:00
Kefu Chai
897fd990bf cmake: use ninja job pool
to limit the parallel level of compile jobs which consumes lots of memory
to compile and/or link.

compile following targets with heavy_compile_pool.

* unittest_librbd
* crimson*
* ceph-dencoder

some of the .cc files in the target above use up to 6 GiB memory to
compile.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-21 15:52:13 +08:00
Patrick Donnelly
f7fa3b50c1
libcephsqlite: rework architecture and backend
This is a complete rewrite on top of SimpleRADOSStriper as well as the
API. The VFS is now a loadable extension as well.

Fixes: https://tracker.ceph.com/issues/40609
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-19 08:52:55 -07:00
Patrick Donnelly
eb52c869d5
cmake: improve build inst for cephsqlite
Notably, find SQLite and build the test code.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
2021-03-19 08:52:54 -07:00
Kefu Chai
33d2964ae2 cmake: adapt FindBoost.cmake to our needs
the vanilla FindBoost.cmake pulled from cmake has couple assumptions
which do not hold in our environment. so address them case by case.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-19 20:35:51 +08:00
Kefu Chai
3aaedc8fdc cmake: add 1.75 to known versions
sync with
507710438d/Modules/FindBoost.cmake

for v1.75 support

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-19 20:35:51 +08:00
Kefu Chai
cfa20c33a7 cmake: silence "You are in 'detached HEAD' state" warning
git warns us when the repo is in 'detached HEAD' state, 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 switching back to a branch.
...
Turn off this advice by setting config variable advice.detachedHead to
false

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-09 19:13:22 +08:00
Kefu Chai
aea8187cb3 cmake: define BUILD_BYPRODUCTS for Boost
so if a cmake generator needs any one of them, it knowns how to build
it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-09 19:13:22 +08:00
Kefu Chai
609644c645 cmake: do not specify CMAKE_GENERATOR for external projects
as per CMake document,

> Without this option, the same generator as the main build will be
> used.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-09 19:13:22 +08:00
Kefu Chai
c471d0081b cmake: use "" for no-op INSTALL_COMMAND
as suggested by CMake document, see
https://cmake.org/cmake/help/latest/module/ExternalProject.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-09 19:13:21 +08:00
Kefu Chai
0e83f0d333 cmake: define BUILD_BYPRODUCTS for spdk-ext
so if a cmake generator needs any one of them, it knowns how to build
it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-09 19:13:21 +08:00
Kefu Chai
aeb22b47a6 cmake: link libpmemobj against libpmem
libpmemobj should link against libpmem, but, in CMake, imported library
does not allow PRIVATE linkage. so pmem::pmem is added to the list of
INTERFACE_LINK_LIBRARIES.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-06 14:37:24 +08:00
Kefu Chai
48e4cd190f cmake: support COMPONENTS param in Findpmem.cmake
add two components: pmem and pmemobj to this package. so we can find
them and link against them in a more intuitive way.

before this change the COMPONENTS parameter passed to

find_package(pmem ...)

is dropped on the floor and ignored.

after this change, it is checked and taken into consideration.

also, in this change, the exposed variables are renamed from

PMEM_* to pmem_*

to be consistent with the package name. it's encouraged to be consistent
with the package name when it comes to the INCLUDE_DIR and LIBRARIES
variable names.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-06 12:25:37 +08:00
Kefu Chai
b502f69ca2 cmake: use NUMA for package name in FindNUMA.cmake
to address the warning from cmake, like

CMake Warning (dev) at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message):
  The package name passed to `find_package_handle_standard_args` (numa) does
  not match the name of the calling package (NUMA).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-02-14 23:11:33 +08:00
Sheng Mao
59a5f333fa cmake: don't pass ccache argument to RocksDB build
RocksDB's cmake has a similar logic to turn on ccache as the main cmake.
Currently BuildRocksDB.cmake explicitly passes ccache to RocksDB cmake
arguments as CMAKE_CXX_COMPILER_LAUNCHER. This causes a compilation error
on ccache 4.0, especially in make -j mode.

ccache: error: Recursive invocation (the name of the ccache binary must
be "ccache")

This commit lets cmake from RocksDB decide RULE_LAUNCH_COMPILE by itself.

Signed-off-by: Sheng Mao <shngmao@gmail.com>
2021-02-09 20:17:53 -07:00
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
Abutalib Aghayev
ab865ca002 os/bluestore: Enable writing data to HM-SMR hard drives.
Signed-off-by: Abutalib Aghayev <agayev@cs.cmu.edu>
2020-05-22 12:37:24 -04:00
Kefu Chai
47ce69aa57 cmake: remove cppcheck and iwyu targets
these targets are not used by any other targets, and are not integrated with CI.
so let's drop them.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-05-13 20:34:27 +08:00
Kefu Chai
b557467df0
Merge pull request #34535 from changchengx/refine_build_liburing
cmake: refactor liburing support

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-04-18 11:39:32 +08:00
Changcheng Liu
36918d7f78 cmake: use cmake module to integrate liburing
1. WITH_LIBURING is used to set HAVE_LIBURING to decide
   use liburing in KernelDevice or not.
2. WITH_SYSTEM_LIBURING is to choose use system installed
   liburing or build the liburing from source code.

Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
2020-04-17 23:22:56 +08:00
Kefu Chai
c9b38a5210 cmake: detect fuse3 as well
Fixes: https://tracker.ceph.com/issues/44891
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-17 14:31:17 +08:00
Kefu Chai
220fa91d80 cmake: check for FUSE version
and refactor FindFUSE.cmake a little bit to conditionalize OSX support

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-17 14:10:55 +08:00
Kefu Chai
b823952d24 cmake: link against FUSE::FUSE
instead of specifying the include directory and linkage separately

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-17 14:10:55 +08:00
Kefu Chai
2b3adb5c5e cmake: rename Findfuse.cmake to FindFUSE.cmake
so its name is consistent with upstream name, and with the variables
exposed by FindFUSE.cmake.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-17 14:10:55 +08:00
Kefu Chai
a05d7179e2 cmake: check $top_srcdir/.git directly
in 0437adc33a, we stop right before
reaching $top_srcdir, but we should stop at its parent directory.

in this change, instead of trying to be smart and to walk all the way
up to the root directory or $top_srcdir, we just check $top_srcdir/.git
directly, as we just know it's there or it does not exist at all.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-08 18:03:37 +08:00
Kefu Chai
ce84ee7856
Merge pull request #34369 from smithfarm/wip-43895
cmake: really stop at top of source code tree

Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-04-08 09:57:04 +08:00
Kefu Chai
b439835cd6 cmake: specify CC when compiling pmem
make always assume that `cc` is available. but we cannot ensure this,
and furthermore, we need to use the compiler specified by user. so
specify `CC` variable when compiling pmem. and reindent the code to fix
the formatting.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-03 13:07:51 +08:00
Kefu Chai
6fca5e7d37 cmake: do not use $(MAKE) in Buildpmem.cmake
we cannot assume that we are using `make` as the cmake generatator,
for instance, if ninja is used, `$(MAKE)` won't be substituted by ninja.
so we need to check if Make is used as generator, if that's the case, we
can just use `$(MAKE)` so we can benefit from the job control of `make`,
otherwise, `make` is used, because currently, PMDK uses Makefile to
build.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-03 13:07:51 +08:00
Kefu Chai
8f7fae7a78 cmake: add find_make() function
it's a shorthand for finding "make" or "gmake" (for FreeBSD), and set
the path to the executable and the command to use in the generated
"Makefile" or whatever build script generated by cmake.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-03 13:07:51 +08:00
Nathan Cutler
0437adc33a cmake: really stop at top of source code tree
Previously, we were recursing right up to /

Patch submitted by Tony Davies via https://tracker.ceph.com

Fixes: https://tracker.ceph.com/issues/43895
Signed-off-by: Tony Davies <anthony.t.davies@gmail.com>
2020-04-03 06:19:09 +02:00
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