Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling and Verifying Ceph

Preparing the Compilation Environment

  1. Modify the yum.conf file.
    1. Open the file.
      1
      vim /etc/yum.conf
      
    2. Press I to enter the insert mode and add sslverify=false and deltarpm=0.

    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  2. (Optional) Modify the scl REPO file.
    This file needs to be modified only when CentOS 7.6 is used.
    1. Download and open the file.
      1
      2
      yum -y install centos-release-scl
      vim /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
      
    2. Press I to enter the insert mode and change http to https.

    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  3. (Optional) Modify the requirements.txt file of the dashboard.
    This file needs to be modified only when CentOS 7.6 is used.
    1. Open the file.
      1
      vim /home/ceph-14.2.8/src/pybind/mgr/dashboard/requirements.txt
      
    2. Press I to enter the insert mode and comment out pyopenssl.

    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.

Compiling Software

  1. Upgrade isa-l.

    The version of isa-l contained in the Ceph 14.2.8 source code is early. Upgrade isa-l.

    1. Go to the src directory.
      1
      cd /home/ceph-14.2.8/src
      
    2. Back up the original isa-l and obtain the latest isa-l 2.29 source code.
      1
      2
      3
      4
      mv isa-l isa-l.bak
      wget https://github.com/intel/isa-l/archive/refs/tags/v2.29.0.tar.gz --no-check-certificate
      tar -xzvf v2.29.0.tar.gz
      mv isa-l-2.29.0 isa-l
      
    3. Modify some isa-l source code to adapt to AArch64.
      For details, visit GitHub.

      In the file, the red lines are to be deleted, and the green lines are to be added and modified.

      After the upgrade is complete, the aarch64 directory exists in isa-l/erasure_code/.

  2. Install the dependencies.
    • On CentOS 7.6:
      1
      2
      3
      4
      yum -y install epel-release 
      yum -y install python36-scipy.aarch64 
      cd /home/ceph-14.2.8/ 
      sh install-deps.sh  
      
    • On openEuler 20.03:
      1
      2
      cd /home/ceph-14.2.8/ 
      sh install-deps.sh
      
  3. Modify do_cmake.sh.
    1. Open the file.
      1
      vim do_cmake.sh
      
    2. Press i to enter the insert mode and modify the file as follows:
      ${CMAKE} -DCMAKE_BUILD_TYPE=RelWithDebInfo $ARGS "$@" .. || exit 1

      Comment out git submodule update --init --recursive to prevent isa-l from being rolled back to the old version when building an RPM package.

    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  4. Execute do_cmake.sh.
    1
    sh do_cmake.sh    
    
  5. Start the compilation.
    The compilation requires GCC 7 or later. Make the compilation environment ready. {number} in the following indicates the number of jobs during compilation. Generally, a larger value indicates a faster compilation speed. However, the value cannot exceed the number of CPU cores.
    1
    2
    cd /home/ceph-14.2.8/build 
    make -j{number}
    
  6. Perform a unit test.
    1
    ctest3 -V -R unittest_erasure_code
    

  7. Delete the build directory.
    1
    2
    cd /home/ceph-14.2.8/ 
    rm -rf build