scripts/pkgdep: Add uring install function

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Idabeee49f9a0b9093136cde214e8528f1abc37e9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2702
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
This commit is contained in:
Maciej Wawryk 2020-05-29 14:37:34 +02:00 committed by Tomasz Zawadzki
parent e7a86c42a4
commit 7303918290
5 changed files with 34 additions and 1 deletions

View File

@ -16,6 +16,7 @@ function usage() {
echo " -f --fuse Additional dependencies for FUSE and NVMe-CUSE"
echo " -r --rdma Additional dependencies for RDMA transport in NVMe over Fabrics"
echo " -b --docs Additional dependencies for building docs"
echo " -u --uring Additional dependencies for io_uring"
echo ""
exit 0
}
@ -28,6 +29,23 @@ function install_all_dependencies() {
INSTALL_DOCS=true
}
function install_liburing() {
local GIT_REPO_LIBURING=https://github.com/axboe/liburing.git
local liburing_dir=/usr/local/src/liburing
if [[ -e /usr/lib/liburing.so ]]; then
echo "liburing is already installed. skipping"
else
if [[ -d $liburing_dir ]]; then
echo "liburing source already present, not cloning"
else
mkdir $liburing_dir
git clone "${GIT_REPO_LIBURING}" "$liburing_dir"
fi
(cd "$liburing_dir" && ./configure && make install)
fi
}
function install_shfmt() {
# Fetch version that has been tested
local shfmt_version=3.1.0
@ -81,8 +99,9 @@ INSTALL_PMEM=false
INSTALL_FUSE=false
INSTALL_RDMA=false
INSTALL_DOCS=false
INSTALL_LIBURING=false
while getopts 'abdfhipr-:' optchar; do
while getopts 'abdfhipru-:' optchar; do
case "$optchar" in
-)
case "$OPTARG" in
@ -93,6 +112,7 @@ while getopts 'abdfhipr-:' optchar; do
fuse) INSTALL_FUSE=true ;;
rdma) INSTALL_RDMA=true ;;
docs) INSTALL_DOCS=true ;;
uring) INSTALL_LIBURING=true ;;
*)
echo "Invalid argument '$OPTARG'"
usage
@ -106,6 +126,7 @@ while getopts 'abdfhipr-:' optchar; do
f) INSTALL_FUSE=true ;;
r) INSTALL_RDMA=true ;;
b) INSTALL_DOCS=true ;;
u) INSTALL_LIBURING=true ;;
*)
echo "Invalid argument '$OPTARG'"
usage

View File

@ -72,3 +72,6 @@ if [[ $INSTALL_DOCS == "true" ]]; then
cd .. && rm -rf mscgen;
popd"
fi
if [[ $INSTALL_LIBURING == "true" ]]; then
install_liburing
fi

View File

@ -53,3 +53,6 @@ if [[ $INSTALL_DOCS == "true" ]]; then
# Additional dependencies for building docs
apt-get install -y doxygen mscgen graphviz
fi
if [[ $INSTALL_LIBURING == "true" ]]; then
install_liburing
fi

View File

@ -68,3 +68,6 @@ if [[ $INSTALL_DOCS == "true" ]]; then
yum install -y mscgen || echo "Warning: couldn't install mscgen via yum. Please install mscgen manually."
yum install -y doxygen graphviz
fi
if [[ $INSTALL_LIBURING == "true" ]]; then
install_liburing
fi

View File

@ -29,3 +29,6 @@ if [[ $INSTALL_DOCS == "true" ]]; then
# Additional dependencies for building docs
zypper install -y doxygen mscgen graphviz
fi
if [[ $INSTALL_LIBURING == "true" ]]; then
install_liburing
fi