Commit 73039182 authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Tomasz Zawadzki
Browse files

scripts/pkgdep: Add uring install function



Signed-off-by: default avatarMaciej 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: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarZiye Yang <ziye.yang@intel.com>
parent e7a86c42
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -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
+3 −0
Original line number Diff line number Diff line
@@ -72,3 +72,6 @@ if [[ $INSTALL_DOCS == "true" ]]; then
		cd .. && rm -rf mscgen;
		popd"
fi
if [[ $INSTALL_LIBURING == "true" ]]; then
	install_liburing
fi
+3 −0
Original line number Diff line number Diff line
@@ -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
+3 −0
Original line number Diff line number Diff line
@@ -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
+3 −0
Original line number Diff line number Diff line
@@ -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