Commit Graph

81 Commits

Author SHA1 Message Date
Oleh Prypin
5683a8259b cmake: Also build Python bindings for Python 3
Signed-off-by: Oleh Prypin <oleh@pryp.in>
2016-08-11 16:36:57 +03:00
Kefu Chai
5444721b1d cmake: install platlib into a subdir of build-base dir
distutils' install command installs all stuff under $build-base, which
includes the temporary files. and rpm packaging does not like::
  Installed (but unpackaged) file(s)
and to support both py2 and py3, we should encode the python version
into the path, otherwise the built files will be overwritten.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-11 00:14:17 +08:00
Kefu Chai
300aedd8a6 cmake: fix wrong path introduced by bb163e9
s/CYTHON_MODULE_LIB/CYTHON_MODULE_DIR/

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-10 15:59:30 +08:00
Kefu Chai
bb163e98c0 cmake: specify distutils build path explicitly
so we don't need to replicate the logic in distutils/command/build.py
at different places.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-10 09:58:22 +08:00
Kefu Chai
333877023e doc,pybind: bypass sanity check if building doc
the empty .so file does not compile at all, so we need to bypass the
sanity check, if we are building docs. and what sphinx needs is just the
docstrings.

Fixes: http://tracker.ceph.com/issues/16940
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-08-09 17:08:45 +08:00
Kefu Chai
6c04c94d03 Merge pull request #10098 from dzafman/wip-16568
tools: New "removeall" used to remove head with snapshots

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-08-02 00:26:54 +08:00
Kefu Chai
8bf5cd1606 cmake: cleanup Findfuse.cmake
* remove unused stuff, we do not pass/use FUSE_VERSION in cmake.
  the FUSE_VERSION we are using is defined by "fuse_common.h".
* use FindPackageHandleStandardArgs for handling find_package()
  arguments.
* also detect osxfuse on MacOS.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-29 23:12:33 +08:00
David Zafman
b0be797ae6 cmake: Support extra arguments to tests using add_ceph_test
Signed-off-by: David Zafman <dzafman@redhat.com>
2016-07-27 09:58:59 -07:00
Kefu Chai
07206f3173 cmake: cleanup Findgperftools.cmake
remove unused bits

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 16:17:42 +08:00
Kefu Chai
98c3df5a0d cmake: cleanup Findudev.cmake
remove the crufts for handling the REQUIRED argument.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 15:40:30 +08:00
Kefu Chai
342d8279d4 cmake: cleanup Findblkid.cmake
* remove unused bits
* fix the wrong mark_as_advanced() call.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 15:40:30 +08:00
Kefu Chai
94db627c31 cmake: fix libaio detection
* we used to check the header file of "aio.h" which is part of glibc,
  the glibc async i/o, and the corresponding library is librt. but what
  we are using is libaio.
* reference libaio using AIO_LIBRARIES for consistency.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 15:40:30 +08:00
Kefu Chai
bfc25cbc93 cmake: cleanup Findbabeltrace.cmake
* we don't need the BABELTRACE_PATH_HINT setting, as packaging script
  requires the the babeltrace pacakges explicitly.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 15:39:02 +08:00
Kefu Chai
03a860ed11 cmake: add missing FindBacktrace.cmake
FindBacktrace.cmake is missing in older versions of cmake. so put a copy
in our tree.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 15:39:02 +08:00
Kefu Chai
e21d98aed4 cmake: cleanup FindOpenLdap.cmake
* use find_package_handle_standard_args() and remove unused bits.
* rename OPENLDAP_LIBS to OPENLDAP_LIBRARIES, to be consistent with
  find_package() modules.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 15:39:01 +08:00
