Commit Graph

66 Commits

Author SHA1 Message Date
John Mulligan
b9d9529553 do_cmake: support the ubuntu 26.04 version of python in build script
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2026-05-05 10:46:40 -04:00
Dmitrii Sharshakov
d44e67cdc5 do_cmake.sh: support Fedora 43+ with Python 3.14
Fedora 43 changes system Python version to 3.14. Update do_cmake.sh

Tested on Fedora Rawhide as of Jan 1 2026

Ref: https://fedoraproject.org/wiki/Changes/Python3.14

Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
2026-01-05 20:31:51 +01: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
Matan Breizman
fc7597df31 do_cmake.sh: update build type warning
also, use printf instead of cat<<

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
2025-05-08 12:54:19 +00:00
Dan Mick
cf374b677f do_cmake.sh: remove --progress, it's just noise
and is particularly annoying in jenkins logs

Signed-off-by: Dan Mick <dan.mick@redhat.com>
2025-05-07 13:59:12 -07:00
John Mulligan
37a3fd46c5 do_cmake.sh: specify correct python version for centos 10 stream
Update the python version in the same tedious manner for centos 10
stream.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2025-02-20 16:26:37 -05:00
Kefu Chai
4df368381d do_cmake: use Python 3.12 on ubuntu >= 24
the "official" Python shipped along with Ubuntu 24.04 (Noble Numbat) is
Python 3.12. And some of our building have been upgraded to Ubuntu
24.04. But we are still using Python 3.10 on Ubuntu >= 22, this breaks
the build. And CMake fails like:

```
CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Python3 (missing: Python3_EXECUTABLE Python3_INCLUDE_DIRS
  Python3_LIBRARIES Interpreter Development Development.Module
  Development.Embed) (Required is exact version "3.10")

      Reason given by package:
          Interpreter: Wrong version for the interpreter "/bin/python3"

Call Stack (most recent call first):
  /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindPython/Support.cmake:3863 (find_package_handle_standard_args)
  cmake/modules/FindPython3.cmake:545 (include)
  CMakeLists.txt:597 (find_package)
```

This build failure should also happen on developers who build Ceph on
Ubuntu >= 24.

In this change, we use Python 3.12 on Ubuntu >= 24

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2025-02-14 18:53:58 +08:00
Radoslaw Zarzynski
ddb472136b do_cmake.sh: add support for Fedora 41
Otherwise the `EXACT`check for Python version in the root
`CMakeList.txt` fails.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
2024-12-20 19:01:32 +01:00
Casey Bodley
ae0bac968e
Merge pull request #53849 from dvanders/dvanders_alma
install-deps.sh, do_cmake.sh: almalinux is another el flavour

Reviewed-by: John Mulligan <jmulligan@redhat.com>
2024-06-25 16:10:21 +01:00
Kefu Chai
ec0f9cca0f
Merge pull request #56718 from ceph/shallow-submodules
do_cmake.sh: Use shallow submodule clones

Reviewed-by: Kefu Chai <tchaikov@gmail.com>
2024-06-04 07:42:47 +08:00
Zack Cerza
0c345becf8 cmake: Support sccache
Signed-off-by: Zack Cerza <zack@redhat.com>
2024-04-09 16:39:35 -06:00
Zack Cerza
db0eed752e do_cmake.sh: Use shallow submodule clones
Signed-off-by: Zack Cerza <zack@redhat.com>
2024-04-04 15:31:01 -06:00
Zack Cerza
f97a16cfba do_cmake.sh: Use value of ARGS at runtime
The "Building Ceph" section of README.md instructs the user to run:

    ARGS="-DCMAKE_C_COMPILER=gcc-7" ./do_cmake.sh

But, very early on do_cmake.sh was doing ARGS="-GNinja", ignoring the existing
 value.

Signed-off-by: Zack Cerza <zack@redhat.com>
2024-03-14 15:43:36 -06:00
Brad Hubbard
838489f6b1 do_cmake.sh: set python version for Fedora 39
If do_cmake.sh is being exeuted on Fedora 39 set Python version to 3.12.
Remove versions for anything earlier than Fedora 37

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
2023-11-21 10:44:33 +10:00
Rishabh Dave
eb6995436f cmake: add --progress flag to git submodule update commands
Ceph has lots of submodules that needs to be cloned before building
binaries from the repository. Seeing the progress when these submodules
are being cloned is useful, especially when developers/users have a
network issue or a slow network.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2023-10-31 23:14:49 +05:30
Dan van der Ster
6e85f76385 install-deps.sh, do_cmake.sh: almalinux is another el flavour
Signed-off-by: Dan van der Ster <dan.vanderster@clyso.com>
2023-10-05 09:51:34 -07:00
Ilya Dryomov
31eb4d2747
Merge pull request #48672 from nokia/fix_do_cmake_python_for_rocky
do_cmake.sh: build with correct python version on Rocky

Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Kefu Chai <tchaikov@gmail.com>
2023-07-12 11:07:12 +02:00
Rishabh Dave
8b14da0466 do_cmake.sh: set python version for Fedora 37
If do_cmake.sh is being exeuted on Fedora 37 set Python version to 3.11.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
2023-04-05 21:57:26 +05:30
ShimTanny
2574672c2f do_cmake.sh: build with correct python version on rocky os
Fixes: https://tracker.ceph.com/issues/57945

