Commit Graph

691 Commits

Author SHA1 Message Date
Casey Bodley
58fe0aad9a
Merge pull request #65916 from edwinzrodriguez/ceph-cmake4
cmake: add cmake 4 support

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2025-10-21 11:07:42 -04:00
Kefu Chai
3aef9fc059
Merge pull request #65408 from tchaikov/wip-suppress-asan-warnings
qa/{asan,lsan}.supp: suppress Python module and libstdc++ false positives

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2025-10-21 08:18:45 +08:00
Edwin Rodriguez
802195ec97 cmake: add cmake 4 support
This change improves the CMAKE variable detection logic in do_cmake.sh
to allow users to override the CMAKE binary used for building.

Changes:
- Add conditional check to only set CMAKE if not already set
- Add detection for cmake version 4.x and later (prioritized)
- Maintain backward compatibility with cmake3 fallback
- Allow users to specify custom CMAKE path via environment variable
- Pass CMAKE_POLICY_VERSION_MINIMUM if set to submodule build steps for
    older modules

This enables users to use a specific cmake binary by setting the CMAKE
environment variable before running the script:
  CMAKE=/custom/path/to/cmake ./do_cmake.sh

Additionally, the script now automatically detects and uses cmake 4.x+
when available, falling back to cmake3 or cmake as needed. This supports
building Ceph with newer cmake versions while maintaining compatibility
with existing build environments.

Fixes: https://tracker.ceph.com/issues/73523
Signed-off-by: Edwin Rodriguez <edwin.rodriguez1@ibm.com>
2025-10-20 17:02:57 -04:00
Casey Bodley
9d92dbb2cb cmake: BuildArrow.cmake uses bundled thrift if system version < 0.17
the bump to arrow 17.0.0 broke the ubuntu jammy builds with:

In file included from /usr/include/thrift/transport/TTransport.h:25,
                 from /usr/include/thrift/protocol/TProtocol.h:28,
                 from /usr/include/thrift/TBase.h:24,
                 from /build/ceph-20.3.0-3599-g3d863d32/src/arrow/cpp/src/generated/parquet_types.h:14,
                 from /build/ceph-20.3.0-3599-g3d863d32/src/arrow/cpp/src/generated/parquet_constants.h:10,
                 from /build/ceph-20.3.0-3599-g3d863d32/src/arrow/cpp/src/generated/parquet_constants.cpp:7:
/usr/include/thrift/transport/TTransportException.h:23:10: fatal error: boost/numeric/conversion/cast.hpp: No such file or directory
   23 | #include <boost/numeric/conversion/cast.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

when comparing the gcc command line with arrow-15.0.0, the following argument
is no longer present:
> -isystem /build/ceph-20.3.0-3402-gb2db4947/obj-x86_64-linux-gnu/boost/include

arrow 17.0.0 seems to assume that thrift doesn't depend on boost anymore. a
comment in https://github.com/apache/arrow/issues/32266 claims that
> we don't need Boost with system Thrift 0.17.0 or later

but our jammy builds are stuck with libthrift-0.16.0. to reenable jammy builds,
instruct Arrow's cmake to use its bundled thrift dependency if our system thrift
version is < 0.17.0

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2025-10-15 17:08:55 -04:00
Casey Bodley
dd868a9e53 cmake: Findthrift.cmake parses version string
when thrift headers are found, parse the version string into a
cmake variable and pass it to find_package_handle_standard_args

this will be needed by BuildArrow.cmake for some conditional logic

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2025-10-15 17:06:43 -04:00
Kefu Chai
2defde30e4 cmake/BuildArrow: Use AUTO mode for xsimd dependency detection
Arrow requires xsimd >= 9.0.1 according to arrow/cpp/thirdparty/versions.txt.
Previously, we unconditionally set -Dxsimd_SOURCE=BUNDLED, forcing the use
of Arrow's vendored xsimd regardless of system package availability.

This commit changes to -Dxsimd_SOURCE=AUTO, which allows Arrow's
resolve_dependency mechanism to automatically:
1. Try to find system xsimd package
2. Check if version >= 9.0.1
3. Use system version if found and sufficient
4. Fall back to bundled version otherwise

This reduces build time and dependencies on systems with sufficient xsimd,
while maintaining compatibility with older distributions.

