Commit Graph

41 Commits

Author SHA1 Message Date
Kefu Chai
66b1e8cecd cmake: check for python(\d)\.(\d+) when building boost
now that python3.10 has two digits as its minor version, we should be
able to match it.

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

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

when building with python3.10

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2021-11-19 00:27:34 +08:00
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
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
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
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
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
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
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
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
5e2bd7fc4d cmake: update FindPython* modules
use the ones shiped from the latest cmake. which

* enables us to find the recent python intepreter and development files,
* find intepreter and development in a single `find_pacakge()` command,
  simpler this way and less error prone.

and to accomodate this change:

* all `PYTHON${PYTHON_VERSION}_*` variables are renamed to
  `Python${PYTHON_VERSION}_*` if we use `find_package(Python2...)` or
  `find_package(Python3...)` to find python2 or python3 instead of using
  `find_package(Python...)`.
* use "2" explicitly when using python2, as `Python_*` variables are not
  defined anymore
* when compiling python support of ceph-mgr, continue using `Python_*`
  variables. because we find the python interpreter and development
  files using `find_pacakge(Python...)` for ceph-mgr.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-07-20 22:35:07 +08:00
Kefu Chai
dadc66a58e
Merge pull request #28843 from tchaikov/wip-armhf-build
cmake, pybind: fix build on armhf

Reviewed-by: Casey Bodley <cbodley@redhat.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
2019-07-09 16:03:35 +08:00
Kefu Chai
2fa4013818 cmake/modules/BuildBoost.cmake: fix build for armhf
see also
https://www.boost.org/doc/libs/1_70_0/libs/context/doc/html/context/architectures.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-07-02 23:40:21 +08:00
Jason Dillaman
b595568218 cmake: boost valgrind fixes for boost::lockfree::queue
The issue has been fixed upstream under lockfree commit
7e23dac52d08ed1a099de9a6fb8bcdefbb06d2da but is not yet available in
a boost release.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
2019-06-28 10:56:03 -04:00
Kefu Chai
111d10df52 cmake: move boost patch to cmake/modules
as it's used by cmake only

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-06-12 16:32:10 +08:00
Daniel Glaser
c89a6998f4 cmake: boost fixes for ARM 32 bit
see https://github.com/boostorg/context/pull/94

we should drop this change once ceph uses boost 1.70 or up

Signed-off-by: Daniel Glaser <me@the78mole.de>
2019-05-29 18:30:59 +08:00
Kefu Chai
46c8b04a98 cmake: fix build WITH_SYSTEM_BOOST=ON
FindBoost.cmake from upstream cmake now finds python libraries like

find_package(Boost 1.67 python36)

and it export targets like Boost::python36

