From b135c4c3a1c3bffa2a261a895c6059aebdc657b8 Mon Sep 17 00:00:00 2001 From: Hyunseung Park Date: Wed, 28 Sep 2022 18:30:29 +0900 Subject: [PATCH] Support Rocky Linux 8 This commit adds pkgdep_rocky8.sh for installing dependencies in Rocky Linux, and fixes compile issues (which is mostly from using different version of gcc) We tried not to break on Ubuntu environments and we tested on our machine. Signed-off-by: Hyunseung Park --- .gitignore | 1 + configure | 2 +- lib/CMakeLists.txt | 2 +- lib/dpdk-20.08.patch | 12 +++++ lib/spdk-22.01.1.patch | 13 +++++ script/build_ibofos.sh | 2 +- script/pkgdep_rocky8.sh | 110 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 139 insertions(+), 3 deletions(-) create mode 100755 script/pkgdep_rocky8.sh diff --git a/.gitignore b/.gitignore index 77963ca4ca..fea0651e95 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ CONFIG.local .cproject .settings bin/ +dep/ lib/spdk-19.01.1/mk/cc.mk lib/spdk-19.01.1/mk/config.mk lib/spdk-19.01.1/include/spdk/config.h diff --git a/configure b/configure index 3e6a978b9a..9a991b29b4 100755 --- a/configure +++ b/configure @@ -134,7 +134,7 @@ config_h="mk/ibof_config.h" rm -rf ${config_h}; touch ${config_h} echo "#pragma once" >> ${config_h} echo "" >> ${config_h} -python script/genconfig.py >> ${config_h} +python3 script/genconfig.py >> ${config_h} # On FreeBSD sed -i 'SUFFIX' - SUFFIX is mandatory. So no way but to delete the backed file. diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 4f8d2108eb..072b04195d 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -340,7 +340,7 @@ ExternalProject_Add(opentelemetry-cpp LOG_CONFIGURE ON LOG_BUILD ON LOG_INSTALL ON - CONFIGURE_COMMAND cmake ${PROJ_ROOT}/lib/${POS_DEP_OTEL} -DBUILD_TESTING=OFF -DWITH_OTLP=ON -DWITH_ABSEIL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX:PATH=${PROJ_ROOT}/lib/${POS_DEP_OTEL} + CONFIGURE_COMMAND cmake ${PROJ_ROOT}/lib/${POS_DEP_OTEL} -DBUILD_TESTING=OFF -DWITH_OTLP=ON -DWITH_ABSEIL=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX:PATH=${PROJ_ROOT}/lib/${POS_DEP_OTEL} -DCMAKE_INSTALL_LIBDIR=lib BUILD_COMMAND cmake --build ${PROJ_ROOT}/lib/${POS_DEP_OTEL} --target all -- -j ${NUM_BUILD_CORE} INSTALL_COMMAND make install ) diff --git a/lib/dpdk-20.08.patch b/lib/dpdk-20.08.patch index ce3a752738..6eabfd2f7c 100644 --- a/lib/dpdk-20.08.patch +++ b/lib/dpdk-20.08.patch @@ -11,3 +11,15 @@ index a2198abf4..a51ad0f88 100644 return 0; } /* device is valid, add in list (sorted) */ +diff --git drivers/vdpa/ifc/base/ifcvf.h drivers/vdpa/ifc/base/ifcvf.h +index a288ce57d..3b9e4dee5 100644 +--- drivers/vdpa/ifc/base/ifcvf.h ++++ drivers/vdpa/ifc/base/ifcvf.h +@@ -13,7 +13,6 @@ + #define IFCVF_SUBSYS_DEVICE_ID 0x001A + + #define IFCVF_MAX_QUEUES 1 +-#define VIRTIO_F_IOMMU_PLATFORM 33 + + /* Common configuration */ + #define IFCVF_PCI_CAP_COMMON_CFG 1 diff --git a/lib/spdk-22.01.1.patch b/lib/spdk-22.01.1.patch index 1e44c8cc8e..e81dc3715e 100644 --- a/lib/spdk-22.01.1.patch +++ b/lib/spdk-22.01.1.patch @@ -3882,6 +3882,19 @@ index b6573a237..0f1a8e119 100644 /* Create poll group threads, and send a message to each thread * and create a poll group. */ +diff --git scripts/pkgdep/rhel.sh scripts/pkgdep/rhel.sh +index d307d1bce..212b1e907 100755 +--- scripts/pkgdep/rhel.sh ++++ scripts/pkgdep/rhel.sh +@@ -83,7 +83,7 @@ fi + + yum install -y gcc gcc-c++ make cmake CUnit-devel libaio-devel openssl-devel \ + libuuid-devel libiscsi-devel ncurses-devel json-c-devel libcmocka-devel +-if echo "$ID $VERSION_ID" | grep -E -q 'centos 8|rhel 8'; then ++if echo "$ID $VERSION_ID" | grep -E -q 'centos 8|rhel 8|rocky 8'; then + yum install -y python36 + #Create hard link to use in SPDK as python + if [[ ! -e /usr/bin/python && -e /etc/alternatives/python3 ]]; then diff --git scripts/rpc.py scripts/rpc.py index ab034142b..3f3358a7a 100755 --- scripts/rpc.py diff --git a/script/build_ibofos.sh b/script/build_ibofos.sh index 8b568a893f..fe05d244a8 100755 --- a/script/build_ibofos.sh +++ b/script/build_ibofos.sh @@ -25,7 +25,7 @@ build_pos() else ./configure --without-asan fi - make -j 8 + PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig make -j 8 } while getopts "i" opt diff --git a/script/pkgdep_rocky8.sh b/script/pkgdep_rocky8.sh new file mode 100755 index 0000000000..b7a01d876e --- /dev/null +++ b/script/pkgdep_rocky8.sh @@ -0,0 +1,110 @@ +# !/bin/sh +# Please run this script as root. + +set -e # exit immediately on any fail + +POS_ROOT=$(readlink -f $(dirname $0))/.. + +dnf install -y epel-release +crb enable + +dnf -y install \ + gcc gcc-c++ `# g++` make git \ + rdma-core-devel `# libibverbs-dev librdmacm-dev` \ + jsoncpp-devel `# libjsoncpp-dev` \ + libpciaccess-devel `# libpciaccess-dev` \ + python3-configshell `# "python-configshell*"` \ + numactl-devel `# libnuma-dev` libuuid-devel `# uuid-dev` libibverbs-utils `# ibverbs-utils` perftest \ + python3 python3-pip \ + iperf \ + cmake systemd-devel `# libsystemd-dev` \ + jq rapidjson-devel `# rapidjson-dev` \ + python3-psutil \ + ccache \ + libmnl-devel `# libmnl-dev` \ + automake autoconf libtool bison flex python3-paramiko \ + xfsprogs \ + clang-tools-extra `# clang-format` \ + libpmemblk-devel `# libpmemblk-dev` \ + meson \ + python3-pytz `# python3-tz` \ + gdb \ + `# libjsonrpccpp-dev does not exist` \ + c-ares-devel `# libc-ares-dev` pkg-config cmake \ + pigz \ + mandoc \ + yaml-cpp-devel `# libyaml-cpp-dev` \ + numactl \ + tbb-devel `# libtbb-dev` \ + `# linux-modules-extra not needed` \ + google-perftools-devel `# libgoogle-perftools-dev` \ + rocksdb-devel `# librocksdb-dev` \ + `# libisal-dev does not exist` \ + `# libasan included in gcc?` + +# Additional packages +dnf -y install patch wget tar openssl-devel + +${POS_ROOT}/script/install_go.sh + +# dir to build unsupported dependencies +rm -rf ${POS_ROOT}/dep +mkdir -p ${POS_ROOT}/dep + +# libsonrpccpp +## libargtable +cd ${POS_ROOT}/dep +wget 'http://prdownloads.sourceforge.net/argtable/argtable2-13.tar.gz' +tar xf argtable2-13.tar.gz +cd argtable2-13 +./configure +make -j 4 +make install + +## catch +cd /usr/include +wget 'https://github.com/catchorg/Catch2/releases/download/v1.12.2/catch.hpp' + +## hiredis +cd ${POS_ROOT}/dep +git clone 'https://github.com/redis/hiredis.git' +cd hiredis +mkdir build +cd build +cmake .. -DCMAKE_INSTALL_PREFIX=/usr +make -j 4 +make install + +## other deps +dnf -y install libcurl-devel libmicrohttpd-devel jsoncpp-devel cmake + +## finally itself +cd ${POS_ROOT}/dep +git clone 'https://github.com/cinemast/libjson-rpc-cpp.git' +cd libjson-rpc-cpp +git checkout v1.0.0 +mkdir build +cd build +cmake .. +make -j 4 +make install +ldconfig + +# isa-l +cd ${POS_ROOT}/dep +dnf -y install nasm +git clone 'https://github.com/intel/isa-l.git' +cd isa-l +./autogen.sh +./configure +make +make install + +python3 -m pip install py-markdown-table pyyaml + +# jsoncpp-devel installed in different directory: link it +mkdir -p /usr/include/jsoncpp +ln -s /usr/include/json /usr/include/jsoncpp/json + +# RHEL does not look for libraries in /usr/local/lib unlike Ubuntu +echo '/usr/local/lib' > /etc/ld.so.conf.d/pos-local-lib.conf