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.
- 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.
- 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
- Install common components.
1yum 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
- Set the directory for building RPM packages.
- Open the /root/.rpmmacros file.
1vi /root/.rpmmacros - 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 - Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Create a build directory in the rpmbuild directory.
1rpmdev-setuptree
- Open the /root/.rpmmacros file.
- Download and install the UCX package. For details, see Table 4.
1rpm -ivh ucx-1.14.1-1.el7.src.rpm
- To avoid errors reported when UCX is deployed in a container and improve the UCX performance, modify code as follows.
- Switch to the /root/rpmbuild/SOURCES/ directory.
1cd /root/rpmbuild/SOURCES/
- Decompress ucx-1.14.1.tar.gz.
1tar -zxvf ucx-1.14.1.tar.gz
- Open the ucx-1.14.1/src/ucs/sys/sys.c file and locate line 1560.
1vim ucx-1.14.1/src/ucs/sys/sys.c +1560
- Press i to enter the insert mode. Add the following content to line 1560:
1pid = getpid();

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

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

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

- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- 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
- Switch to the /root/rpmbuild/SOURCES/ directory.
- 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.

- 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
Parent topic: Compiling Software Packages in the Compilation Container