Distribution availability:
- Ubuntu Noble (24.04): libxsimd-dev 12.1.1 (✓ will use system)
- Ubuntu Jammy (22.04): libxsimd-dev 7.6.0 (✗ will use bundled)
- Debian Trixie (13): libxsimd-dev 13.2.0 (✓ will use system)
- CentOS Stream 9: xsimd-devel 7.4.9 (✗ will use bundled)

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
2025-10-15 15:49:09 +08:00
John Mulligan
8258d27043 pybind/mgr: add default set of cmake/ctest labels to tests
Add a pair of default test labels (`PurePython` and `PythonTox`) to the
tests generated by the add_tox_test cmake function. In addition, the
function can extend the set of labels applied with a new LABELS argument
to the cmake function.

Using the label can be done with something like:
```
ctest -L PythonTox -j8
```

Note that these tests are labeled PurePython because they do not
require C extensions to be built. The above example command can
be run successfully immediately after configuring, without having
to build the C++ sources first.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2025-09-26 19:10:35 -04:00
Kefu Chai
b3d0d73c58 qa/{asan,lsan}.supp: suppress Python module and libstdc++ false positives
Add suppression rules for two categories of false positive warnings
encountered during ASan-enabled testing:

1. PyModule_ExecDef memory leaks: ASan incorrectly interprets Python's
   module loading behavior as memory leaks when the interpreter loads
   extension modules.

2. __cxa_throw interception failures: ASan's interceptor cannot properly
   intercept exception handling when libstdc++.so is loaded after the
   ASan shared library, causing CHECK failures.

3. ErasureCodePluginRegistry::load:
   `ceph::ErasureCodePluginRegistry::load()` is known to leak, as we
   don't free the memory allocated by the ec plugins which are
   registered in the `ErasureCodePluginRegistry` singleton. this is a
   known issue, but since the `ErasureCodePluginRegistry` instance is a
   singleton. we can live with it. in this change, we add the rule to
   suppress the leak report from LeakSanitizer. this rule also exist in
   qa/valgrind.supp.

All warnings are confirmed false positives that should be suppressed
to reduce noise in test output.

Example warnings:

```
Direct leak of 3264 byte(s) in 1 object(s) allocated from:
    #0 0x7f6027d20cb5 in malloc /usr/src/debug/gcc/gcc/libsanitizer/asan/asan_malloc_linux.cpp:67
    #1 0x7f60277557ad  (/usr/lib/libpython3.13.so.1.0+0x1557ad) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #2 0x7f6027756067  (/usr/lib/libpython3.13.so.1.0+0x156067) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #3 0x7f60278471a0  (/usr/lib/libpython3.13.so.1.0+0x2471a0) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #4 0x7f602774d031  (/usr/lib/libpython3.13.so.1.0+0x14d031) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #5 0x7b60234093bb in __Pyx_modinit_type_init_code.constprop.0 /home/kefu/dev/ceph/build/src/pybind/rados/rados.c:82066
    #6 0x7b602340a826 in __pyx_pymod_exec_rados /home/kefu/dev/ceph/build/src/pybind/rados/rados.c:82755
    #7 0x7f6027856777 in PyModule_ExecDef (/usr/lib/libpython3.13.so.1.0+0x256777) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #8 0x7f602785baa3  (/usr/lib/libpython3.13.so.1.0+0x25baa3) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #9 0x7f6027793df2  (/usr/lib/libpython3.13.so.1.0+0x193df2) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #10 0x7f6027777cbe in _PyEval_EvalFrameDefault (/usr/lib/libpython3.13.so.1.0+0x177cbe) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #11 0x7f60277957de  (/usr/lib/libpython3.13.so.1.0+0x1957de) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #12 0x7f60277d11b9 in PyObject_CallMethodObjArgs (/usr/lib/libpython3.13.so.1.0+0x1d11b9) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #13 0x7f60277d0ee4 in PyImport_ImportModuleLevelObject (/usr/lib/libpython3.13.so.1.0+0x1d0ee4) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #14 0x7f6027779c0c in _PyEval_EvalFrameDefault (/usr/lib/libpython3.13.so.1.0+0x179c0c) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #15 0x7f602784e2c8 in PyEval_EvalCode (/usr/lib/libpython3.13.so.1.0+0x24e2c8) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #16 0x7f602788c88b  (/usr/lib/libpython3.13.so.1.0+0x28c88b) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #17 0x7f602788985c  (/usr/lib/libpython3.13.so.1.0+0x28985c) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #18 0x7f6027886f57  (/usr/lib/libpython3.13.so.1.0+0x286f57) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #19 0x7f6027886211  (/usr/lib/libpython3.13.so.1.0+0x286211) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #20 0x7f6027885b82  (/usr/lib/libpython3.13.so.1.0+0x285b82) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #21 0x7f6027883e50 in Py_RunMain (/usr/lib/libpython3.13.so.1.0+0x283e50) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #22 0x7f602783bbea in Py_BytesMain (/usr/lib/libpython3.13.so.1.0+0x23bbea) (BuildId: bea05fc2c8bd66145b159f10dcd810ebe813af39)
    #23 0x7f6027227674  (/usr/lib/libc.so.6+0x27674) (BuildId: 4fe011c94a88e8aeb6f2201b9eb369f42b4a1e9e)
    #24 0x7f6027227728 in __libc_start_main (/usr/lib/libc.so.6+0x27728) (BuildId: 4fe011c94a88e8aeb6f2201b9eb369f42b4a1e9e)
    #25 0x55dae17e6044 in _start (/usr/bin/python3.13+0x1044) (BuildId: 8c0dc848f5b978c56ebeb07255bb332b4b37ae4e)
```