but we are still linking against Boost::python, so to be compatible
with FindBoost.cmake, we need to update BuildBoost.cmake and
mgr/CMakeLists.txt accordingly. in other words, to export
Boost::python36 and to link Boost::python36.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-08-09 18:57:04 +08:00
Kefu Chai
34f1ee7897 cmake: remove workarounds for supporting cmake 2.x
and bump up the required cmake version to 3.5.1

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-07-07 01:24:02 +08:00
Kefu Chai
3766cdff1f cmake: always turn off bjam debugging output
we have 'DH_VERBOSE=1' in debian/rules, which instructs debhelper to
pass -DCMAKE_VERBOSE_MAKEFILE=ON to cmake. but the verbose output for
building boost does not really help if something goes wrong while
building the deb packages. if we do want to enable the verbose output,
we can always enable it by passing `-d <N>' to it. see
https://boostorg.github.io/build/manual/develop/index.html#bbv2.overview.invocation.options
.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-05-24 16:06:09 +08:00
Kefu Chai
791af5459e cmake: enable CMP0051
the new behavior of get_target_property(<var> <target> SOURCES) will be
enforced in future versions of cmake, so let ready for this change now
by removing the generator expressions from the returned source file
list.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-26 16:47:54 +08:00
Kefu Chai
53a1500a8f cmake,make-dist: bump up boost version to 1.67
* to pick up the fix of https://svn.boost.org/trac10/ticket/11622
* also the boost::python's library name now includes the version suffix
  of python version, so update BuildBoost.cmake accordingly.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-21 09:02:28 +08:00
Kefu Chai
112f79f8de cmake: s/boost_256/boost_sha256/
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-21 01:33:24 +08:00
Kefu Chai
19aee456c0 cmake,make-dist: use sha256 instead of md5 for checksum
the boost's download page offers the SHA256 hash, so it'd be easier to
verify the hash this way.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-21 01:17:35 +08:00
Kefu Chai
faa84ab975 cmake: expose Boost_VERSION
to appease the consumers of FindBoost.cmake, they are expecting this
variable.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-13 12:19:36 +08:00
Kefu Chai
a15d3d39a7 cmake: rename the boost header target to Boost::boost
because FindBoost.cmake defines Boost::boost as the target for header
only dependencies.

due to the limit of cmake < 3.1, this only applies to cmake > 3.1

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-04-13 12:19:36 +08:00
Kefu Chai
9535165149 cmake: add implicit dependencies between boost libs
so the dependencies can be included when linking against the one which
depends on them. for example, libboost_filesystem depends on
libboost_system, if we don't link against the latter, linker will bail
out when linking an executable using Boost::filesystem.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-02-27 21:26:42 +08:00
Kefu Chai
854ca24b19 cmake: add an alias for unit_test_framework
should pass --with-test for building Boost::unit_test_framework

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-02-27 21:26:42 +08:00
Casey Bodley
a467e5b1cf cmake: skip boost dependency on ALIAS targets
the boost override for add_library() does not work for ALIAS targets:

CMake Error at cmake/modules/BuildBoost.cmake:227 (add_dependencies):
  Cannot add target-level dependencies to alias target "Seastar::seastar".

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-02-27 21:26:42 +08:00
Kefu Chai
d051bf0441 cmake: disable DOWNLOAD_NO_PROGRESS if cmake ver is lower than 3.1
see https://cmake.org/cmake/help/v3.1/module/ExternalProject.html and
https://cmake.org/cmake/help/v3.0/module/ExternalProject.html. the
former has DOWNLOAD_NO_PROGRESS, while the latter does not.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-02-20 06:40:15 +08:00
Kefu Chai
2277a10279 cmake: fix the include dir for building boost::python
the "includes" directories are separated by spaces not semicolons.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-02-06 00:36:26 +08:00
Kefu Chai
6f725e76d5 cmake: build Boost.python with specified version of python
Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-01-25 22:26:10 +08:00
Sage Weil
755ea1c054
Merge pull request #19914 from tchaikov/wip-cmake-check-boost-in-src
cmake: check version of boost in src/boost

Reviewed-by: Casey Bodley <cbodley@redhat.com>
Reviewed-by: Brad Hubbard <bhubbard@redhat.com>
2018-01-13 09:56:08 -06:00
Kefu Chai
fd5a522928 cmake: check version of boost in src/boost
after bumping up the required boost version, old copy of boost in
src/boost will not work. so we need to error out early.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-01-11 13:19:15 +08:00
Kefu Chai
9345a28a8a cmake: BuildBoost.cmake: use specified compiler for building boost
* user-config.jam is the suggested way for adding toolset for Boost.Build.
* always specify toolset when running b2, so we can build boost with
specified compiler instead of the default one guessed by boost building system.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2018-01-10 23:13:39 +08:00
Casey Bodley
0e47a339df cmake: update minimum boost version to 1.66
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2018-01-05 13:52:47 -05:00
Kefu Chai
e3b703eb12 cmake: check bootstrap.sh instead before downloading boost
config.hpp does not exist if boost is not configured. so a boost source
directory unpacked from dist tarball does not have this file. the
bootstrap.sh instead, it is used to create the necessary config files
for jam.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-11-24 11:13:16 +08:00
Brad Hubbard
598556f98b make-dist,cmake: Try multiple URLs to download boost before failing
Remove SPOF during boost download for make-dist and later cmake > 3.7

Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
2017-10-04 11:13:34 +10:00
Sage Weil
19987549e0 make-dist,cmake: move boost tarball location to download.ceph.com
Sourceforge is down.  Also, we can hammer our servers instead of
theirs.

Signed-off-by: Sage Weil <sage@redhat.com>
2017-09-26 17:22:36 -04:00
Kefu Chai
96b2016489 cmake: do not add dependencies to INTERFACE library on cmake < 3.3
otherwise we will have

add_dependencies Cannot add target-level dependencies to INTERFACE
library

Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-21 23:34:51 +08:00
Kefu Chai
83432b4461 cmake: build boost as an external project
Signed-off-by: Kefu Chai <kchai@redhat.com>
2017-06-14 23:53:50 +08:00