Signed-off-by: ShimTanny <shimon.tanny@nokia.com>
2022-11-03 14:41:45 +02:00
Laura Flores
20d609b4ab do_cmake.sh: build with python3.10 on ubuntu version >= 22.0
Fixes: https://tracker.ceph.com/issues/57230
Signed-off-by: Laura Flores <lflores@redhat.com>
2022-08-23 10:09:11 -05:00
Kefu Chai
3d3b94a9dc do_cmake:sh: use newer gcc if available
despite that we are using clang in `run-make-check.sh`, `do_cmake.sh`
is still used by some workflows like jenkins' ceph-pr-api job.
now that we've migrated to C++20, we need to use GCC-11 or up for
building the tree. GCC-11 is installed from PPA repo in
`install-deps.sh`, but to avoid interfere with the build of older
branches which do not use GCC-11, as their builds might break if
we use GCC-11 for building them. we don't use the alternative machinary
to point gcc to gcc-11, see 8f342a32ce.

so, in this change, we try to use the newest GCC in system when
running `do_cmake.sh`.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-08-05 11:53:12 +08:00
Kefu Chai
7720651ea9 do_cmake:sh: do not set BOOST_J
do_cmake.sh is called by src/script/run-make.sh in configure() function,
in src/script/run-make.sh, BOOST_J is also set if it is not set. so we
can drop the code setting BOOST_J in do_cmake.sh.

this helps to silence the cmake warning like:

CMake Warning:
  Manually-specified variables were not used by the project:

    BOOST_J

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-08-11 17:34:23 +08:00
Kefu Chai
058d56e2c8 do_cmake.sh: use python3.10 for fedora 35
fedora34 was released in April 2021 with Python3.9. while fedora 35
(still Rawhide) will include python3.10. see https://fedoraproject.org/wiki/Releases/35/ChangeSet#Python_3.10

so update the script accordingly.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-06-07 17:53:09 +08:00
Kefu Chai
e7597405c3 do_cmake.sh: refactor code to set PYBUILD
so it is more consistent with rhel/centos part.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-06-07 17:53:09 +08:00
Kefu Chai
d58a88c464 do_cmake: build with python3.9 on RHEL9
rhel9 has python3.9 as of rhel9beta

Signed-off-by: Kaleb S KEITHLEY <kkeithle@redhat.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-06-03 09:34:01 +08:00
Kefu Chai
6dbd4f59f3 do_cmake: always pass -DWITH_PYTHON3 to cmake
do not pretend that we support python2 anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-09 19:13:21 +08:00
Kefu Chai
b05ea0d6e4 do_cmake,run-make: switch to ninja
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-03-09 19:13:21 +08:00
Vladimir Bashkirtsev
50564a60ce do_cmake.sh: do not perform 'git submodule update' if building from tarball
Signed-off-by: Vladimir Bashkirtsev <vladimir@bashkirtsev.com>
2021-01-09 14:36:55 +10:30
luo rixin
1621943c45 do_cmake: add a default value to BOOST_J
Signed-off-by: luo rixin <luorixin@huawei.com>
2020-12-23 17:11:29 +08:00
Sunny Kumar
2cc747cf4a do_cmake.sh: use python-3.9 with fedora version 33
Fedora-33 (rawhide) now has python-3.9.
Build breaks on Fedoa-33 with Traceback:
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find Python3: Found unsuitable version "3.9.0", but required is
  exact version "3.8" (found /usr/bin/python3, found components: Interpreter
  Development)

Fixes: https://tracker.ceph.com/issues/47971
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
2020-10-26 11:42:06 +00:00
Abutalib Aghayev
2f705a7850 do_cmake.sh: do not unnecessarily warn about debug build
do_cmake.sh forgets to check the arguments passed to it and ends up warning
about debug build even if a user specifies a release build.

Signed-off-by: Abutalib Aghayev <agayev@gmail.com>
2020-05-13 17:13:25 -04:00
Kefu Chai
44ec921b44 do_cmake.sh: bail out if something goes wrong
so we can be aware if some updated submodule reference is missing in our
repo

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-02-01 00:14:19 +08:00
Kaleb S. KEITHLEY
5c80bb8f78 do_cmake.sh: fedora-32 (rawhide) build with python-3.8
Fedora-32 now has python-3.8.

