diff --git a/scripts/pkgdep.sh b/scripts/pkgdep.sh index 4b1ca7477..ccd47ec26 100755 --- a/scripts/pkgdep.sh +++ b/scripts/pkgdep.sh @@ -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 diff --git a/scripts/pkgdep/arch.sh b/scripts/pkgdep/arch.sh index 32944b925..316fcf6ea 100755 --- a/scripts/pkgdep/arch.sh +++ b/scripts/pkgdep/arch.sh @@ -72,3 +72,6 @@ if [[ $INSTALL_DOCS == "true" ]]; then cd .. && rm -rf mscgen; popd" fi +if [[ $INSTALL_LIBURING == "true" ]]; then + install_liburing +fi diff --git a/scripts/pkgdep/debian.sh b/scripts/pkgdep/debian.sh index 155f6e5cd..2513a0160 100755 --- a/scripts/pkgdep/debian.sh +++ b/scripts/pkgdep/debian.sh @@ -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 diff --git a/scripts/pkgdep/rhel.sh b/scripts/pkgdep/rhel.sh index d751cedf3..af5d4c0b3 100755 --- a/scripts/pkgdep/rhel.sh +++ b/scripts/pkgdep/rhel.sh @@ -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 diff --git a/scripts/pkgdep/sles.sh b/scripts/pkgdep/sles.sh index c5d14b67e..dacf6d1b5 100755 --- a/scripts/pkgdep/sles.sh +++ b/scripts/pkgdep/sles.sh @@ -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