```
AddressSanitizer: CHECK failed: asan_interceptors.cpp:335 "((__interception::real___cxa_throw)) != (0)" (0x0, 0x0) (tid=3246455)
    #0 0x7f345ea81979 in CheckUnwind ../../../../src/libsanitizer/asan/asan_rtl.cpp:69
    #1 0x7f345eaa790d in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:86
    #2 0x7f345e9e1d54 in __interceptor___cxa_throw ../../../../src/libsanitizer/asan/asan_interceptors.cpp:335
    #3 0x7f345e9e1d54 in __interceptor___cxa_throw ../../../../src/libsanitizer/asan/asan_interceptors.cpp:334
    #4 0x7f3458623def in void boost::throw_exception<boost::bad_lexical_cast>(boost::bad_lexical_cast const&) /opt/ceph/include/boost/throw_exception.hpp:165
    #5 0x7f345997ad3b in void boost::conversion::detail::throw_bad_cast<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned long>() /opt/ceph/include/boost/lexical_cast/bad_lexical_cast.hpp:93
    #6 0x7f3459979d35 in unsigned long boost::lexical_cast<unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /opt/ceph/include/boost/lexical_cast.hpp:43`
```

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2025-09-06 08:52:02 +08:00
David Galloway
c52e361fdd uadk: Build with ceph fork (for FORTIFY_SOURCE fix)
See https://github.com/ceph/ceph/pull/65371

Signed-off-by: David Galloway <david.galloway@ibm.com>
2025-09-04 13:27:36 -04:00
David Galloway
fa39f1c504
Merge pull request #65316 from dmick/uadk-ftbfs
Fix uadk build (arm64 only) on debian (conflict with DESTDIR)
2025-09-02 13:45:41 -04:00
Kefu Chai
6744b653da
Merge pull request #65192 from tchaikov/wip-cmake-silence-lsan
cmake: disable LeakSanitizer suppression output to fix CLI tests

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2025-08-30 16:29:27 +08:00
Dan Mick
1c14d3cd53 cmake/modules/Builduadk.cmake: fix build
DESTDIR should not be set when building.

Fixes: https://tracker.ceph.com/issues/72722
Signed-off-by: Dan Mick <dan.mick@redhat.com>
2025-08-30 00:43:13 -07:00
Dan Mick
1cd5aa4e03 cmake/modules/Builduadk.cmake: fix tabs/spaces
Signed-off-by: Dan Mick <dan.mick@redhat.com>
2025-08-30 00:37:16 -07:00
Kefu Chai
65bede2080 cmake: disable LeakSanitizer suppression output to fix CLI tests
LeakSanitizer prints matched suppressions by default, which causes CLI
tests to fail when built with LSan enabled. The tests compare actual
output against expected output, and the additional LSan messages break
this comparison.

Example failure:

```
/home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t: failed
--- /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t
+++ /home/jenkins-build/build/workspace/ceph-pull-requests/src/test/cli/ceph-kvstore-tool/help.t.err
@@ -21,3 +21,9 @@
     stats
     histogram [prefix]

