1#!/usr/bin/env bash 2# SPDX-License-Identifier: BSD-3-Clause 3# Copyright (C) 2020 Intel Corporation 4# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. 5# All rights reserved. 6# Copyright (c) 2022 Dell Inc, or its subsidiaries. 7# 8 9VERSION_ID_NUM=$(sed 's/\.//g' <<< $VERSION_ID) 10# Includes Ubuntu, Debian 11# Minimal install 12apt-get install -y gcc g++ make libcunit1-dev libaio-dev libssl-dev libjson-c-dev libcmocka-dev uuid-dev libiscsi-dev 13if [[ $NAME == "Ubuntu" ]] && [[ $VERSION_ID_NUM -ge 2204 ]]; then 14 # there is no python package in Ubuntu 22.04 15 apt-get install -y python3 16else 17 apt-get install -y python 18fi 19apt-get install -y libncurses5-dev libncursesw5-dev python3-pip python3-dev 20pip3 install ninja 21if ! pip3 install meson; then 22 # After recent updates pip3 on ubuntu1604 provides meson version which requires python >= 3.6. 23 # Unfortunately, the latest available version of python3 there is 3.5.2. In case pip3 fails to 24 # install meson fallback to packaged version of it ubuntu1604's repos may provide. 25 apt-get install -y meson 26fi 27pip3 install pyelftools 28pip3 install ijson 29pip3 install python-magic 30pip3 install grpcio 31pip3 install grpcio-tools 32pip3 install pyyaml 33# Additional dependencies for SPDK CLI - not available on older Ubuntus 34apt-get install -y python3-configshell-fb python3-pexpect || echo \ 35 "Note: Some SPDK CLI dependencies could not be installed." 36 37# Additional dependencies for DPDK 38if [[ $NAME == "Ubuntu" ]] && [[ $VERSION_ID_NUM -lt 1900 ]]; then 39 echo "Ubuntu $VERSION_ID needs NASM version 2.14 for DPDK but is not in the mainline repository." 40 echo "You can install it manually" 41else 42 apt-get install -y nasm 43fi 44apt-get install -y libnuma-dev 45# Additional dependencies for ISA-L used in compression 46apt-get install -y autoconf automake libtool help2man 47# Additional dependencies for USDT 48apt-get install -y systemtap-sdt-dev 49if [[ $INSTALL_DEV_TOOLS == "true" ]]; then 50 # Tools for developers 51 apt-get install -y git astyle pep8 lcov clang sg3-utils pciutils shellcheck \ 52 abigail-tools bash-completion ruby-dev 53 # Additional python style checker not available on ubuntu 16.04 or earlier. 54 apt-get install -y pycodestyle || true 55 # Additional dependencies for nvmf performance test script 56 apt-get install -y python3-paramiko 57fi 58if [[ $INSTALL_PMEM == "true" ]]; then 59 # Additional dependencies for building pmem based backends 60 if [[ $NAME == "Ubuntu" ]] && [[ $VERSION_ID_NUM -gt 1800 ]]; then 61 apt-get install -y libpmem-dev 62 apt-get install -y libpmemblk-dev 63 apt-get install -y libpmemobj-dev 64 fi 65fi 66if [[ $INSTALL_FUSE == "true" ]]; then 67 # Additional dependencies for FUSE and NVMe-CUSE 68 if [[ $NAME == "Ubuntu" ]] && ((VERSION_ID_NUM > 1400 && VERSION_ID_NUM < 1900)); then 69 echo "Ubuntu $VERSION_ID does not have libfuse3-dev in mainline repository." 70 echo "You can install it manually" 71 else 72 apt-get install -y libfuse3-dev 73 fi 74fi 75if [[ $INSTALL_RBD == "true" ]]; then 76 # Additional dependencies for RBD bdev in NVMe over Fabrics 77 apt-get install -y librados-dev librbd-dev 78fi 79if [[ $INSTALL_RDMA == "true" ]]; then 80 # Additional dependencies for RDMA transport in NVMe over Fabrics 81 apt-get install -y libibverbs-dev librdmacm-dev 82fi 83if [[ $INSTALL_DOCS == "true" ]]; then 84 # Additional dependencies for building docs 85 apt-get install -y doxygen mscgen graphviz 86fi 87# Additional dependencies for Avahi 88if [[ $INSTALL_AVAHI == "true" ]]; then 89 # Additional dependencies for Avahi 90 apt-get install -y libavahi-client-dev 91fi 92