Kefu Chai
3f6fd585f8 cmake: cleanup Findtcmalloc.cmake
use find_package_handle_standard_args() and remove unused bits.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 15:39:01 +08:00
Kefu Chai
3170f16e86 cmake: do not check libuuid anymore
libuuid dependency is not found in ceph.spec.in or debian/control.
and we are not using libuuid since 62bfc7a.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-25 15:39:01 +08:00
Kefu Chai
af1598a3b3 Merge pull request #10352 from wjwithagen/wip-wjw-freebsd-cmake-2
cmake: work to get inital FreeBSD stuff

Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-07-24 18:18:45 +08:00
Willem Jan Withagen
b4b00f43b1 FindNSS.cmake: find includes in /usr/local/includes/nss/nss
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
2016-07-20 15:57:42 +02:00
Kefu Chai
e8a16b7fda cmake: remove unused Findfio.cmake
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-20 16:22:29 +08:00
Kefu Chai
b5607f88e8 cmake: Findfcgi.cmake cleanups
FindPackageHandleStandardArgs() takes care of the find_package()
boilderplate stuff. so no need to repeat them. and remove the checkings
in env variables.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-20 16:21:06 +08:00
Kefu Chai
636522b669 cmake: use FindBacktrace instead of Findexecinfo
always better to use upstream cmake modules.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-20 14:47:52 +08:00
Kefu Chai
c30c5223b5 cmake: only allow up to 1 hour for a ceph test
quote from
https://cmake.org/cmake/help/v3.0/prop_test/TIMEOUT.html?highlight=timeout

> If it exceeds that the test process will be killed and ctest will move
> to the next test.

this helps us to identify test hang.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-16 12:00:47 +08:00
Kefu Chai
ce5724effb cmake: add a "tests" target to build tests
please note "make test" is used by cmake to run tests, so we cannot just
repurpose it to *build* them.

* AddCephTest.cmake: depends on "tests"
* CMakeLists.txt: let "check" depend on "tests"
* src/CMakeLists.txt: update the run-tox tests
* run-make-check.sh: use "make tests" and "ctest" instead of "make check"
* ceph-detect-init/CMakeLists.txt: let "tests" depend on
    "ceph-detect-init"
* ceph-disk/CMakeLists.txt: let "tests" depend on "ceph-disk"

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-16 10:57:12 +08:00
Kefu Chai
c57dbd3451 cmake: pass necessary cflags to build_ext
this fixes:
```
creating
/home/kefu/ceph/build/src/pybind/rados/var/ceph/ceph/build/src/pybind/rados
creating
/home/kefu/ceph/build/src/pybind/rados/var/ceph/ceph/build/src/pybind/rados/pyrex
/usr/bin/gcc-6 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes
-fno-strict-aliasing -iquote /var/ceph/ceph/src/include -fPIC
-I/usr/include/python2.7 -I/usr/include/x86_64-linux-
gnu/python2.7 -I/usr/include/python2.7 -c
/home/kefu/ceph/build/src/pybind/rados/pyrex/rados.c -o
/home/kefu/ceph/build/src/pybind/rados/var/ceph/ceph/build/src/pybind/rados/pyrex/ra
dos.o -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g
-fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG -g
-fwrapv -O2 -Wall -Wstrict-prototypes -lpython2.
7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1
-Wl,-Bsymbolic-functions
/home/kefu/ceph/build/src/pybind/rados/pyrex/rados.c:239:28: fatal error:
rados/librados.h: No such file or directory
 #include "rados/librados.h"
                            ^
compilation terminated.
```

seems we can not pass the CFLAGS with space in it to setup.py using env variable

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-11 16:23:20 +08:00
Kefu Chai
6a99eec653 cmake: put cythonized .c files into ${CMAKE_CURRENT_BINARY_DIR}
it was put into the directory where .pyx is located. it's not expected
in an out-of-tree build.
* {rados,rbd,cephfs}/setup.py: use build_ext from cython if possible, fallback to
  the one from setuptools or distutils