+  -----------------------------------------------------
+  Suppressions used:
+    count      bytes template
+        1         45 ^MallocExtension::Initialize
+  -----------------------------------------------------
+
```

Set LSAN_OPTIONS=print_suppressions=0 to prevent this output rather
than modifying test expectations, since the suppression messages are
not part of the actual tool output and would vary between builds.

This change should fix run_cli_tests failures when building with LeakSanitizer

See https://github.com/google/sanitizers/wiki/SanitizerCommonFlags
for the environment variables respected by LeakSanitizer.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2025-08-23 15:53:54 +08:00
Dan Mick
f5e160edde uadk: build with ceph fork (fix for __DATE__ usage)
Signed-off-by: Dan Mick <dan.mick@redhat.com>
2025-08-20 14:08:56 -07:00
Kefu Chai
e298be566c cmake/modules/FindBoost: add support for Boost 1.88.0
Add Boost 1.88.0 to the supported versions list and update component
dependencies to eliminate build warnings.

This resolves the following warning when building with Boost 1.88.0:

```
-- Found Boost: /usr/include (found suitable version "1.88.0", minimum required is "1.73.0")
CMake Warning at cmake/modules/FindBoost.cmake:1413 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  cmake/modules/FindBoost.cmake:1538 (_Boost_COMPONENT_DEPENDENCIES)
  cmake/modules/FindBoost.cmake:2157 (_Boost_MISSING_DEPENDENCIES)
  src/CMakeLists.txt:461 (_find_package)
  src/seastar/cmake/SeastarDependencies.cmake:136 (find_package)
  src/seastar/CMakeLists.txt:395 (seastar_find_dependencies)
```

Boost 1.88.0 was released on April 3, 2025, and is already available
in some distributions. Since many distributions don't yet ship Boost's
native CMake configuration files, our vendored FindBoost.cmake module
needs updating to handle this version.

The component dependencies were updated following the scanning procedure
documented in the _Boost_COMPONENT_DEPENDENCIES() function. The change
will be upstreamed to CMake shortly.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2025-06-30 13:15:39 +08:00
Kefu Chai
8b3abdd315 cmake/modules/FindBoost: sync with upstream FindBoost.cmake
Update our local FindBoost.cmake module to match CMake upstream's
latest version to properly handle Boost component dependencies.

While commit b446290f prevented warnings when checking Boost 1.87,
it failed to update the boost component dependency mappings. This
change synchronizes our module with upstream to ensure correct
dependency resolution.

Additionally, this prepares for Boost 1.88.0 support (released
April 3, 2025) which some distributions have already adopted.
Since CMake upstream hasn't yet added 1.88 support, this sync
provides the foundation for adding 1.88.0 compatibility in a
subsequent commit.

Changes made:
- Sync with upstream CMake FindBoost.cmake (commit 17726227)
  (at 1772622772/Modules/FindBoost.cmake)
- Reapply local modifications from commit 06824bc1

Note: New dependencies can be scanned using:
```
cmake -DBOOST_DIR=/path/to/boost_1_88_0 -P
  Utilities/Scripts/BoostScanDeps.cmake
```

Signed-off-by: Kefu Chai <tchaikov@gmail.com>

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 <tchaikov@gmail.com>
2025-06-30 13:15:39 +08:00
Kefu Chai
448633e325 cmake: use find_program(REQUIRED) to fail early on missing programs
Since upgrading minimum CMake version to 3.22.1 (commit 469d82a1), we can
now use find_program(REQUIRED) which was introduced in CMake 3.18.

This change replaces manual FATAL_ERROR checks with the REQUIRED option
and adds it to programs that are actually needed during the build. This
ensures the build fails early during configuration rather than later
during compilation when missing programs are invoked.

Changes:
- Replace find_program() + message(FATAL_ERROR) patterns with REQUIRED
- Add REQUIRED to programs that are used during build but previously
  had no error checking

Reference: https://cmake.org/cmake/help/latest/command/find_program.html

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2025-06-17 17:30:10 +08:00
Kefu Chai
8886bdd953 cmake: drop c-ares::c-ares alias
Remove the c-ares::c-ares alias that was causing build failures after
bumping the minimum CMake version:

```
CMake Error at cmake/modules/Findc-ares.cmake:34 (add_library):
  add_library cannot create ALIAS target "c-ares::c-ares" because another
  target with the same name already exists.
