2014-06-23 22:32:32 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8.11)
|
|
|
|
|
|
|
|
project(Ceph)
|
Ceph Accelio/RDMA Transport (XioMessenger).
XioMessenger implements a Ceph Messenger provider for Accelio,
a high-performance messaging transport by Mellanox. Current
Accelio is layered on ibverbs, and supports Infiniband, ROCE,
and other RDMA transports. Future Accelio verions will support
alternative transports (including TCP), and flexible transport
selection.
config: cluster_rdma drives messenger creation
ceph_mds ceph_mon and ceph_osd use XioMessengers for cluster
communication when cluster_rdma is set
Move XioMessenger to msg/xio.
This matches the other new Messenger locations.
test: tests for tcp and xio messengers
(Not tests only.)
buffer: add subclass for xio buffers
xio: convert to Connection::send_message interface
config: -x, --xio as aliases for client_rdma
ceph-fuse: create xio messenger if client_rdma
Find XioMessenger.h and QueueStrategy.h in msg/xio.
ceph-syn: create xio messenger if client_rdma
librados: create xio messenger if client_rdma
Find XioMessenger.h and QueueStrategy.h in msg/xio.
Restore non-abort from Xio Mon integration.
Fix xio_client send count, again.
xio: must signal cond under mutex lock
xio: dispatch strategies support ms_fast_dispatch
xio: config variable xio_port_shift
remove set_port_shift() from XioMessenger, and just use the value
from the configuration
xio: don't depend on g_ceph_context for dout
XioMessenger now uses its own cct for all logging operations
the accelio log function, however, still depends on a global
CephContext. so we maintain an extra one, separate from g_ceph_context,
in XioMessenger.cc that is initialized on first construction and a
reference is held indefinitely
script: cephfsnew to automate pool and fs creation
Use new on_ow_msg_send_complete hook.
Replaces on_msg_delivered for one-way message style.
Prototype new xio_discon behavior.
On shutdown, XioPortal threads should not exit before Accelio
finalizes all sessions.
Inline join_sessions, it needs sh_mtx held across wait loop.
Fix assert on Cond::Signal. Adds Cond2.
Avoid deadlock, xio_disconnect can deliver a session teardown event.
Also Mutex2.
(Note, Mutex2 and Cond2 are replaced by standard C++ downstream.)
Restore SimpleDispatcher Timings.
The simple_client/simple_server timings are based on a ping/pong
of messages between the client and server, unlike those of the
xio_client/server programs, which are one-way (so their corresponding
1-way bandwidth is appx. 2x what the test reports). We assert
that the results are in general comparable, because in both setups,
a fixed number of messages (def. 50) is maintained in flight.
Wrap Accelio mempool in XioPool, add stats.
To enable stat prints, set xio_trace_mempool. Currently, prints
to stdout at each 64K messages sent or received.
Restore _send_message(..).
Fix merge errors in simple_client, simple_dispatcher.
xio: fix for size in pool stats
Add in/outbound msg counters to XioPoolStats.
Pool stats are easier to read.
Pool stats are easier to read, and if enabled, print on session
teardown. This is a convenient time to view stats, and with a small
Make pool stats counters atomic.
Track requests using hook ctor/dtor.
Lockless, portal thread provides atomicity.
Adapt to recent changes on Accelio for_next
* Accelio options now of opaque type
* on_msg_err with extra direction param
* RDMA behavior now governed by 2 new options
XIO_OPTNAME_MAX_INLINE_DATA
XIO_OPTNAME_MAX_INLINE_HEADER
* Separated send and recv queue depth
xio_messenger: Change xio optname queue depth msgs
* Set 16k threshold to rdma buffers instead of send
* Change xio optname for queue depth msgs
XIO_OPTNAME_SND/RCV_QUEUE_DEPTH_MSGS
xio_messenger: Protect Accelio queue depth.
(Minimal send flow control.)
The guard is per xio_connection, and considering batches.
Increment happens only if xio_send_msg succeeded, decrement in
on_ms_ow_send_complete and on_msg_error. Note that we don't need
atomics because counters are touched only in the correct portal
thread.
Find XioMsg.h in msg/xio
Find XioMessenger.h and QueueStrategy.h in msg/xio (tests).
Adapt to 2 Accelio API changes.
1. xio_context_stop loop takes only 1 argument
2. xio_connect() now takes a structure argument, by reference
Set CMP0046 iif CMake version >= 3
Move XioMessenger to msg/xio
xio: fix for segfault on xio_connect()
No more Mutex2, Cond2.
xio: number of portal threads is configurable
xio: only create additional portals on bind()
xio: use QueueStrategy(1) as default
xio: Messenger factory accepts ms_type "xio"
xio: use ms_type instead of client,cluster_rdma
removing the ability to configure the client and cluster networks
separately in favor of a single global messenger type
--xio is now a command-line alias for --ms_type xio
all daemons now use the Messenger::create() factory function instead of
conditionally creating XioMessengers
the OSD and Monitor classes no longer need separate messengers to
deal with both tcp/rdma clients
xio: portal binding honors ms_bind_port_min,max
xio: remove xio_port_shift
port shifting is no longer necessary, because we won't create both tcp
and xio messengers for the same service
Use Accelio sglist helper macros.
xio: make xio buffer unshareable
xio: Nuke special_handling.
Replace GENERIC with MON (requested by Sage).
Signed-off-by: Casey Bodley <casey@cohortfs.com>
Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
2014-12-23 21:46:47 +00:00
|
|
|
set(VERSION "0.90")
|
2014-06-23 22:32:32 +00:00
|
|
|
|
Ceph Accelio/RDMA Transport (XioMessenger).
XioMessenger implements a Ceph Messenger provider for Accelio,
a high-performance messaging transport by Mellanox. Current
Accelio is layered on ibverbs, and supports Infiniband, ROCE,
and other RDMA transports. Future Accelio verions will support
alternative transports (including TCP), and flexible transport
selection.
config: cluster_rdma drives messenger creation
ceph_mds ceph_mon and ceph_osd use XioMessengers for cluster
communication when cluster_rdma is set
Move XioMessenger to msg/xio.
This matches the other new Messenger locations.
test: tests for tcp and xio messengers
(Not tests only.)
buffer: add subclass for xio buffers
xio: convert to Connection::send_message interface
config: -x, --xio as aliases for client_rdma
ceph-fuse: create xio messenger if client_rdma
Find XioMessenger.h and QueueStrategy.h in msg/xio.
ceph-syn: create xio messenger if client_rdma
librados: create xio messenger if client_rdma
Find XioMessenger.h and QueueStrategy.h in msg/xio.
Restore non-abort from Xio Mon integration.
Fix xio_client send count, again.
xio: must signal cond under mutex lock
xio: dispatch strategies support ms_fast_dispatch
xio: config variable xio_port_shift
remove set_port_shift() from XioMessenger, and just use the value
from the configuration
xio: don't depend on g_ceph_context for dout
XioMessenger now uses its own cct for all logging operations
the accelio log function, however, still depends on a global
CephContext. so we maintain an extra one, separate from g_ceph_context,
in XioMessenger.cc that is initialized on first construction and a
reference is held indefinitely
script: cephfsnew to automate pool and fs creation
Use new on_ow_msg_send_complete hook.
Replaces on_msg_delivered for one-way message style.
Prototype new xio_discon behavior.
On shutdown, XioPortal threads should not exit before Accelio
finalizes all sessions.
Inline join_sessions, it needs sh_mtx held across wait loop.
Fix assert on Cond::Signal. Adds Cond2.
Avoid deadlock, xio_disconnect can deliver a session teardown event.
Also Mutex2.
(Note, Mutex2 and Cond2 are replaced by standard C++ downstream.)
Restore SimpleDispatcher Timings.
The simple_client/simple_server timings are based on a ping/pong
of messages between the client and server, unlike those of the
xio_client/server programs, which are one-way (so their corresponding
1-way bandwidth is appx. 2x what the test reports). We assert
that the results are in general comparable, because in both setups,
a fixed number of messages (def. 50) is maintained in flight.
Wrap Accelio mempool in XioPool, add stats.
To enable stat prints, set xio_trace_mempool. Currently, prints
to stdout at each 64K messages sent or received.
Restore _send_message(..).
Fix merge errors in simple_client, simple_dispatcher.
xio: fix for size in pool stats
Add in/outbound msg counters to XioPoolStats.
Pool stats are easier to read.
Pool stats are easier to read, and if enabled, print on session
teardown. This is a convenient time to view stats, and with a small
Make pool stats counters atomic.
Track requests using hook ctor/dtor.
Lockless, portal thread provides atomicity.
Adapt to recent changes on Accelio for_next
* Accelio options now of opaque type
* on_msg_err with extra direction param
* RDMA behavior now governed by 2 new options
XIO_OPTNAME_MAX_INLINE_DATA
XIO_OPTNAME_MAX_INLINE_HEADER
* Separated send and recv queue depth
xio_messenger: Change xio optname queue depth msgs
* Set 16k threshold to rdma buffers instead of send
* Change xio optname for queue depth msgs
XIO_OPTNAME_SND/RCV_QUEUE_DEPTH_MSGS
xio_messenger: Protect Accelio queue depth.
(Minimal send flow control.)
The guard is per xio_connection, and considering batches.
Increment happens only if xio_send_msg succeeded, decrement in
on_ms_ow_send_complete and on_msg_error. Note that we don't need
atomics because counters are touched only in the correct portal
thread.
Find XioMsg.h in msg/xio
Find XioMessenger.h and QueueStrategy.h in msg/xio (tests).
Adapt to 2 Accelio API changes.
1. xio_context_stop loop takes only 1 argument
2. xio_connect() now takes a structure argument, by reference
Set CMP0046 iif CMake version >= 3
Move XioMessenger to msg/xio
xio: fix for segfault on xio_connect()
No more Mutex2, Cond2.
xio: number of portal threads is configurable
xio: only create additional portals on bind()
xio: use QueueStrategy(1) as default
xio: Messenger factory accepts ms_type "xio"
xio: use ms_type instead of client,cluster_rdma
removing the ability to configure the client and cluster networks
separately in favor of a single global messenger type
--xio is now a command-line alias for --ms_type xio
all daemons now use the Messenger::create() factory function instead of
conditionally creating XioMessengers
the OSD and Monitor classes no longer need separate messengers to
deal with both tcp/rdma clients
xio: portal binding honors ms_bind_port_min,max
xio: remove xio_port_shift
port shifting is no longer necessary, because we won't create both tcp
and xio messengers for the same service
Use Accelio sglist helper macros.
xio: make xio buffer unshareable
xio: Nuke special_handling.
Replace GENERIC with MON (requested by Sage).
Signed-off-by: Casey Bodley <casey@cohortfs.com>
Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
2014-12-23 21:46:47 +00:00
|
|
|
if (NOT (CMAKE_MAJOR_VERSION LESS 3))
|
|
|
|
# Tweak policies (this one disables "missing" dependency warning)
|
|
|
|
cmake_policy(SET CMP0046 OLD)
|
|
|
|
endif(NOT (CMAKE_MAJOR_VERSION LESS 3))
|
2016-02-10 05:16:34 +00:00
|
|
|
# we use LINK_PRIVATE keyword instead of PRIVATE, but do not specify the LINK_PUBLIC
|
|
|
|
# for target_link_libraries() command when PUBLIC should be used instead, it's just
|
|
|
|
# for backward compatibility with cmake 2.8.11.
|
|
|
|
if (POLICY CMP0022)
|
|
|
|
cmake_policy(SET CMP0022 OLD)
|
|
|
|
endif (POLICY CMP0022)
|
|
|
|
if (POLICY CMP0023)
|
|
|
|
cmake_policy(SET CMP0023 OLD)
|
|
|
|
endif (POLICY CMP0023)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
|
|
|
|
|
2015-12-09 17:55:30 +00:00
|
|
|
option(WITH_CCACHE "Build with ccache.")
|
|
|
|
if(WITH_CCACHE)
|
|
|
|
find_program(CCACHE_FOUND ccache)
|
|
|
|
if(CCACHE_FOUND)
|
|
|
|
message(STATUS "Building with ccache: ${CCACHE_FOUND}, CCACHE_DIR=$ENV{CCACHE_DIR}")
|
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
2016-04-10 14:37:59 +00:00
|
|
|
# ccache does not accelerate link (ld), but let it handle it. by passing it
|
|
|
|
# along with cc to python's distutils, we are able to workaround
|
|
|
|
# https://bugs.python.org/issue8027.
|
2015-12-09 17:55:30 +00:00
|
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
|
|
|
else(CCACHE_FOUND)
|
|
|
|
message(FATAL_ERROR "Can't find ccache. Is it installed?")
|
|
|
|
endif(CCACHE_FOUND)
|
|
|
|
endif(WITH_CCACHE)
|
|
|
|
|
2016-01-12 14:39:58 +00:00
|
|
|
include_directories(
|
2014-06-23 22:32:32 +00:00
|
|
|
${PROJECT_BINARY_DIR}/src/include
|
|
|
|
${OFED_PREFIX}/include
|
|
|
|
${LEVELDB_PREFIX}/include
|
Ceph Accelio/RDMA Transport (XioMessenger).
XioMessenger implements a Ceph Messenger provider for Accelio,
a high-performance messaging transport by Mellanox. Current
Accelio is layered on ibverbs, and supports Infiniband, ROCE,
and other RDMA transports. Future Accelio verions will support
alternative transports (including TCP), and flexible transport
selection.
config: cluster_rdma drives messenger creation
ceph_mds ceph_mon and ceph_osd use XioMessengers for cluster
communication when cluster_rdma is set
Move XioMessenger to msg/xio.
This matches the other new Messenger locations.
test: tests for tcp and xio messengers
(Not tests only.)
buffer: add subclass for xio buffers
xio: convert to Connection::send_message interface
config: -x, --xio as aliases for client_rdma
ceph-fuse: create xio messenger if client_rdma
Find XioMessenger.h and QueueStrategy.h in msg/xio.
ceph-syn: create xio messenger if client_rdma
librados: create xio messenger if client_rdma
Find XioMessenger.h and QueueStrategy.h in msg/xio.
Restore non-abort from Xio Mon integration.
Fix xio_client send count, again.
xio: must signal cond under mutex lock
xio: dispatch strategies support ms_fast_dispatch
xio: config variable xio_port_shift
remove set_port_shift() from XioMessenger, and just use the value
from the configuration
xio: don't depend on g_ceph_context for dout
XioMessenger now uses its own cct for all logging operations
the accelio log function, however, still depends on a global
CephContext. so we maintain an extra one, separate from g_ceph_context,
in XioMessenger.cc that is initialized on first construction and a
reference is held indefinitely
script: cephfsnew to automate pool and fs creation
Use new on_ow_msg_send_complete hook.
Replaces on_msg_delivered for one-way message style.
Prototype new xio_discon behavior.
On shutdown, XioPortal threads should not exit before Accelio
finalizes all sessions.
Inline join_sessions, it needs sh_mtx held across wait loop.
Fix assert on Cond::Signal. Adds Cond2.
Avoid deadlock, xio_disconnect can deliver a session teardown event.
Also Mutex2.
(Note, Mutex2 and Cond2 are replaced by standard C++ downstream.)
Restore SimpleDispatcher Timings.
The simple_client/simple_server timings are based on a ping/pong
of messages between the client and server, unlike those of the
xio_client/server programs, which are one-way (so their corresponding
1-way bandwidth is appx. 2x what the test reports). We assert
that the results are in general comparable, because in both setups,
a fixed number of messages (def. 50) is maintained in flight.
Wrap Accelio mempool in XioPool, add stats.
To enable stat prints, set xio_trace_mempool. Currently, prints
to stdout at each 64K messages sent or received.
Restore _send_message(..).
Fix merge errors in simple_client, simple_dispatcher.
xio: fix for size in pool stats
Add in/outbound msg counters to XioPoolStats.
Pool stats are easier to read.
Pool stats are easier to read, and if enabled, print on session
teardown. This is a convenient time to view stats, and with a small
Make pool stats counters atomic.
Track requests using hook ctor/dtor.
Lockless, portal thread provides atomicity.
Adapt to recent changes on Accelio for_next
* Accelio options now of opaque type
* on_msg_err with extra direction param
* RDMA behavior now governed by 2 new options
XIO_OPTNAME_MAX_INLINE_DATA
XIO_OPTNAME_MAX_INLINE_HEADER
* Separated send and recv queue depth
xio_messenger: Change xio optname queue depth msgs
* Set 16k threshold to rdma buffers instead of send
* Change xio optname for queue depth msgs
XIO_OPTNAME_SND/RCV_QUEUE_DEPTH_MSGS
xio_messenger: Protect Accelio queue depth.
(Minimal send flow control.)
The guard is per xio_connection, and considering batches.
Increment happens only if xio_send_msg succeeded, decrement in
on_ms_ow_send_complete and on_msg_error. Note that we don't need
atomics because counters are touched only in the correct portal
thread.
Find XioMsg.h in msg/xio
Find XioMessenger.h and QueueStrategy.h in msg/xio (tests).
Adapt to 2 Accelio API changes.
1. xio_context_stop loop takes only 1 argument
2. xio_connect() now takes a structure argument, by reference
Set CMP0046 iif CMake version >= 3
Move XioMessenger to msg/xio
xio: fix for segfault on xio_connect()
No more Mutex2, Cond2.
xio: number of portal threads is configurable
xio: only create additional portals on bind()
xio: use QueueStrategy(1) as default
xio: Messenger factory accepts ms_type "xio"
xio: use ms_type instead of client,cluster_rdma
removing the ability to configure the client and cluster networks
separately in favor of a single global messenger type
--xio is now a command-line alias for --ms_type xio
all daemons now use the Messenger::create() factory function instead of
conditionally creating XioMessengers
the OSD and Monitor classes no longer need separate messengers to
deal with both tcp/rdma clients
xio: portal binding honors ms_bind_port_min,max
xio: remove xio_port_shift
port shifting is no longer necessary, because we won't create both tcp
and xio messengers for the same service
Use Accelio sglist helper macros.
xio: make xio buffer unshareable
xio: Nuke special_handling.
Replace GENERIC with MON (requested by Sage).
Signed-off-by: Casey Bodley <casey@cohortfs.com>
Signed-off-by: Vu Pham <vu@mellanox.com>
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
2014-12-23 21:46:47 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/src
|
2014-06-23 22:32:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
link_directories(
|
|
|
|
${OFED_PREFIX}/lib
|
|
|
|
${LEVELDB_PREFIX}/lib
|
|
|
|
)
|
|
|
|
|
2016-01-11 22:28:47 +00:00
|
|
|
#put all the libs and binaries in one place
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
#Check Includes
|
|
|
|
include(CheckIncludeFiles)
|
|
|
|
include(CheckIncludeFileCXX)
|
|
|
|
include(CheckFunctionExists)
|
|
|
|
|
2016-03-03 17:05:18 +00:00
|
|
|
#put all the libs and binaries in one place
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
CHECK_FUNCTION_EXISTS(fallocate CEPH_HAVE_FALLOCATE)
|
|
|
|
CHECK_FUNCTION_EXISTS(posix_fadvise HAVE_POSIX_FADVISE)
|
|
|
|
CHECK_FUNCTION_EXISTS(posix_fallocate HAVE_POSIX_FALLOCATE)
|
2016-01-12 14:39:58 +00:00
|
|
|
CHECK_FUNCTION_EXISTS(syncfs HAVE_SYS_SYNCFS)
|
2014-06-23 22:32:32 +00:00
|
|
|
CHECK_FUNCTION_EXISTS(sync_file_range HAVE_SYNC_FILE_RANGE)
|
2015-10-14 00:20:33 +00:00
|
|
|
CHECK_FUNCTION_EXISTS(mallinfo HAVE_MALLINFO)
|
2016-01-25 15:21:29 +00:00
|
|
|
CHECK_FUNCTION_EXISTS(pwritev HAVE_PWRITEV)
|
2014-06-23 22:32:32 +00:00
|
|
|
CHECK_INCLUDE_FILES("arpa/inet.h" HAVE_ARPA_INET_H)
|
|
|
|
CHECK_INCLUDE_FILES("boost/random/discrete_distribution.hpp" HAVE_BOOST_RANDOM_DISCRETE_DISTRIBUTION)
|
2015-11-09 10:59:22 +00:00
|
|
|
CHECK_INCLUDE_FILE_CXX("boost/asio/coroutine.hpp" HAVE_BOOST_ASIO_COROUTINE)
|
2014-06-23 22:32:32 +00:00
|
|
|
CHECK_INCLUDE_FILES("dirent.h" HAVE_DIRENT_H)
|
|
|
|
CHECK_INCLUDE_FILES("dlfcn.h" HAVE_DLFCN_H)
|
|
|
|
CHECK_INCLUDE_FILES("inttypes.h" HAVE_INTTYPES_H)
|
|
|
|
CHECK_INCLUDE_FILES("linux/types.h" HAVE_LINUX_TYPES_H)
|
|
|
|
CHECK_INCLUDE_FILES("memory.h" HAVE_MEMORY_H)
|
|
|
|
CHECK_INCLUDE_FILES("ndir.h" HAVE_NDIR_H)
|
|
|
|
CHECK_INCLUDE_FILES("netdb.h" HAVE_NETDB_H)
|
|
|
|
CHECK_INCLUDE_FILES("netinet/in.h" HAVE_NETINET_IN_H)
|
|
|
|
CHECK_INCLUDE_FILES("stdint.h" HAVE_STDINT_H)
|
|
|
|
CHECK_INCLUDE_FILES("stdlib.h" HAVE_STDLIB_H)
|
|
|
|
CHECK_INCLUDE_FILES("arpa/inet.h" HAVE_ARPA_INET_H)
|
|
|
|
CHECK_INCLUDE_FILES("strings.h" HAVE_STRINGS_H)
|
|
|
|
CHECK_INCLUDE_FILES("string.h" HAVE_STRING_H)
|
|
|
|
CHECK_INCLUDE_FILES("syslog.h" HAVE_SYSLOG_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/dir.h" HAVE_SYS_DIR_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/file.h" HAVE_SYS_FILE_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/ioctl.h" HAVE_SYS_IOCTL_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/mount.h" HAVE_SYS_MOUNT_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/ndir.h" HAVE_SYS_NDIR_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/param.h" HAVE_SYS_PARAM_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/socket.h" HAVE_SYS_SOCKET_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/statvfs.h" HAVE_SYS_STATVFS_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/stat.h" HAVE_SYS_STAT_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/time.h" HAVE_SYS_TIME_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/types.h" HAVE_SYS_TYPES_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/vfs.h" HAVE_SYS_VFS_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/wait.h" HAVE_SYS_WAIT_H)
|
|
|
|
CHECK_INCLUDE_FILES("sys/xattr.h" HAVE_SYS_XATTR_H)
|
|
|
|
CHECK_INCLUDE_FILES("unistd.h" HAVE_UNISTD_H)
|
|
|
|
CHECK_INCLUDE_FILES("utime.h" HAVE_UTIME_H)
|
|
|
|
CHECK_INCLUDE_FILES("${CMAKE_SOURCE_DIR}/src/include/fiemap.h" HAVE_FIEMAP_H)
|
|
|
|
CHECK_INCLUDE_FILES("fuse/fuse_lowlevel.h" HAVE_FUSE_LOWLEVEL_H)
|
|
|
|
CHECK_INCLUDE_FILES("fuse/fuse.h" HAVE_FUSE_H)
|
|
|
|
CHECK_INCLUDE_FILES("fcgi_config.h" HAVE_FASTCGI_CONFIG_H)
|
|
|
|
CHECK_INCLUDE_FILES("fastcgi.h" HAVE_FASTCGI_H)
|
|
|
|
CHECK_INCLUDE_FILES("fcgiapp.h" FASTCGI_FASTCGI_APP_DIR)
|
|
|
|
CHECK_INCLUDE_FILES("fcgimisc.h" HAVE_FASTCGI_MISC_H)
|
|
|
|
CHECK_INCLUDE_FILES("fcgio.h" HAVE_FASTCGIO_H)
|
|
|
|
CHECK_INCLUDE_FILES("fcgios.h" FASTCGI_FASTCGIOS_DIR)
|
|
|
|
CHECK_INCLUDE_FILES("fcgi_stdio.h" HAVE_FASTCGI_STDIO_H)
|
|
|
|
CHECK_INCLUDE_FILES("keyutils.h" HAVE_KEYUTILS_H)
|
2016-01-18 18:47:28 +00:00
|
|
|
CHECK_INCLUDE_FILES("execinfo.h" HAVE_EXECINFO_H)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
include(CheckSymbolExists)
|
|
|
|
CHECK_SYMBOL_EXISTS(__u8 "sys/types.h;linux/types.h" HAVE___U8)
|
|
|
|
CHECK_SYMBOL_EXISTS(__u64 "sys/types.h;linux/types.h" HAVE___U64)
|
|
|
|
CHECK_SYMBOL_EXISTS(__s64 "sys/types.h;linux/types.h" HAVE___S64)
|
|
|
|
|
2015-10-16 17:12:41 +00:00
|
|
|
CHECK_SYMBOL_EXISTS(res_nquery "resolv.h" HAVE_RES_NQUERY)
|
|
|
|
|
2015-12-01 14:07:48 +00:00
|
|
|
include(CheckCXXSourceCompiles)
|
|
|
|
CHECK_CXX_SOURCE_COMPILES("
|
|
|
|
#include <string.h>
|
|
|
|
int main() { char x = *strerror_r(0, &x, sizeof(x)); return 0; }
|
|
|
|
" STRERROR_R_CHAR_P)
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
set(CEPH_MAN_DIR "share/man" CACHE STRING "Install location for man pages (relative to prefix).")
|
|
|
|
|
|
|
|
option(ENABLE_SHARED "build shared libraries" ON)
|
|
|
|
if(${ENABLE_SHARED})
|
|
|
|
set(CEPH_SHARED SHARED)
|
|
|
|
else(${ENABLE_SHARED})
|
|
|
|
set(CEPH_SHARED STATIC)
|
|
|
|
endif(${ENABLE_SHARED})
|
|
|
|
|
2015-10-15 02:54:05 +00:00
|
|
|
find_package(execinfo)
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
find_package(udev REQUIRED)
|
|
|
|
set(HAVE_UDEV ${UDEV_FOUND})
|
|
|
|
|
|
|
|
option(WITH_AIO "AIO is here ON" ON)
|
|
|
|
if(${WITH_AIO})
|
|
|
|
find_package(aio REQUIRED)
|
|
|
|
set(HAVE_LIBAIO ${AIO_FOUND})
|
|
|
|
message(STATUS "${AIO_LIBS}")
|
|
|
|
endif(${WITH_AIO})
|
|
|
|
|
2015-11-14 19:51:13 +00:00
|
|
|
option(WITH_OPENLDAP "OPENLDAP is here" ON)
|
|
|
|
if(${WITH_OPENLDAP})
|
|
|
|
find_package(OpenLdap REQUIRED)
|
|
|
|
set(HAVE_OPENLDAP ${OPENLDAP_FOUND})
|
|
|
|
message(STATUS "${OPENLDAP_LIBS}")
|
|
|
|
endif(${WITH_OPENLDAP})
|
|
|
|
|
2016-03-14 21:37:51 +00:00
|
|
|
option(WITH_OPENSSL "OPENSSL is here" ON)
|
|
|
|
if(${WITH_OPENSSL})
|
|
|
|
find_package(OpenSSL REQUIRED)
|
2016-03-25 10:11:34 +00:00
|
|
|
set(HAVE_OPENSSL ON)
|
|
|
|
#message(STATUS "${OPENSSL_LIBRARIES}")
|
|
|
|
else(${WITH_OPENSSL})
|
|
|
|
set(HAVE_OPENSSL OFF)
|
|
|
|
set(OPENSSL_LIBRARIES)
|
2016-03-14 21:37:51 +00:00
|
|
|
endif(${WITH_OPENSSL})
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
option(WITH_FUSE "Fuse is here" ON)
|
|
|
|
if(${WITH_FUSE})
|
2015-09-21 16:44:28 +00:00
|
|
|
find_package(fuse)
|
2016-01-28 06:47:07 +00:00
|
|
|
set(HAVE_LIBFUSE ${FUSE_FOUND})
|
2014-06-23 22:32:32 +00:00
|
|
|
CHECK_FUNCTION_EXISTS(fuse_getgroups HAVE_FUSE_GETGROUPS)
|
|
|
|
endif(${WITH_FUSE})
|
|
|
|
|
2015-09-21 16:18:43 +00:00
|
|
|
option(WITH_XFS "XFS is here" ON)
|
|
|
|
if(${WITH_XFS})
|
|
|
|
find_package(xfs)
|
|
|
|
set(HAVE_XFS ${XFS_FOUND})
|
|
|
|
endif(${WITH_XFS})
|
|
|
|
|
2016-02-03 10:39:28 +00:00
|
|
|
option(WITH_SPDK "Enable SPDK" OFF)
|
|
|
|
if(WITH_SPDK)
|
|
|
|
find_package(pciaccess REQUIRED)
|
|
|
|
find_package(dpdk REQUIRED)
|
|
|
|
set(HAVE_SPDK TRUE)
|
|
|
|
endif(WITH_SPDK)
|
|
|
|
|
2015-08-03 11:59:00 +00:00
|
|
|
find_package(blkid REQUIRED)
|
|
|
|
set(HAVE_LIBBLKID ${BLKID_FOUND})
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
# probably fuse etc need this -- how to check? XXX
|
|
|
|
option(WITH_MDS "MDS is here" ON)
|
|
|
|
|
|
|
|
# needs mds and? XXX
|
|
|
|
option(WITH_CLIENT "Client is here" ON)
|
|
|
|
option(WITH_LIBCEPHFS "libcephfs client library" ON)
|
|
|
|
|
|
|
|
# key-value store
|
|
|
|
option(WITH_KVS "Key value store is here" ON)
|
|
|
|
|
|
|
|
# remote block storage
|
|
|
|
option(WITH_RBD "Remote block storage is here" ON)
|
|
|
|
|
|
|
|
option(WITH_LEVELDB "LevelDB is here" ON)
|
|
|
|
if(${WITH_LEVELDB})
|
|
|
|
find_package(leveldb REQUIRED)
|
|
|
|
set(HAVE_LIBLEVELDB ${LEVELDB_FOUND})
|
2015-09-21 15:20:19 +00:00
|
|
|
find_file(HAVE_LEVELDB_FILTER_POLICY filter_policy.h PATHS /usr/include/leveldb)
|
2014-06-23 22:32:32 +00:00
|
|
|
endif(${WITH_LEVELDB})
|
|
|
|
|
|
|
|
option(WITH_EXPAT "EXPAT is here" ON)
|
|
|
|
if(${WITH_EXPAT})
|
|
|
|
find_package(expat REQUIRED)
|
|
|
|
set(HAVE_EXPAT ${EXPAT_FOUND})
|
|
|
|
endif(${WITH_EXPAT})
|
|
|
|
|
2016-01-01 20:44:32 +00:00
|
|
|
find_package(Cython REQUIRED)
|
2014-06-23 22:32:32 +00:00
|
|
|
find_package(fcgi REQUIRED)
|
|
|
|
|
|
|
|
find_package(atomic_ops REQUIRED)
|
|
|
|
set(HAVE_ATOMIC_OPS ${ATOMIC_OPS_FOUND})
|
2015-09-21 14:37:19 +00:00
|
|
|
message(STATUS "${ATOMIC_OPS_LIBRARIES}")
|
|
|
|
|
|
|
|
option(WITH_GPERFTOOLS "gperftools is here" ON)
|
|
|
|
if(${WITH_GPERFTOOLS})
|
|
|
|
find_package(gperftools)
|
|
|
|
set(HAVE_GPERFTOOLS ${GPERFTOOLS_FOUND})
|
|
|
|
if(${HAVE_GPERFTOOLS})
|
|
|
|
find_file(HAVE_GPERFTOOLS_HEAP_PROFILER_H heap-profiler.h PATHS /usr/include/gperftools)
|
|
|
|
find_file(HAVE_GPERFTOOLS_MALLOC_EXTENSION_H malloc_extension.h PATHS /usr/include/gperftools)
|
|
|
|
find_file(HAVE_GPERFTOOLS_PROFILER_H profiler.h PATHS /usr/include/gperftools)
|
|
|
|
endif(${HAVE_GPERFTOOLS})
|
|
|
|
endif(${WITH_GPERFTOOLS})
|
2014-06-23 22:32:32 +00:00
|
|
|
|
|
|
|
find_package(snappy REQUIRED)
|
|
|
|
|
2015-12-31 02:06:08 +00:00
|
|
|
#if allocator is set on command line make sure it matches below strings
|
|
|
|
if(ALLOCATOR)
|
|
|
|
if(${ALLOCATOR} STREQUAL "tcmalloc")
|
|
|
|
find_package(tcmalloc REQUIRED)
|
|
|
|
set(HAVE_LIBTCMALLOC ${Tcmalloc_FOUND})
|
|
|
|
elseif(${ALLOCATOR} STREQUAL "jemalloc")
|
|
|
|
find_package(JeMalloc REQUIRED)
|
|
|
|
endif()
|
|
|
|
else(ALLOCATOR)
|
|
|
|
find_package(tcmalloc)
|
|
|
|
set(HAVE_LIBTCMALLOC ${Tcmalloc_FOUND})
|
|
|
|
find_package(JeMalloc)
|
|
|
|
if(NOT Tcmalloc_FOUND AND NOT JEMALLOC_FOUND)
|
|
|
|
message(WARNING "tcmalloc and jemalloc not found, falling back to libc")
|
|
|
|
set(ALLOCATOR "libc")
|
|
|
|
endif(NOT Tcmalloc_FOUND AND NOT JEMALLOC_FOUND)
|
|
|
|
endif(ALLOCATOR)
|
2014-06-23 22:32:32 +00:00
|
|
|
|
2015-09-21 15:08:19 +00:00
|
|
|
find_package(keyutils REQUIRED)
|
|
|
|
|
2015-09-21 15:37:18 +00:00
|
|
|
find_package(libuuid REQUIRED)
|
|
|
|
|
2015-09-21 15:50:45 +00:00
|
|
|
find_package(libcurl REQUIRED)
|
2015-09-21 15:50:45 +00:00
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
option(USE_CRYPTOPP "Cryptopp is ON" ON)
|
|
|
|
find_package(cryptopp)
|
|
|
|
if(CRYPTOPP_FOUND)
|
|
|
|
MESSAGE(STATUS "${CRYPTOPP_LIBRARIES}")
|
|
|
|
set(CRYPTO_LIBS ${CRYPTOPP_LIBRARIES})
|
2015-03-15 19:06:46 +00:00
|
|
|
set(USE_NSS 0)
|
2014-06-23 22:32:32 +00:00
|
|
|
else()
|
2015-03-15 19:06:46 +00:00
|
|
|
MESSAGE(STATUS "Cryptopp not found using NSS instead")
|
2015-09-21 14:57:26 +00:00
|
|
|
find_package(NSS REQUIRED)
|
2014-06-23 22:32:32 +00:00
|
|
|
if(NSS_FOUND)
|
2015-03-15 19:06:46 +00:00
|
|
|
set(USE_NSS 1)
|
|
|
|
set(USE_CRYPTOPP 0)
|
|
|
|
find_package(NSPR)
|
|
|
|
if(NSPR_FOUND)
|
|
|
|
set(CRYPTO_LIBS ${NSS_LIBRARIES} ${NSPR_LIBRARIES})
|
|
|
|
#MESSAGE(STATUS "${CRYPTO_LIBS}")
|
|
|
|
#MESSAGE(STATUS "${NSS_INCLUDE_DIR} ${NSPR_INCLUDE_DIR}")
|
|
|
|
endif(NSPR_FOUND)
|
2014-06-23 22:32:32 +00:00
|
|
|
endif(NSS_FOUND)
|
|
|
|
endif(CRYPTOPP_FOUND)
|
|
|
|
|
2016-01-04 20:03:48 +00:00
|
|
|
option(WITH_XIO "Enable XIO messaging" OFF)
|
2014-06-23 22:32:32 +00:00
|
|
|
if(WITH_XIO)
|
2016-01-04 20:03:48 +00:00
|
|
|
find_package(xio REQUIRED)
|
2016-05-03 17:19:43 +00:00
|
|
|
set(HAVE_XIO ${XIO_FOUND})
|
2014-06-23 22:32:32 +00:00
|
|
|
endif(WITH_XIO)
|
|
|
|
|
|
|
|
#option for RGW
|
|
|
|
option(WITH_RADOSGW "Rados Gateway is enabled" ON)
|
|
|
|
|
2015-08-03 11:48:32 +00:00
|
|
|
#option for CephFS
|
|
|
|
option(WITH_CEPHFS "CephFS is enabled" ON)
|
|
|
|
|
2015-10-16 17:12:41 +00:00
|
|
|
option(WITH_THREAD_SAFE_RES_QUERY "res_query is thread safe" OFF)
|
|
|
|
if(WITH_THREAD_SAFE_RES_QUERY)
|
|
|
|
set(HAVE_THREAD_SAFE_RES_QUERY 1 CACHE INTERNAL "Thread safe res_query supported.")
|
|
|
|
endif(WITH_THREAD_SAFE_RES_QUERY)
|
|
|
|
|
2015-12-07 18:33:32 +00:00
|
|
|
option(WITH_REENTRANT_STRSIGNAL "strsignal is reentrant" OFF)
|
|
|
|
if(WITH_REENTRANT_STRSIGNAL)
|
|
|
|
set(HAVE_REENTRANT_STRSIGNAL 1 CACHE INTERNAL "Reentrant strsignal is supported.")
|
|
|
|
endif(WITH_REENTRANT_STRSIGNAL)
|
|
|
|
|
2015-12-31 03:58:55 +00:00
|
|
|
set(HAVE_LIBROCKSDB 1)
|
|
|
|
|
2016-01-06 11:37:49 +00:00
|
|
|
# -lz link into kv
|
2015-12-31 03:58:55 +00:00
|
|
|
find_package(ZLIB REQUIRED)
|
|
|
|
|
2015-12-31 03:01:52 +00:00
|
|
|
#option for LTTng
|
2016-02-29 21:11:04 +00:00
|
|
|
#currently off by default because lttng-gen-tp run unconditionally and forces a rebuild
|
|
|
|
option(WITH_LTTNG "LTTng tracing is enabled" OFF)
|
2015-12-31 03:01:52 +00:00
|
|
|
if(${WITH_LTTNG})
|
|
|
|
find_package(lttng-ust)
|
|
|
|
set(WITH_LTTNG ${LTTNG_FOUND})
|
|
|
|
endif(${WITH_LTTNG})
|
|
|
|
|
2015-12-31 04:34:30 +00:00
|
|
|
#option for Babeltrace
|
|
|
|
option(HAVE_BABELTRACE "Babeltrace libraries are enabled" ON)
|
|
|
|
if(${HAVE_BABELTRACE})
|
|
|
|
find_package(babeltrace REQUIRED)
|
|
|
|
set(WITH_BABELTRACE ${BABELTRACE_FOUND})
|
|
|
|
set(HAVE_BABELTRACE_BABELTRACE_H ${BABELTRACE_FOUND})
|
|
|
|
set(HAVE_BABELTRACE_CTF_EVENTS_H ${BABELTRACE_FOUND})
|
|
|
|
endif(${HAVE_BABELTRACE})
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
# Now create a useable config.h
|
|
|
|
configure_file(
|
|
|
|
${PROJECT_SOURCE_DIR}/src/include/config-h.in.cmake
|
|
|
|
${PROJECT_BINARY_DIR}/include/acconfig.h
|
|
|
|
)
|
|
|
|
include_directories(${PROJECT_BINARY_DIR}/include)
|
|
|
|
|
|
|
|
add_definitions(-D__linux__)
|
|
|
|
|
|
|
|
if(${ENABLE_SHARED})
|
|
|
|
set(Boost_USE_STATIC_LIBS OFF)
|
|
|
|
else(${ENABLE_SHARED})
|
|
|
|
set(Boost_USE_STATIC_LIBS ON)
|
|
|
|
endif(${ENABLE_SHARED})
|
|
|
|
|
|
|
|
set(Boost_USE_MULTITHREADED ON)
|
2016-01-12 14:39:58 +00:00
|
|
|
find_package(Boost COMPONENTS thread system regex random program_options date_time iostreams REQUIRED)
|
2014-06-23 22:32:32 +00:00
|
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
|
|
|
# find out which platform we are building on
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
set(LINUX ON)
|
|
|
|
set(UNIX ON)
|
|
|
|
FIND_PACKAGE(Threads)
|
|
|
|
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
|
|
|
|
# find out which platform we are building on
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
2016-01-12 14:39:58 +00:00
|
|
|
set(OperatingSystem "Mac OS X")
|
2014-06-23 22:32:32 +00:00
|
|
|
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
|
|
|
2015-08-17 20:26:47 +00:00
|
|
|
# enables testing and creates Make check command
|
|
|
|
enable_testing()
|
|
|
|
set(CMAKE_CTEST_COMMAND ctest -V)
|
|
|
|
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
|
|
|
|
|
2014-06-23 22:32:32 +00:00
|
|
|
add_subdirectory(src)
|
2015-05-22 14:38:29 +00:00
|
|
|
|
|
|
|
# man pages must be preprocessed, not supported yet
|
|
|
|
#add_subdirectory(man)
|