* Distutils.cmake: pass --cython-c-in-temp --build-temp and
  --cython-include-dirs to "build_ext" command

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-11 16:23:20 +08:00
Kefu Chai
edd7c9d709 cmake: creage egg_info files into build directory
otherwise they will go to the source tree, and "git ls-files" will list
them as untracked files, which annoy gitbuilder-ceph-tarball*-cmake
gitbuilders. like

+ echo 'error: Added files:'
error: Added files:
+ cat .git/added-files
src/pybind/rados/rados.egg-info/PKG-INFO
...

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-08 15:02:59 +08:00
Kefu Chai
b5bb77d566 cmake: use the stock FindCURL.cmake
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-07 23:26:02 +08:00
Kefu Chai
3646fa5c6b cmake: use the stock FindEXPAT.cmake
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-07 23:26:02 +08:00
Josh Durgin
1c7ad3523d Merge pull request #9833 from onyb/wip-rados-pypi
pybind: make rados ready for PyPI

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-07-06 16:01:50 -07:00
Kefu Chai
0c5fb822dd cmake: refactor distutils_install_module to follow the pattern of distutils_install_cython_module
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-04 11:49:26 +08:00
Kefu Chai
8c9ff9c5cb cmake: install python packages into $CMAKE_INSTALL_PREFIX
* Distutils.cmake:
  set --prefix=${CMAKE_INSTALL_PREFIX} for python packages installed using
  setuptools. it was set to --prefix=/user only when $DESTDIR is set. so
  if user installs ceph using -DCMAKE_INSTALL_PREFIX, these python
  packages still go to /usr, which is unexpected.
* ceph-disk/CMakeLists.txt:
  install script into ${CMAKE_INSTALL_SBINDIR} instead of /usr/sbin

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-07-04 11:49:26 +08:00
Anirudha Bose
9a1d64c93d pybind: Add CMake support in rados
Signed-off-by: Anirudha Bose <ani07nov@gmail.com>
2016-06-19 20:20:56 +05:30
Kefu Chai
a21071d1ba Merge pull request #9119 from runsisi/wip-fix-cmake-desc
cmake: update description for cmake module Findkeyutils.cmake

Reviewed-by: Ali Maredia <amaredia@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2016-06-18 23:51:41 +08:00
Daniel Gryniewicz
15b11ad5b6 Update git rev parsing in CMake
Git now can have a history for a short branch in the logs, breaking the
rev parsing.  Update to a newer version that fixes this.

Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
2016-06-10 14:22:31 -04:00
Kefu Chai
c4a8784330 cmake: install ceph-disk to /usr/sbin
* add keyword "INSTALL_SCRIPT" to distutils_install_module(), so we can
  override the install path of ceph-disk script.
* refactor the Distutils.cmake module a little bit, the ${option}
  variable out lives the CODE snipplet. so we need to reset it
  at the beginning.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-06-04 09:37:33 +08:00
Kefu Chai
bbf51e1562 cmake: install cython modules
* fix CYTHON_ADD_MODULE() macro. because python_add_module() offered by
  FindPythonLibs.cmake creates a target with name of ${name}, which conflicts
  with existing targets like "rbd" or "rados". so we can not reuse the
  name in ${name}.pyx. and instead, we should specify the target name
  explicitly.
* add distutils_install_cython_module() function to build and install
  cython modules.
* we can split build and install of cython module, but the install phase
  always tries to build the module. so keep it this way. will look at it
  later on.
* move the variables initializations into the Distutils.cmake module.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-06-01 23:50:05 +08:00
Kefu Chai
b02aaebc45 cmake: install ceph-{detect-init,disk}
add a cmake module named Distutils.cmake for setting up python modules
using setup.py.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-06-01 23:49:46 +08:00
Kefu Chai
a2706c7e16 cmake: revamp on lttng support
* Findlttng-ust.cmake: detect lttng-gen-tp, and make it a required var
* Findlttng-ust.cmake: fix the detection of lttng
* src/tracing/CMakeLists.txt:
  - do not put the generated header files into ${CMAKE_SOURCE_DIR}/src/tracing,
    instead we should put the generated files into ${PROJECT_BINARY_DIR}/include.
  - do not compile the tracing library using the .c files in the repo,
    instead, we should generate them at compile time using lttng-gen-tp,
    and compile the genererated .c files.
