2018-10-01 18:47:23 +00:00
|
|
|
#!/usr/bin/env bash
|
2017-08-21 16:37:37 +00:00
|
|
|
# Please run this script as root.
|
|
|
|
|
2018-09-03 15:32:20 +00:00
|
|
|
set -e
|
2018-11-07 13:56:55 +00:00
|
|
|
|
|
|
|
function usage()
|
|
|
|
{
|
|
|
|
echo ""
|
|
|
|
echo "This script is intended to automate the installation of package dependencies to build SPDK."
|
|
|
|
echo "Please run this script as root user."
|
|
|
|
echo ""
|
|
|
|
echo "$0"
|
|
|
|
echo " -h --help"
|
|
|
|
echo ""
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
INSTALL_CRYPTO=false
|
|
|
|
|
|
|
|
while getopts 'hi-:' optchar; do
|
|
|
|
case "$optchar" in
|
|
|
|
-)
|
|
|
|
case "$OPTARG" in
|
|
|
|
help) usage;;
|
|
|
|
*) echo "Invalid argument '$OPTARG'"
|
|
|
|
usage;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
h) usage;;
|
|
|
|
*) echo "Invalid argument '$OPTARG'"
|
|
|
|
usage;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2018-09-03 15:32:20 +00:00
|
|
|
trap 'set +e; trap - ERR; echo "Error!"; exit 1;' ERR
|
2017-08-21 16:37:37 +00:00
|
|
|
|
2018-08-18 16:25:41 +00:00
|
|
|
scriptsdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $scriptsdir/..)
|
|
|
|
|
2017-08-21 16:37:37 +00:00
|
|
|
if [ -s /etc/redhat-release ]; then
|
2018-09-03 15:38:37 +00:00
|
|
|
. /etc/os-release
|
|
|
|
|
|
|
|
# Includes Fedora, CentOS 7, RHEL 7
|
|
|
|
# Add EPEL repository for CUnit-devel and libunwind-devel
|
|
|
|
if echo "$ID $VERSION_ID" | egrep -q 'rhel 7|centos 7'; then
|
|
|
|
if ! rpm --quiet -q epel-release; then
|
|
|
|
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $ID = 'rhel' ]; then
|
|
|
|
subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms"
|
|
|
|
elif [ $ID = 'centos' ]; then
|
|
|
|
yum --enablerepo=extras install -y epel-release
|
|
|
|
fi
|
2017-08-21 16:37:37 +00:00
|
|
|
fi
|
2018-09-03 15:38:37 +00:00
|
|
|
|
2018-08-14 08:54:30 +00:00
|
|
|
yum install -y gcc gcc-c++ make CUnit-devel libaio-devel openssl-devel \
|
2018-05-17 23:05:24 +00:00
|
|
|
git astyle python-pep8 lcov python clang-analyzer libuuid-devel \
|
2018-08-22 06:52:46 +00:00
|
|
|
sg3_utils libiscsi-devel pciutils
|
2018-07-18 19:08:17 +00:00
|
|
|
# Additional (optional) dependencies for showing backtrace in logs
|
2018-09-03 15:40:51 +00:00
|
|
|
yum install -y libunwind-devel || true
|
2017-08-21 16:37:37 +00:00
|
|
|
# Additional dependencies for NVMe over Fabrics
|
|
|
|
yum install -y libibverbs-devel librdmacm-devel
|
2017-09-15 23:42:42 +00:00
|
|
|
# Additional dependencies for DPDK
|
2018-06-13 20:14:08 +00:00
|
|
|
yum install -y numactl-devel nasm
|
2017-08-21 16:37:37 +00:00
|
|
|
# Additional dependencies for building docs
|
2018-02-13 15:21:00 +00:00
|
|
|
yum install -y doxygen mscgen graphviz
|
2018-04-03 23:07:39 +00:00
|
|
|
# Additional dependencies for building pmem based backends
|
2017-09-29 08:49:51 +00:00
|
|
|
yum install -y libpmemblk-devel || true
|
2018-09-11 13:26:14 +00:00
|
|
|
# Additional dependencies for SPDK CLI - not available in rhel and centos
|
|
|
|
if ! echo "$ID $VERSION_ID" | egrep -q 'rhel 7|centos 7'; then
|
|
|
|
yum install -y python3-configshell python3-pexpect
|
|
|
|
fi
|
2019-01-21 09:05:59 +00:00
|
|
|
# Additional dependencies for ISA-L used in compression
|
|
|
|
yum install -y autoconf automake libtool
|
2017-08-21 16:37:37 +00:00
|
|
|
elif [ -f /etc/debian_version ]; then
|
|
|
|
# Includes Ubuntu, Debian
|
|
|
|
apt-get install -y gcc g++ make libcunit1-dev libaio-dev libssl-dev \
|
2018-08-22 06:52:46 +00:00
|
|
|
git astyle pep8 lcov clang uuid-dev sg3-utils libiscsi-dev pciutils
|
2018-07-18 19:08:17 +00:00
|
|
|
# Additional (optional) dependencies for showing backtrace in logs
|
2018-09-03 15:40:51 +00:00
|
|
|
apt-get install -y libunwind-dev || true
|
2017-08-21 16:37:37 +00:00
|
|
|
# Additional dependencies for NVMe over Fabrics
|
|
|
|
apt-get install -y libibverbs-dev librdmacm-dev
|
2017-09-15 23:42:42 +00:00
|
|
|
# Additional dependencies for DPDK
|
2018-06-13 20:14:08 +00:00
|
|
|
apt-get install -y libnuma-dev nasm
|
2017-08-21 16:37:37 +00:00
|
|
|
# Additional dependencies for building docs
|
2018-02-13 15:21:00 +00:00
|
|
|
apt-get install -y doxygen mscgen graphviz
|
2018-12-05 23:14:32 +00:00
|
|
|
# Additional dependencies for SPDK CLI - not available on older Ubuntus
|
2018-12-11 02:42:45 +00:00
|
|
|
apt-get install -y python3-configshell-fb python3-pexpect || echo \
|
|
|
|
"Note: Some SPDK CLI dependencies could not be installed."
|
2019-01-21 09:05:59 +00:00
|
|
|
# Additional dependencies for ISA-L used in compression
|
|
|
|
apt-get install -y autoconf automake libtool
|
2019-02-28 09:28:09 +00:00
|
|
|
elif [ -f /etc/SuSE-release ] || [ -f /etc/SUSE-brand ]; then
|
2018-04-24 20:23:48 +00:00
|
|
|
zypper install -y gcc gcc-c++ make cunit-devel libaio-devel libopenssl-devel \
|
2018-08-22 06:52:46 +00:00
|
|
|
git-core lcov python-base python-pep8 libuuid-devel sg3_utils pciutils
|
2018-07-18 19:08:17 +00:00
|
|
|
# Additional (optional) dependencies for showing backtrace in logs
|
2018-09-03 15:40:51 +00:00
|
|
|
zypper install libunwind-devel || true
|
2018-04-24 20:23:48 +00:00
|
|
|
# Additional dependencies for NVMe over Fabrics
|
|
|
|
zypper install -y rdma-core-devel
|
|
|
|
# Additional dependencies for DPDK
|
2018-06-13 20:14:08 +00:00
|
|
|
zypper install -y libnuma-devel nasm
|
2018-05-24 20:03:27 +00:00
|
|
|
# Additional dependencies for building pmem based backends
|
2018-04-24 20:23:48 +00:00
|
|
|
zypper install -y libpmemblk-devel
|
|
|
|
# Additional dependencies for building docs
|
|
|
|
zypper install -y doxygen mscgen graphviz
|
2019-01-21 09:05:59 +00:00
|
|
|
# Additional dependencies for ISA-L used in compression
|
|
|
|
zypper install -y autoconf automake libtool
|
2018-09-03 15:31:40 +00:00
|
|
|
elif [ $(uname -s) = "FreeBSD" ] ; then
|
2018-06-21 19:29:12 +00:00
|
|
|
pkg install -y gmake cunit openssl git devel/astyle bash py27-pycodestyle \
|
2018-06-13 20:14:08 +00:00
|
|
|
python misc/e2fsprogs-libuuid sysutils/sg3_utils nasm
|
2017-08-21 16:37:37 +00:00
|
|
|
# Additional dependencies for building docs
|
2018-06-21 19:29:12 +00:00
|
|
|
pkg install -y doxygen mscgen graphviz
|
2019-01-21 09:05:59 +00:00
|
|
|
# Additional dependencies for ISA-L used in compression
|
|
|
|
pkg install -y autoconf automake libtool
|
2017-08-21 16:37:37 +00:00
|
|
|
else
|
|
|
|
echo "pkgdep: unknown system type."
|
|
|
|
exit 1
|
|
|
|
fi
|