Call Stack (most recent call first):
  src/CMakeLists.txt:463 (_find_package)
  src/seastar/cmake/SeastarDependencies.cmake:136 (find_package)
  src/seastar/CMakeLists.txt:395 (seastar_find_dependencies)`
```

The alias was originally added for backward compatibility with Seastar,
but is no longer needed since the updated Seastar submodule no longer
references the c-ares::c-ares target.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2025-06-13 16:23:49 +08:00
Jesse F. Williamson
9bdc4e1a02 Improve Catch2 support by adding helper functions.
Makes it less tedious to add a new Catch2 test with CMake.

Signed-off-by: Jesse F. Williamson <jfw@ibm.com>
2025-05-29 08:39:21 -07:00
Jesse F. Williamson
12664b615e Add support for Catch2
Makes Catch2 available for C++ unit tests;
Adds GPM script availability to CMake.
Adds rudimentary test for rgw_hex.

Signed-off-by: Jesse F. Williamson <jfw@ibm.com>
2025-05-02 10:54:58 -07:00
Kefu Chai
98b61ace4b cmake: Fix b2 build with postfixed compiler versions
Previously, the build process used `bootstrap.sh` to build the b2 tool,
which automatically selected the compiler based on the specified toolset.
This failed when the compiler executable had a version postfix (e.g.,
/usr/bin/clang++-19) without a symlink at the expected name, producing
errors like:

```
A C++11 capable compiler is required for building the B2 engine.
Toolset 'clang' does not appear to support C++11.

> clang++ -x c++ -std=c++11 -pthread  check_clib.cpp check_cxx11.cpp
./tools/build/src/engine/build.sh: 120: clang++: not found
> clang++ -x c++ -std=c++11  check_clib.cpp check_cxx11.cpp
./tools/build/src/engine/build.sh: 120: clang++: not found

** Note, the C++11 capable compiler is _only_ required for building the B2
** engine. The B2 build system allows for using any C++ level and any other
** supported language and resource in your projects.

You can specify the toolset as the argument, i.e.:
    ./build.sh [options] gcc
```

The issue occurred because `bootstrap.sh` hardcodes the compiler name
based on the toolset (e.g., `clang++` for Clang) without supporting
postfixed versions.

This commit replaces the `bootstrap.sh` approach with an explicit build
command using Boost's `build.sh` script. We now:
1. Directly specify the full compiler path from CMake variables
2. Manually configure the build with `--cxx=...` and `--toolset=...`
3. Avoid reliance on symlinks or `bootstrap.sh`'s internal detection

This ensures the B2 engine is always built with the user-specified
compiler, even when installed with version postfixes.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2025-04-22 11:35:34 +08:00
Adam Emerson
83e3eaf500
Merge pull request #62580 from Matan-B/wip-matanb-findboost-warning
cmake/modules/FindBoost.cmake: fix Boost_NO_WARN_NEW_VERSIONS

