Preparing the build environment

Use the following command to clone the Ceph git repository:

    git clone https://github.com/ceph/ceph.git

The preceding command will give the following output:

Once we have cloned the Ceph git repository, we need to edit the CMakeLists.txt file and add in a section for our new class that we are going to write.

Edit the following file in the source tree:

    ~/ceph/src/cls/CMakeLists.txt

Also, place the following in the file:

# cls_md5
set(cls_md5_srcs md5/cls_md5.cc)
add_library(cls_md5 SHARED ${cls_md5_srcs})
set_target_properties(cls_md5 PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
INSTALL_RPATH "")
install(TARGETS cls_md5 DESTINATION ${cls_dir})
target_link_libraries(cls_md5 crypto)
list(APPEND cls_embedded_srcs ${cls_md5_srcs})

Once the cmakelist.txt file is updated, we can get cmake to make the build environment by running the following command:

    do_cmake.sh

The preceding command will give the following output:

This will create a build directory in the source tree.

In order for us to build the RADOS class, we need to install the required packages that contains the make command:

    sudo apt-get install build-essentials

There is also a install-deps.sh file in the Ceph source tree, which will install the remaining required packages when run.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.25.217