From 1b02531634b1e253d96370de699afcbc7d315116 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Tue, 20 May 2025 09:12:18 +0000 Subject: [PATCH] doc/README: add Build Types section Originated from: https://tracker.ceph.com/issues/71360 Signed-off-by: Matan Breizman --- README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 74185ffb4a840..2368fb8534219 100644 --- a/README.md +++ b/README.md @@ -84,10 +84,8 @@ To build Ceph, follow this procedure: ./do_cmake.sh - ``do_cmake.sh`` by default creates a "debug build" of Ceph, which can be - up to five times slower than a non-debug build. Pass - ``-DCMAKE_BUILD_TYPE=RelWithDebInfo`` to ``do_cmake.sh`` to create a - non-debug build. + See [build types](#build-types). + 3. Move into the `build` directory: cd build @@ -127,8 +125,18 @@ To build Ceph, follow this procedure: ninja install - +## Build Types + +``do_cmake.sh`` by default creates a "debug build" of Ceph (assuming `.git` exists). +A ``Debug`` build runtime performance may be as little as 20% of that of a non-debug build. +Pass ``-DCMAKE_BUILD_TYPE=RelWithDebInfo`` to ``do_cmake.sh`` to create a +non-debug build. +The default build type is ``RelWithDebInfo`` once `.git` does not exist. +| CMake mode | Debug info | Optimizations | Sanitizers | Checks | Use for | +| ------------------- | ---------- | -------------------|-------------------- | -------------------------| ------------------| +| `Debug` | Yes | `-Og` | None | `ceph_assert`, `assert` | gdb, development | +| `RelWithDebInfo` | Yes | `-O2`, `-DNDEBUG` | None | `ceph_assert` only | production | ### CMake Options -- 2.39.5