Fedora-29 is EOL. All non-EOL versions of Fedora have python-3.7, except
Fedora-32

(Unclear to me why PYBUILD="3" isn't used, like Ubuntu and FreeBSD. That
would eliminate breakage when pyhon versions change in Rawhide.)

Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
2020-01-03 08:34:37 -05: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
d4d31687c3
Merge pull request #30863 from matthewoliver/improve_do_cmake
do_cmake.sh: Add CEPH_GIT_DIR

Reviewed-by: Nathan Cutler <ncutler@suse.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2019-11-23 09:13:13 +08:00
Yuval Lifshitz
354d775e04 rgw/pubsub: add kafka notification endpoint
Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
2019-11-05 19:25:03 +02:00
Matthew Oliver
eb33b30d3d do_cmake.sh: Add CEPH_GIT_DIR
This patch adds a new env variables that users can set to define the
location of the checked out ceph git repo.

The documentation mentions having to go edit the script directly to
point to the ceph git directory if the build dir isn't in the
top directory of the checked out git repo. This patch changes the '..'
into an env variable, CEPH_GIT_DIR, that defaults to '..'. To make it
easy to script and change.

This allows someone to do things like:

 export CEPH_GIT_DIR=~/git/ceph
 ./do_cmake.sh

or

 CEPH_GIT_DIR=~/git/ceph ./do_cmake.sh

Which is much better then editing the script directly.
The README.md has been modified to mention this variable and also
includes a drive by to mention `make -j` for new contributors to
build ceph quicker.

Signed-off-by: Matthew Oliver <moliver@suse.com>
2019-11-04 00:30:09 +00:00
Junyoung, Sung
678c14259f do_cmake: Disable shell command printing feature before cmake execution
Signed-off-by: Junyoung, Sung <junyoung.sung@navercorp.com>
2019-10-25 02:17:59 +09:00
Junyoung, Sung
87ada5fcc8 do_cmake: Warn user about slow debug performance only for not set
Signed-off-by: Junyoung, Sung <junyoung.sung@navercorp.com>
2019-10-25 00:48:59 +09:00
Kefu Chai
6d59402800 do_cmake.sh: enable amqp and rdma for EL8
the PowerTools repo now has the related dependencies, so let's enable
them.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-10-17 22:22:08 +08:00
Kefu Chai
4ea4ddc482 do_cmake.sh: remove -DCMAKE_BUILD_TYPE=Debug from cmake options
so we can use do_cmake.sh for building release builds, which are
required for performance tests.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-10-09 12:26:17 +08:00
Kefu Chai
a118ba0eda do_cmake.sh: disable amqp and rdma on RHEL/CentOS 8
RHEL/CentOS 8 does not offer librabbitmq-devel, libibverbs-devel and
librdmacm-devel at this moment. so disable these features now.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-09-28 22:20:35 +08:00
Kefu Chai
612376a749 do_cmake.sh: set WITH_RADOSGW_AMQP_ENDPOINT using ARGS
so we can extend ARGS in a more unified way

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-09-28 22:20:35 +08:00
Yuval Lifshitz
b8b43fe59d allow for multiple "build" dirs to exist
Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
2019-09-06 09:38:32 +03:00
Kefu Chai
9a47b328b8 do_cmake.sh: specify the supported py versions for different distros
there is chance that a distro offer a newer python3 version than the
supported one, so we need to avoid using the latest python3 version by
specifying the supported python3

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-07-24 00:45:22 +08:00
Brad Hubbard
f313ea3948 do_cmake.sh: Add a heading to the minimal config
Post #28634 the minimal ceph config is invalid without a header.

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
2019-06-28 15:46:30 +10:00
Nathan Cutler
ac8d7c5fd4 do_cmake.sh: use bash
Fixes: http://tracker.ceph.com/issues/39981
Signed-off-by: Nathan Cutler <ncutler@suse.com>
2019-05-20 17:01:40 +02:00
Willem Jan Withagen
46b3d671b4 build: FreeBSD does not have /etc/os-release
So "manually" set requirements

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2019-03-04 11:33:38 +01:00
Nathan Cutler
18d2b2a603 do_cmake.sh: SUSE builds need WITH_RADOSGW_AMQP_ENDPOINT=OFF
Without this patch, "make check" fails on SUSE systems because
WITH_RADOS_AMQP_ENDPOINT defaults to "ON".

Signed-off-by: Nathan Cutler <ncutler@suse.com>
2019-02-28 14:56:55 +01:00
Mark Nelson
d433522ae9 do_cmake: Warn user about slow debug performance by default.
Signed-off-by: Mark Nelson <mnelson@redhat.com>
2018-12-12 12:09:57 -06:00