Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling and Installing the UCX Package

Compile and deploy UCX open source software packages, including compiling and generating UCX RPM dependency packages required for compiling Ceph.

  1. Access the compilation container and configure environment variables such as proxies. You are not advised to configure the environment variables in bashrc.
    1
    2
    3
    4
    podman exec -it openeuler2203sp4_build /bin/bash
    export TMOUT=0
    export http_proxy=http://xxx// Set it as required.
    export https_proxy=http://xxx // Set it as required.
    
  2. Obtain UCX open source software packages. For details, see Table 4.
    cd /home
    wget https://github.com/openucx/ucx/releases/download/v1.14.1/ucx-1.14.1-1.el7.src.rpm --no-check-certificate
    wget https://github.com/openucx/ucx/releases/download/v1.14.1/ucx-1.14.1.tar.gz --no-check-certificate
  3. Install common components.
    1
    yum install CUnit-devel boost-random checkpolicy cmake cryptsetup-devel expat-devel fmt-devel fuse-devel gperf java-devel junit keyutils-libs-devel libaio-devel libbabeltrace-devel libblkid-devel libcap-ng-devel libcurl-devel numactl-devel libicu-devel libnl3-devel liboath-devel librabbitmq-devel librdkafka-devel librdmacm-devel libtool libxml2-devel lttng-ust-devel lua-devel luarocks lz4-devel make nasm ncurses-devel ninja-build nss-devel openldap-devel openssl-devel libudev-devel python3-Cython python3-devel python3-prettytable python3-pyyaml python3-setuptools python3-sphinx re2-devel selinux-policy-devel sharutils snappy-devel sqlite-devel sudo thrift-devel valgrind-devel xfsprogs-devel xmlstarlet doxygen meson python3-pyelftools -y
    
  4. Set the directory for building RPM packages.
    1. Open the /root/.rpmmacros file.
      1
      vi /root/.rpmmacros
      
    2. Press i to enter the insert mode, set %_topdir to the path for building RPM packages (/root/rpmbuild is used as an example), and comment out other lines. (When setting the path for the first time, the file does not exist or is empty. You can add the following content and save it.)
      1
      %_topdir /root/rpmbuild
      
    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
    4. Create a build directory in the rpmbuild directory.
      1
      rpmdev-setuptree
      
  5. Download and install the UCX package. For details, see Table 4.
    1
    rpm -ivh ucx-1.14.1-1.el7.src.rpm
    
  6. To avoid errors reported when UCX is deployed in a container and improve the UCX performance, modify code as follows.
    1. Switch to the /root/rpmbuild/SOURCES/ directory.
      1
      cd /root/rpmbuild/SOURCES/
      
    2. Decompress ucx-1.14.1.tar.gz.
      1
      tar -zxvf ucx-1.14.1.tar.gz
      
    3. Open the ucx-1.14.1/src/ucs/sys/sys.c file and locate line 1560.
      1
      vim ucx-1.14.1/src/ucs/sys/sys.c +1560
      
    4. Press i to enter the insert mode. Add the following content to line 1560:
      1
      pid = getpid();
      

    5. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
    6. Open the ucx-1.14.1/src/ucp/core/ucp_context.c file and locate line 2156.
      1
      vim ucx-1.14.1/src/ucp/core/ucp_context.c +2156
      
    7. Press i to enter the insert mode, add #if 0 to line 2156, and add #endif to the end of the function.

    8. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
    9. Open the ucx-1.14.1/src/ucs/config/parser.c file and locate line 1989.
      1
      vim ucx-1.14.1/src/ucs/config/parser.c +1989
      
    10. Press i to enter the insert mode, add #if 0 to line 1989, and add #endif to the end of the print.

    11. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
    12. Open the ucx-1.14.1/src/uct/ib/base/ib_iface.c file and locate line 735.
      1
      vim ucx-1.14.1/src/uct/ib/base/ib_iface.c +735
      
    13. Press i to enter the insert mode, comment out line 735, and add the following code:
      ah_attr->grh.flow_label = 0;

    14. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
    15. Package the file.
      1
      2
      rm -rf ucx-1.14.1.tar.gz
      tar zcvf ucx-1.14.1.tar.gz ucx-1.14.1
      
  7. In the rpmbuild directory, compile and build the ucx.spec file to generate RPM packages.
    1
    2
    cd /root/rpmbuild/SPECS
    rpmbuild -bb ucx.spec
    

    After the build is complete, eight RPM packages are generated in the /root/rpmbuild/RPMS/aarch64 directory, as shown in the following figure.

  8. Copy the RPM packages to the /home/local_rpm/ directory and install them.
    1
    2
    3
    mkdir -p /home/local_rpm/
    cp /root/rpmbuild/RPMS/aarch64/ucx* /home/local_rpm/
    cd /home/local_rpm/
    
    1
    2
    3
    4
    5
    6
    7
    8
    rpm -ivh ucx-1.14.1-1.aarch64.rpm
    rpm -ivh ucx-cma-1.14.1-1.aarch64.rpm
    rpm -ivh ucx-debuginfo-1.14.1-1.aarch64.rpm
    rpm -ivh ucx-debugsource-1.14.1-1.aarch64.rpm
    rpm -ivh ucx-devel-1.14.1-1.aarch64.rpm
    rpm -ivh ucx-ib-1.14.1-1.aarch64.rpm
    rpm -ivh ucx-rdmacm-1.14.1-1.aarch64.rpm
    rpm -ivh ucx-static-1.14.1-1.aarch64.rpm