* CMakeLists.txt: make the lttng-use package REQUIRED if WITH_LTTNG=ON
* src/CMakeLists.txt: let librados depend on librados-tp if LTTNG is
  enabled: librados includes tracing/librados.h. the same applies to
  librbd, libos and libosd. cmake could deduce the dependencies if we
  add the lttng header files under include/tracing into the
  corresponding target, as the lttng header files are already listed
  as OUTPUT and GENERATED files, but this requires us to put all the
  involved targets in the same CMakeLists.txt. in this case, three
  CMakeLists.txts are impacted. so we create a new target for each
  lttng header, and let the impacted target depend on it.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-05-27 19:54:42 +08:00
Ali Maredia
0ef09f32d4 cmake: Added #defines to config-h.in.cmake
Signed-off-by: Ali Maredia <amaredia@redhat.com>
2016-05-26 17:26:48 -04:00
runsisi
533dbe04a7 cmake: update description for cmake module Findkeyutils.cmake
Signed-off-by: runsisi <runsisi@zte.com.cn>
2016-05-13 22:02:34 +08:00
Kefu Chai
25030b0436 cmake: pass CEPH_BUILD_VIRTUALENV to test as an env variable
Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-05-10 21:50:17 +08:00
Matt Benjamin
4df918ae8c cmake: <UPPERCASED_NAME>_FOUND in Findxio.cmake
For uniformity, upcase all these variables.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2016-05-03 17:36:59 -04:00
Ali Maredia
65963739cd cmake: ceph_objectstore_tool.py test passing
Replaced relative paths in shell scripts in
test/ceph_objectstore_tool.py and init-ceph.in to
work with CEPH_FOO environment variables set in cmake.
Also added CEPH_BUILD_DIR environment variable set
to CMAKE_BINARY_DIR. It is used in init-ceph and
ceph_objectstore_tool.py.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2016-04-14 20:48:21 -04:00
Ali Maredia
a7bd5e4bdc cmake: Reorganized test dir, added cmake functions
make check targets now use add_ceph_test, or
add_ceph_unittest to be added to CTest. Renamed and
reordered targets in tests/CMakeLists.txt

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2016-04-14 20:48:19 -04:00
Matt Benjamin
1539d9029c rgw-ldap: conditional build
Permit building without LDAP support--support is enabled by default.
Tested with CMake and autotools standalone builds.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2016-03-16 16:31:20 -04:00
Matt Benjamin
bcddb5672b cmake: avoid false-positive LDAP header detect
Pre-setting a value in OPENLDAP_INCLUDE_DIR broke the subsequent
test.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2016-03-14 14:11:45 -04:00
Matt Benjamin
38fd3f190a rgw: LDAP pass-through authentication
Implement a new external authenticator based on LDAP and the
new external token format.

External LDAP auth now works, at least with openldap/X.500 style
naming and ldaps:// (SSL).

The latter is AD-friendly, but since AD uses dnattr=cn (IIRC)
everywhere, AD will need testing.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
2016-03-12 09:57:12 -08:00
Kefu Chai
8c2bb7e5c6 cmake: add Find{dpdk,pciaccess}.cmake
to ready the SPDK support

Signed-off-by: Kefu Chai <kchai@redhat.com>
2016-02-04 14:03:21 +08:00
John Coyle
6d860ba46c cmake: musl libc does not implement backtrace. Added feature check and fallback to libexecinfo.
Signed-off-by: John Coyle <dx9err@gmail.com>
2016-01-29 08:50:46 -05:00