Reviewed-by: Adam Emerson <aemerson@redhat.com>
2025-04-09 16:17:09 -04:00
Kefu Chai
27e9d56304 cmake: disable deprecated warning when building googletest
In commit 986f6918, we updated the googletest submodule to silence a
CMake warning. However, this change broke the build due to a Clang issue
where it warns about deprecated declarations even from system headers
(see https://github.com/llvm/llvm-project/issues/76515). Since we use
`-Werror` in our compile options, these warnings become errors and fail
the build.

This change detects if we're affected by the specific combination of
compiler, standard library, and compile options that triggers this
issue. It then conditionally disables the `-Wdeprecated-declarations`
warning when building googletest to resolve build failures caused by
deprecated functions like `get_temporary_buffer<>` in the standard
library.

The build failure looks like:
```
FAILED: src/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
...
In file included from /home/jenkins-build/build/workspace/ceph-pull-requests/src/googletest/googletest/src/gtest-all.cc:38:
In file included from /home/jenkins-build/build/workspace/ceph-pull-requests/src/googletest/googletest/include/gtest/gtest.h:55:
In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/memory:66:
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tempbuf.h:263:8: error: 'get_temporary_buffer<testing::TestInfo *>' is deprecated [-Werror,-Wdeprecated-declarations]
  263 |                 std::get_temporary_buffer<value_type>(_M_original_len));
      |                      ^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h:4996:15: note: in instantiation of member function 'std::_Temporary_buffer<__gnu_cxx::__normal_iterator<testing::TestInfo **, std::vector<testing::TestInfo *>>, testing::TestInfo *>::_Temporary_buffer' requested here
 4996 |       _TmpBuf __buf(__first, (__last - __first + 1) / 2);
      |               ^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h:5070:23: note: in instantiation of function template specialization 'std::__stable_sort<__gnu_cxx::__normal_iterator<testing::TestInfo **, std::vector<testing::TestInfo *>>, __gnu_cxx::__ops::_Iter_comp_iter<(lambda at /home/jenkins-build/build/workspace/ceph-pull-requests/src/googletest/googletest/src/gtest.cc:3024:20)>>' requested here
 5070 |       _GLIBCXX_STD_A::__stable_sort(__first, __last,
      |                       ^
/home/jenkins-build/build/workspace/ceph-pull-requests/src/googletest/googletest/src/gtest.cc:3023:8: note: in instantiation of function template specializatio
```

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2025-04-02 11:35:45 +08:00
Matan Breizman
9cb8a4d147 cmake/modules/FindBoost.cmake: fix Boost_NO_WARN_NEW_VERSIONS
https://github.com/ceph/ceph/pull/61084 bumped up the version used to
1.87. The warning should be for 1.88, same as it was 1.86 when we used
1.85.

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

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
2025-03-31 14:27:40 +00:00
Kefu Chai
47b843c377 common: disable OpenSSL engine support if it is disabled
OpenSSL 3.0 documentation recommends moving from the ENGINE API to the
Providers API. Recent distributions may compile OpenSSL without engine
support by default, necessitating more flexible configuration handling.

So, in this change:

- Add a CMake option `WITH_OPENSSL_ENGINE` to explicitly control engine support
- Respect `openssl_engine_opts` when engine support is enabled
- Provide clear error messaging when engine options are set but support is disabled

See also:
- OpenSSL 3.0 documentation:
https://wiki.openssl.org/index.php/OpenSSL_3.0#Engines_and_.22METHOD.22_APIs

Fixes: https://tracker.ceph.com/issues/68059
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2025-03-28 08:54:19 +08:00
Adam C. Emerson
b446290f44
build: Upgrade to Boost 1.87
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2025-03-12 10:28:22 -04:00
Matan Breizman
56c37d7035 cmake/modules/BuildISAL.cmake: set no-integrated-as on clang only
this option is only relevant to clang, gcc will fail with:
```
CMake Error at ceph/build/src/erasure-code/isa/isal_ext-prefix/src/isal_ext-stamp/isal_ext-configure-Debug-impl.cmake:19 (message):
  Command failed (77):

   'env' 'CC=/usr/bin/gcc-11' './configure' '--prefix=ceph/build/src/isa-l/install' '--with-pic' '--enable-static' '--disable-shared' 'CFLAGS=-no-integrated-as'
```

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
2025-03-02 08:48:31 +00:00
Matan Breizman
0ceefb407d cmake/modules/BuildISAL.cmake: use GNU assembler
avoid the following error by disabling clang assembler:
```
[670/2691] Performing build step for 'isal_ext'
FAILED: src/erasure-code/isa/isal_ext-prefix/src/isal_ext-stamp/isal_ext-build src/isa-l/install/lib/libisal.a /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/erasure-code/isa/isal_ext-prefix/src/isal_ext-stamp/isal_ext-build /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/isa-l/install/lib/libisal.a
cd /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/isa-l && /usr/bin/cmake -P /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/erasure-code/isa/isal_ext-prefix/src/isal_ext-stamp/isal_ext-build-Debug.cmake && /usr/bin/cmake -E touch /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/erasure-code/isa/isal_ext-prefix/src/isal_ext-stamp/isal_ext-build
CMake Error at /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/erasure-code/isa/isal_ext-prefix/src/isal_ext-stamp/isal_ext-build-Debug.cmake:37 (message):
  Command failed: 2

   '/usr/bin/cmake' '-E' 'env' '--unset=DESTDIR' 'make' '-j3'

  See also

    /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/build/src/erasure-code/isa/isal_ext-prefix/src/isal_ext-stamp/isal_ext-build.log

-- Log output is:
...skipping to end...
hile in macro instantiation
crc64_refl_func crc64_ecma_refl_pmull
^
<instantiation>:2:26: error: unexpected token in argument list
 movk x7, p1_low_b1, lsl 16
                         ^
<instantiation>:54:2: note: while in macro instantiation
 crc64_fold_512b_to_128b
 ^
crc/aarch64/crc64_ecma_refl_pmull.S:33:1: note: while in macro instantiation
crc64_refl_func crc64_ecma_refl_pmull
^
<instantiation>:3:26: error: unexpected token in argument list
 movk x7, p1_low_b2, lsl 32
                         ^
```

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
2025-02-24 16:02:08 +00:00
Matan Breizman
6d927cb052 cmake/modules/BuildQATzip: Disable errors
qatzip/configure.ac enables -Werror. However, newer compilers
(e.g clang 16) will not compile with the existing warnings
identified. The fixes for the warnings are not merged yet [1]
in the submodule. Until then, in order to allow for compiler
upgrade - we should disable the problematic errors.

[1] https://github.com/intel/QATzip/pull/119

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
2025-02-20 14:18:12 +00:00
Rongqi Sun
87df76e84f build/uadk: fix uadk repo's commit id
Signed-off-by: Rongqi Sun <sunrongqi@huawei.com>
2024-11-27 02:32:36 +00:00
Casey Bodley
f1855782d4
Merge pull request #59513 from cbodley/wip-isal-ext
cmake: use ExternalProjects to build isa-l and isa-l_crypto libraries

Reviewed-by: Jamie Pryde <jamiepry@uk.ibm.com>
Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Reviewed-by: Mark Kogan <mkogan@ibm.com>
2024-10-03 11:31:29 -04:00
Effi Ofer
dc8eed68ce librbd/migration: add nbd stream
Co-authored-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Effi Ofer <effio@il.ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2024-09-06 14:14:12 +02:00
Casey Bodley
926ef939e7 cmake/ec: use ExternalProject to build isal library
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-09-05 13:19:23 -04:00
Casey Bodley
3bfc1ae3d7 cmake/crypto: use ExternalProject to build isal crypto library
instead of building isa-l_crypto source files directly into the
ceph_crypto_isal plugin, use a cmake ExternalProject to build the
library with make and expose the static library as cmake target
ISAL::Crypto

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-09-05 13:19:21 -04:00
Rongqi Sun
317465c07b uadk: add uadk support
This patch add UADK Acceleration for zlib compressor

[UADK: Userspace Acceleration Development Kit](https://github.com/Linaro/uadk)

1. Unity: one set of interfaces to support enc and comp acceleration
2. Efficiency: userspace zerocopy based on IOMMU & SVA(shared virtual address)
3. Security: the IOMMU limits the access rights and security boundaries of devices and processes
4. Compatibility: all acc devices can join this opensource project

Test on Kunpeng 920 platform, compression offload based on UadkAccel:

1. save almost 50% cpu usage compared with no-isal compression in RBD 4M workload
2. save almost 40% cpu usage compared with no-isal compression in RGW put op (4M) workload
3. lower cpu usage, better performance

Signed-off-by: Rongqi Sun <sunrongqi@huawei.com>
2024-08-12 18:10:00 +08:00
Yuri Weinstein
3585ce7569
Merge pull request #56224 from ibm-s390-cloud/master-s390x-crc32c
crc32c optimized for s390x arch

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Ilya Dryomov <idryomov@redhat.com>
2024-07-30 07:49:11 -07:00
Casey Bodley
52be40e256 cmake/os: remove WITH_ZFS option
when enabled and found, the os_zfs_objs target would reference a missing
file filestore/ZFSFileStoreBackend.cc and cmake would fail to configure

i take this to mean that WITH_ZFS was accidentally left over from
filestore's removal. drop all references to WITH_ZFS, along with the
corresponding Findzfs.cmake script

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-07-03 14:52:03 -04:00
Adam Emerson
3d36ac2d0b build: Bump Boost to 1.85
Signed-off-by: Adam Emerson <aemerson@redhat.com>
2024-05-22 21:38:33 -04:00
Adam Emerson
dd54e6bf57 build: Prefer Ceph's mirror of boost and add boost archive
Since jfrog goes down from time to time, put it last in the list for
now.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
2024-05-22 15:55:43 -04:00
Adam Emerson
3543542078 build: Make boost_url a list
Cmake 3.29 does not appreciate a space separated string being
substituted in.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
2024-05-22 14:38:21 -04:00
Aliaksei Makarau
4d1dacf87e
crc32c optimized for s390x arch
Fixes: https://tracker.ceph.com/issues/64952
Signed-off-by: Aliaksei Makarau <aliaksei.makarau@ibm.com>
2024-05-22 19:45:37 +02:00
J. Eric Ivancich
1dd82d996a
Merge pull request #56585 from ivancich/wip-upgrade-arrow+flight-15.0.2
rgw: upgrade Apache Arrow submodule to 15.0.0

Reviewed-by: Casey Bodley <cbodley@redhat.com>
2024-05-10 12:22:43 -04:00
Zack Cerza
be709462ad cmake: Intelligently set job limits for sccache
If we are correctly configured for distributed mode, use the cluster's CPU count
instead of ours. If we are configured for sccache but without distributed mode,
inform the user but continue with normal job limits.

Signed-off-by: Zack Cerza <zack@redhat.com>
2024-05-06 14:03:14 -06:00
J. Eric Ivancich
70c28bd1fd Upgrade Apache Arrow to 15.0.0.
Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
2024-05-02 11:12:10 -04:00
Samarah Uriarte
979452a122 rgw/cache: This commit squashes commits related to boost::redis library.
RGW: Add boost_redis library
RGW: Add boost_redis to CMake
RGW: Add aedis methods to RedisDriver
RGW: Minor RedisDriver cleanup
build: Remove build/boost_redis
build: remove src/redis
build: Set src/boost_redis submodule to release version
RGW: Remove broken boost_redis
RGW: Add boost_redis
rgw: Get rgw_redis_driver to build
rgw/redis: Update `boost::redis` library
rgw/cache: fixing compilation error, by removing aedis header
file and src file includes from redis driver

Signed-off-by: Samarah <samarah.uriarte@ibm.com>
Co-authored-by: Adam Emerson <aemerson@redhat.com>
Co-authored-by: Pritha Srivastava <prsrivas@redhat.com>
2024-04-02 21:24:50 +05:30
Kefu Chai
02155b4ffc cmake: suppress LeakSanitizer reports of known leaks
there are known leaks, which are tracked by qa/lsan.suppr, in Ceph.
so let's reuse it so we don't see them when running unit test with
ASan enabled.

see also https://clang.llvm.org/docs/AddressSanitizer.html#issue-suppression

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2024-03-27 07:35:28 +08:00
Kefu Chai
a837f494b5 cmake: prevent ASAN_OPTIONS from detect_odr_violation
turns out we have multiple copies of following symbol defined by rbd executable:
```
AddressSanitizer: odr-violation: global 'ceph::buffer::list::always_empty_bptr' at /home/jenkins-build/build/workspace/ceph-pull-requests/src/common/buffer.cc:1267:34
```
before addressing it. let's disable this warning.

Refs https://tracker.ceph.com/issues/65098

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2024-03-27 07:35:28 +08:00
Kefu Chai
d22734f6cb cmake: add ${CMAKE_SHARED_LINKER_FLAGS} to LDFLAGS when building python extensions
if sanitizers are enabled, we have to populate the required link flags
to python extensions's building workflow. otherwise ld would fail to
link like:
```
/usr/bin/ld: /home/jenkins-build/build/workspace/ceph-pull-requests/build/lib/libceph-common.so.2: undefined reference to `__asan_stack_free_10'
```

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2024-03-27 07:35:28 +08:00
Kefu Chai
a13a61d63d cmake: error out on UBSan error
so we can be alerted if UBSan identify something wrong.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2024-03-27 07:35:28 +08:00