Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

Commit

Permalink
Support Rocky Linux 8 (#428)
Browse files Browse the repository at this point in the history
* 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 <hspark0582@gluesys.com>

* Use ifndef instead of removing a #define

Signed-off-by: Hyunseung Park <hspark0582@gluesys.com>

* Combine pkgdep scripts into one file

Installing dependencies were originally done in a new
separate file, pkgdep_rocky8.sh. As recommended in a
review comment, we have combined the two into pkgdep.sh.

We have tested new pkgdep.sh against Ubuntu 18.04,
Rocky Linux 8.6, and also CentOS Stream 8. There were
some changes to make the script also work on CentOS.
We have thought of making it also run on RHEL itself,
but since it does not provide some packages we can use
on Rocky/CentOS, we need to manually build them (too)
or use CentOS repositories. We will consider
implementing it if you desire.

Finally, some refactoring using PKGS variable.
Now it looks (hopefully/arguably) less ugly while
still not calling dnf every time.

* Use os-release rather than centos-release

Just copied spdk os check :)

* Install go after installing necessary packages

Error occurred while installing go in rocky/CentOS since minimal install of them does not have wget and tar.
I messed up the order during combining scripts. Sorry!

* Only apply PKG_CONFIG_PATH on centos and rocky 8

Signed-off-by: Hyunseung Park <hspark0582@gluesys.com>
  • Loading branch information
hspark0582 committed Oct 18, 2022
1 parent a8791ea commit 98f9e01
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion configure
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/CMakeLists.txt
Expand Up @@ -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
)
Expand Down
17 changes: 16 additions & 1 deletion lib/dpdk-20.08.patch
@@ -1,5 +1,5 @@
diff --git drivers/bus/pci/linux/pci.c drivers/bus/pci/linux/pci.c
index a2198abf4..a51ad0f88 100644
index a2198abf43..a51ad0f88c 100644
--- drivers/bus/pci/linux/pci.c
+++ drivers/bus/pci/linux/pci.c
@@ -331,7 +331,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
Expand All @@ -11,3 +11,18 @@ 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 a288ce57dc..573a35ffb4 100644
--- drivers/vdpa/ifc/base/ifcvf.h
+++ drivers/vdpa/ifc/base/ifcvf.h
@@ -13,7 +13,10 @@
#define IFCVF_SUBSYS_DEVICE_ID 0x001A

#define IFCVF_MAX_QUEUES 1
+
+#ifndef VIRTIO_F_IOMMU_PLATFORM
#define VIRTIO_F_IOMMU_PLATFORM 33
+#endif

/* Common configuration */
#define IFCVF_PCI_CAP_COMMON_CFG 1
13 changes: 13 additions & 0 deletions lib/spdk-22.01.1.patch
Expand Up @@ -3908,6 +3908,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
Expand Down
10 changes: 9 additions & 1 deletion script/build_ibofos.sh
Expand Up @@ -3,6 +3,8 @@
# build_ibofos.sh
#

source /etc/os-release

rootdir=$(readlink -f $(dirname $0))/..
BUILD_INTERNAL=FALSE
BUILD_ASAN=n
Expand All @@ -25,6 +27,11 @@ build_pos()
else
./configure --without-asan
fi

if echo "$ID $VERSION_ID" | grep -E -q 'centos 8|rocky 8'; then
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
fi

make -j 8
}

Expand All @@ -36,4 +43,5 @@ do
esac
done

build_pos
build_pos

116 changes: 114 additions & 2 deletions script/pkgdep.sh
Expand Up @@ -4,9 +4,11 @@
SYSTEM=`uname -s`
POS_ROOT=$(readlink -f $(dirname $0))/..

${POS_ROOT}/script/install_go.sh
source /etc/os-release

if [ -f /etc/debian_version ]; then
${POS_ROOT}/script/install_go.sh

# Includes Ubuntu, Debian
apt-get install -y gcc g++ make git
# Additional dependencies for NVMe over Fabrics
Expand Down Expand Up @@ -80,8 +82,118 @@ if [ -f /etc/debian_version ]; then
# for address sanitizer
apt install -y libasan4
apt install -y libasan4-dbg
elif echo "$ID $VERSION_ID" | grep -E -q 'centos 8|rocky 8'; then
set -e # exit immediately on any fail

POS_ROOT=$(readlink -f $(dirname $0))/..

dnf install -y epel-release
dnf config-manager --set-enabled powertools

PKGS="gcc gcc-c++ make git" # g++ -> gcc-c++
PKGS="${PKGS} rdma-core-devel" # libibverbs-dev, librdmacm-dev
PKGS="${PKGS} jsoncpp-devel" # libjsoncpp-dev
PKGS="${PKGS} libpciaccess-devel" # libpciaccess-dev
PKGS="${PKGS} python3-configshell" # python-configshell*
PKGS="${PKGS} numactl-devel libuuid-devel" # libnuma-dev -> numactl-devel, uuid-dev -> libuuid-devel
PKGS="${PKGS} libibverbs-utils perftest" # ibverbs-utils -> libibverbs-utils
PKGS="${PKGS} python3 python3-pip"
PKGS="${PKGS} iperf"
PKGS="${PKGS} cmake systemd-devel" # libsystemd-dev -> systemd-devel
PKGS="${PKGS} jq rapidjson-devel" # rapidjson-dev -> rapidjson-devel
PKGS="${PKGS} python3-psutil"
PKGS="${PKGS} ccache"
PKGS="${PKGS} libmnl-devel" # libmnl-dev
PKGS="${PKGS} automake autoconf libtool bison flex"
PKGS="${PKGS} python3-paramiko"
PKGS="${PKGS} xfsprogs"
PKGS="${PKGS} clang-tools-extra" # clang-format
PKGS="${PKGS} libpmemblk-devel" # libpmemblk-dev
PKGS="${PKGS} meson"
PKGS="${PKGS} python3-pytz" # python3-tz
PKGS="${PKGS} gdb"
# libjsonrpccpp-dev will be installed manually
PKGS="${PKGS} c-ares-devel pkg-config cmake" # libc-ares-dev -> c-ares-devel
PKGS="${PKGS} pigz"
PKGS="${PKGS} mandoc"
PKGS="${PKGS} yaml-cpp-devel" # libyaml-cpp-dev
PKGS="${PKGS} numactl"
PKGS="${PKGS} tbb-devel" # libtbb-dev
# nvme module already available by default
PKGS="${PKGS} google-perftools-devel" # libgoogle-perftools-dev
PKGS="${PKGS} rocksdb-devel" # librocksdb-dev
# libisal-dev will be installed manually
# libasan -> gcc

# Additional packages
PKGS="${PKGS} patch wget tar openssl-devel"

dnf install -y ${PKGS}

${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
else
echo "pkgdep: unknown system type."
exit 1
exit 1
fi

0 comments on commit 98f9e01

Please sign in to comment.