build on MacOS

Since we’ve switched to C++ 17, and the default clang shipped with Xcode 9 does not support all the C++ 17 language features, it’s suggested to install clang using brew:

  1. brew install --with-toolchain llvm

and install all the necessary bits:

  1. brew install snappy ccache cmake pkg-config
  2. pip install cython

install FUSE if you want to build the FUSE support:

  1. brew cask install osxfuse

then, under the source directory of Ceph:

  1. mkdir build
  2. cd build
  3. cmake .. -DBOOST_J=4 \
  4. -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang \
  5. -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ \
  6. -DCMAKE_EXE_LINKER_FLAGS="-L/usr/local/opt/llvm/lib" \
  7. -DENABLE_GIT_VERSION=OFF \
  8. -DWITH_MANPAGE=OFF \
  9. -DWITH_LIBCEPHFS=OFF \
  10. -DWITH_XFS=OFF \
  11. -DWITH_KRBD=OFF \
  12. -DWITH_LTTNG=OFF \
  13. -DWITH_BABELTRACE=OFF \
  14. -DWITH_BLUESTORE=OFF \
  15. -DWITH_RADOSGW=OFF \
  16. -DWITH_SPDK=OFF \
  17. -DSNAPPY_ROOT_DIR=/usr/local/Cellar/snappy/1.1.7_1

The paths to nss and snappy might vary if newer versions of the packages are installed.

Also, please consider using boost v1.69 to address the bug of https://github.com/boostorg/atomic/issues/15.

Currently, the most practical uses for Ceph on MacOS might be FUSE and some other librados based applications.