2020-05-18 13:15:42 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-11-02 15:49:40 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright (C) 2020 Intel Corporation
|
|
|
|
# All rights reserved.
|
2023-01-11 07:24:19 +00:00
|
|
|
# Copyright (c) 2022 Dell Inc, or its subsidiaries.
|
2022-11-02 15:49:40 +00:00
|
|
|
#
|
2020-05-18 13:15:42 +00:00
|
|
|
|
2020-08-20 14:12:41 +00:00
|
|
|
disclaimer() {
|
|
|
|
case "$ID" in
|
|
|
|
rhel)
|
|
|
|
cat <<- WARN
|
|
|
|
|
|
|
|
WARNING: $PRETTY_NAME system detected.
|
|
|
|
|
|
|
|
Please, note that the support for this platform is considered to be "best-effort",
|
|
|
|
as in, access to some packages may be limited and/or missing. Review your repo
|
|
|
|
setup to make sure installation of all dependencies is possible.
|
|
|
|
|
|
|
|
WARN
|
|
|
|
|
|
|
|
# Don't trigger errexit, simply install what's available. This is default
|
|
|
|
# behavior of older yum versions (e.g. the one present on RHEL 7.x) anyway.
|
|
|
|
yum() { "$(type -P yum)" --skip-broken "$@"; }
|
2020-09-23 18:32:28 +00:00
|
|
|
# For systems which are not registered, subscription-manager will most likely
|
|
|
|
# fail on most calls so simply ignore its failures.
|
|
|
|
sub() { subscription-manager "$@" || :; }
|
2020-08-20 14:12:41 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
*) ;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2020-12-08 12:51:20 +00:00
|
|
|
is_repo() { yum repolist --all | grep -q "^$1"; }
|
|
|
|
|
2020-08-20 14:12:41 +00:00
|
|
|
disclaimer
|
|
|
|
|
2020-09-01 13:16:30 +00:00
|
|
|
# First, add extra EPEL, ELRepo, Ceph repos to have a chance of covering most of the packages
|
2020-08-20 17:00:33 +00:00
|
|
|
# on the enterprise systems, like RHEL.
|
2022-03-21 12:58:25 +00:00
|
|
|
if [[ $ID == centos || $ID == rhel || $ID == rocky ]]; then
|
2020-09-01 13:16:30 +00:00
|
|
|
repos=() enable=("epel" "elrepo" "elrepo-testing")
|
2022-03-21 12:58:25 +00:00
|
|
|
[[ $ID == centos || $ID == rocky ]] && enable+=("extras")
|
2020-09-01 13:16:30 +00:00
|
|
|
if [[ $VERSION_ID == 7* ]]; then
|
|
|
|
repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm")
|
|
|
|
repos+=("https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm")
|
|
|
|
[[ $ID == centos ]] && repos+=("centos-release-ceph-nautilus.noarch")
|
2021-09-14 15:02:05 +00:00
|
|
|
[[ $ID == centos ]] && repos+=("centos-release-scl-rh")
|
2020-09-01 16:36:02 +00:00
|
|
|
# Disable liburing, see https://github.com/spdk/spdk/issues/1564
|
|
|
|
if [[ $INSTALL_LIBURING == true ]]; then
|
|
|
|
echo "Liburing not supported on ${ID}$VERSION_ID, disabling"
|
|
|
|
INSTALL_LIBURING=false
|
|
|
|
fi
|
2020-08-20 17:00:33 +00:00
|
|
|
fi
|
2020-09-01 13:16:30 +00:00
|
|
|
if [[ $VERSION_ID == 8* ]]; then
|
|
|
|
repos+=("https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm")
|
|
|
|
repos+=("https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm")
|
2022-03-21 12:58:25 +00:00
|
|
|
[[ $ID == centos || $ID == rocky ]] \
|
|
|
|
&& repos+=("https://download.ceph.com/rpm-nautilus/el8/noarch/ceph-release-1-1.el8.noarch.rpm")
|
2020-09-01 13:16:30 +00:00
|
|
|
# Add PowerTools needed for install CUnit-devel in Centos8
|
2022-03-21 12:58:25 +00:00
|
|
|
if [[ $ID == centos || $ID == rocky ]]; then
|
2020-12-08 12:51:20 +00:00
|
|
|
is_repo "PowerTools" && enable+=("PowerTools")
|
|
|
|
is_repo "powertools" && enable+=("powertools")
|
|
|
|
fi
|
2020-09-01 13:16:30 +00:00
|
|
|
fi
|
|
|
|
if ((${#repos[@]} > 0)); then
|
2020-09-23 18:25:28 +00:00
|
|
|
yum install -y "${repos[@]}" yum-utils
|
2020-09-01 13:16:30 +00:00
|
|
|
yum-config-manager --enable "${enable[@]}"
|
|
|
|
fi
|
|
|
|
# Potential dependencies can be needed from other RHEL repos, enable them
|
2020-08-20 17:00:33 +00:00
|
|
|
if [[ $ID == rhel ]]; then
|
2020-09-23 18:32:28 +00:00
|
|
|
[[ $VERSION_ID == 7* ]] && sub repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"
|
|
|
|
[[ $VERSION_ID == 8* ]] && sub repos --enable codeready-builder-for-rhel-8-x86_64-rpms
|
2020-08-20 17:00:33 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2022-11-06 13:57:25 +00:00
|
|
|
yum install -y gcc gcc-c++ make CUnit-devel libaio-devel openssl-devel \
|
|
|
|
libuuid-devel libiscsi-devel ncurses-devel json-c-devel libcmocka-devel \
|
|
|
|
clang clang-devel python3-pip
|
|
|
|
|
2020-05-18 13:15:42 +00:00
|
|
|
# Minimal install
|
2020-08-31 10:03:09 +00:00
|
|
|
# workaround for arm: ninja fails with dep on skbuild python module
|
|
|
|
if [ "$(uname -m)" = "aarch64" ]; then
|
|
|
|
pip3 install scikit-build
|
|
|
|
if echo "$ID $VERSION_ID" | grep -E -q 'centos 7'; then
|
|
|
|
# by default centos 7.x uses cmake 2.8 while ninja requires 3.6 or higher
|
|
|
|
yum install -y cmake3
|
|
|
|
# cmake3 is installed as /usr/bin/cmake3 while ninja directly calls `cmake`. Create a soft link
|
|
|
|
# as a workaround
|
|
|
|
mkdir -p /tmp/bin/
|
|
|
|
ln -s /usr/bin/cmake3 /tmp/bin/cmake > /dev/null 2>&1 || true
|
|
|
|
export PATH=/tmp/bin:$PATH
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2022-05-04 16:36:25 +00:00
|
|
|
# for rhel and centos7 OpenSSL 1.1 should be installed via EPEL
|
|
|
|
if echo "$ID $VERSION_ID" | grep -E -q 'centos 7|rhel 7'; then
|
|
|
|
yum install -y openssl11-devel
|
|
|
|
fi
|
2022-03-21 12:58:25 +00:00
|
|
|
if echo "$ID $VERSION_ID" | grep -E -q 'centos 8|rhel 8|rocky 8'; then
|
2022-02-17 10:11:40 +00:00
|
|
|
yum install -y python36 python36-devel
|
2020-05-18 13:15:42 +00:00
|
|
|
#Create hard link to use in SPDK as python
|
2021-03-08 11:14:37 +00:00
|
|
|
if [[ ! -e /usr/bin/python && -e /etc/alternatives/python3 ]]; then
|
2020-08-20 14:17:00 +00:00
|
|
|
ln -s /etc/alternatives/python3 /usr/bin/python
|
|
|
|
fi
|
2022-11-06 13:37:20 +00:00
|
|
|
# pip3, which is shipped with centos8 and rocky8, is currently providing faulty ninja binary
|
|
|
|
# which segfaults at each run. To workaround it, upgrade pip itself and then use it for each
|
|
|
|
# package - new pip will provide ninja at the same version but with the actually working
|
|
|
|
# binary.
|
|
|
|
pip3 install --upgrade pip
|
|
|
|
pip3() { /usr/local/bin/pip "$@"; }
|
2020-05-18 13:15:42 +00:00
|
|
|
else
|
2022-02-17 10:11:40 +00:00
|
|
|
yum install -y python python3-devel
|
2020-05-18 13:15:42 +00:00
|
|
|
fi
|
2020-08-03 08:45:06 +00:00
|
|
|
pip3 install ninja
|
|
|
|
pip3 install meson
|
2021-01-26 14:45:32 +00:00
|
|
|
pip3 install pyelftools
|
2021-06-10 10:35:05 +00:00
|
|
|
pip3 install ijson
|
2021-09-02 10:09:39 +00:00
|
|
|
pip3 install python-magic
|
2022-06-20 12:35:11 +00:00
|
|
|
if ! [[ $ID == centos && $VERSION_ID == 7 ]]; then
|
|
|
|
# Problem with modules compilation on Centos7
|
|
|
|
pip3 install grpcio
|
|
|
|
pip3 install grpcio-tools
|
|
|
|
fi
|
2022-02-22 13:53:06 +00:00
|
|
|
pip3 install pyyaml
|
2020-05-18 13:15:42 +00:00
|
|
|
|
|
|
|
# Additional dependencies for SPDK CLI - not available in rhel and centos
|
|
|
|
if ! echo "$ID $VERSION_ID" | grep -E -q 'rhel 7|centos 7'; then
|
|
|
|
yum install -y python3-configshell python3-pexpect
|
|
|
|
fi
|
|
|
|
# Additional dependencies for ISA-L used in compression
|
|
|
|
yum install -y autoconf automake libtool help2man
|
|
|
|
# Additional dependencies for DPDK
|
|
|
|
yum install -y numactl-devel nasm
|
usdt: add User Space DTrace support to SPDK
For now, we will keep this disabled by default,
enable with --with-usdt option to the configure
script. Long-term we will want to enable this by
default, and only disable via configure.
Modules can include spdk_internal/usdt.h and add
probes such as:
SPDK_DTRACE_PROBE2(probe_name, ptr, val);
When USDT is enabled, these will translate to
DTRACE_PROBE2(spdk, probe_name, ptr, val). When
USDT is disabled, these will translate to nothing.
Later patches will add some probe points to the
nvmf target, some bpftrace scripts, and instructions
for how to successfully capture data with these
probe points and scripts.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id168e2c800fa5522815a175026386319014cfdaa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7173
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-03-31 22:33:20 +00:00
|
|
|
# Additional dependencies for USDT
|
|
|
|
yum install -y systemtap-sdt-devel
|
2020-05-18 13:15:42 +00:00
|
|
|
if [[ $INSTALL_DEV_TOOLS == "true" ]]; then
|
|
|
|
# Tools for developers
|
2022-09-23 03:38:01 +00:00
|
|
|
devtool_pkgs=(git sg3_utils pciutils libabigail bash-completion ruby-devel)
|
|
|
|
|
2022-03-21 12:58:25 +00:00
|
|
|
if echo "$ID $VERSION_ID" | grep -E -q 'centos 8|rocky 8'; then
|
2022-09-23 03:38:01 +00:00
|
|
|
devtool_pkgs+=(python3-pycodestyle astyle)
|
2022-03-21 12:58:25 +00:00
|
|
|
echo "Centos 8 and Rocky 8 do not have lcov and ShellCheck dependencies"
|
2022-09-23 03:38:01 +00:00
|
|
|
elif [[ $ID == openeuler ]]; then
|
|
|
|
devtool_pkgs+=(python3-pycodestyle)
|
|
|
|
echo "openEuler does not have astyle, lcov and ShellCheck dependencies"
|
2020-05-18 13:15:42 +00:00
|
|
|
else
|
2022-09-23 03:38:01 +00:00
|
|
|
devtool_pkgs+=(python-pycodestyle astyle lcov ShellCheck)
|
2020-05-18 13:15:42 +00:00
|
|
|
fi
|
2022-09-23 03:38:01 +00:00
|
|
|
|
|
|
|
yum install -y "${devtool_pkgs[@]}"
|
2020-05-18 13:15:42 +00:00
|
|
|
fi
|
|
|
|
if [[ $INSTALL_PMEM == "true" ]]; then
|
|
|
|
# Additional dependencies for building pmem based backends
|
2021-08-03 15:47:36 +00:00
|
|
|
yum install -y libpmemobj-devel || true
|
2020-05-18 13:15:42 +00:00
|
|
|
fi
|
|
|
|
if [[ $INSTALL_FUSE == "true" ]]; then
|
|
|
|
# Additional dependencies for FUSE and NVMe-CUSE
|
2021-02-16 18:01:47 +00:00
|
|
|
yum install -y fuse3-devel
|
2022-01-16 17:09:19 +00:00
|
|
|
fi
|
|
|
|
if [[ $INSTALL_RBD == "true" ]]; then
|
|
|
|
# Additional dependencies for RBD bdev in NVMe over Fabrics
|
|
|
|
yum install -y librados-devel librbd-devel
|
2020-05-18 13:15:42 +00:00
|
|
|
fi
|
|
|
|
if [[ $INSTALL_RDMA == "true" ]]; then
|
|
|
|
# Additional dependencies for RDMA transport in NVMe over Fabrics
|
|
|
|
yum install -y libibverbs-devel librdmacm-devel
|
|
|
|
fi
|
|
|
|
if [[ $INSTALL_DOCS == "true" ]]; then
|
|
|
|
# Additional dependencies for building docs
|
|
|
|
yum install -y mscgen || echo "Warning: couldn't install mscgen via yum. Please install mscgen manually."
|
|
|
|
yum install -y doxygen graphviz
|
|
|
|
fi
|
2022-04-27 12:51:05 +00:00
|
|
|
if [[ $INSTALL_DAOS == "true" ]]; then
|
|
|
|
if [[ $ID == centos || $ID == rocky ]]; then
|
|
|
|
if ! hash yum-config-manager &> /dev/null; then
|
|
|
|
yum install -y yum-utils
|
|
|
|
fi
|
2022-07-15 07:14:38 +00:00
|
|
|
[[ $VERSION_ID == 7* ]] && yum-config-manager --add-repo "https://packages.daos.io/v2.0/CentOS7/packages/x86_64/daos_packages.repo"
|
|
|
|
[[ $VERSION_ID == 8* ]] && yum-config-manager --add-repo "https://packages.daos.io/v2.0/EL8/packages/x86_64/daos_packages.repo"
|
2022-04-27 12:51:05 +00:00
|
|
|
yum-config-manager --enable "daos-packages"
|
|
|
|
yum install -y daos-devel
|
|
|
|
else
|
|
|
|
echo "Skipping installation of DAOS bdev dependencies. It is supported only for CentOS 7, CentOS 8 and Rocky 8"
|
|
|
|
fi
|
|
|
|
fi
|
2023-01-11 07:24:19 +00:00
|
|
|
# Additional dependencies for Avahi
|
|
|
|
if [[ $INSTALL_AVAHI == "true" ]]; then
|
|
|
|
# Additional dependencies for Avahi
|
|
|
|
yum install -y avahi-devel
|
|
|
|
fi
|