script: add pkgdep.sh to install dependencies automatically.

Change-Id: I7447a28fa8ecd8395a85b66952d19aa25683876c
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/374946
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Hailiang Wang 2017-08-22 00:37:37 +08:00 committed by Daniel Verkamp
parent a7b62cc4cb
commit 93533c2002
4 changed files with 46 additions and 45 deletions

View File

@ -54,6 +54,8 @@ lib: $(DPDKBUILD)
app: lib app: lib
test: lib test: lib
examples: lib examples: lib
pkgdep:
sh ./scripts/pkgdep.sh
$(DIRS-y): mk/cc.mk config.h $(DIRS-y): mk/cc.mk config.h

View File

@ -36,43 +36,6 @@ The development kit currently includes:
well as a [Porting Guide](http://www.spdk.io/doc/porting.html) for porting SPDK to different frameworks well as a [Porting Guide](http://www.spdk.io/doc/porting.html) for porting SPDK to different frameworks
and operating systems. and operating systems.
<a id="prerequisites"></a>
## Prerequisites
Note: The requirements for building the docs can take a while to
install so you may want to skip them unless you need them.
Fedora/CentOS:
~~~{.sh}
sudo dnf install -y gcc gcc-c++ make CUnit-devel libaio-devel openssl-devel \
git astyle-devel python-pep8 lcov python clang-analyzer
# Additional dependencies for RDMA (NVMe over Fabrics)
sudo dnf install -y libibverbs-devel librdmacm-devel
# Additional dependencies for building docs
sudo dnf install -y doxygen mscgen
~~~
Ubuntu/Debian:
~~~{.sh}
sudo apt-get install -y gcc g++ make libcunit1-dev libaio-dev libssl-dev \
git astyle pep8 lcov clang
# Additional dependencies for RDMA (NVMe over Fabrics)
sudo apt-get install -y libibverbs-dev librdmacm-dev
# Additional dependencies for building docs
sudo apt-get install -y doxygen mscgen
~~~
FreeBSD:
~~~{.sh}
sudo pkg install gmake cunit openssl git devel/astyle bash devel/pep8 \
python
# Additional dependencies for building docs
sudo pkg install doxygen mscgen
~~~
<a id="source"></a> <a id="source"></a>
## Source Code ## Source Code
@ -82,6 +45,15 @@ cd spdk
git submodule update --init git submodule update --init
~~~ ~~~
<a id="prerequisites"></a>
## Prerequisites
The dependencies can be installed automatically by `scripts/pkgdep.sh`.
~~~{.sh}
./scripts/pkgdep.sh
~~~
<a id="libraries"></a> <a id="libraries"></a>
## Build ## Build

34
scripts/pkgdep.sh Executable file
View File

@ -0,0 +1,34 @@
#!/bin/sh
# Please run this script as root.
SYSTEM=`uname -s`
if [ -s /etc/redhat-release ]; then
# Includes Fedora, CentOS
if [ -f /etc/centos-release ]; then
# Add EPEL repository for CUnit-devel
yum --enablerepo=extras install -y epel-release
fi
yum install -y gcc gcc-c++ make CUnit-devel libaio-devel openssl-devel \
git astyle-devel python-pep8 lcov python clang-analyzer
# Additional dependencies for NVMe over Fabrics
yum install -y libibverbs-devel librdmacm-devel
# Additional dependencies for building docs
yum install -y doxygen mscgen
elif [ -f /etc/debian_version ]; then
# Includes Ubuntu, Debian
apt-get install -y gcc g++ make libcunit1-dev libaio-dev libssl-dev \
git astyle pep8 lcov clang
# Additional dependencies for NVMe over Fabrics
apt-get install -y libibverbs-dev librdmacm-dev
# Additional dependencies for building docs
apt-get install -y doxygen mscgen
elif [ $SYSTEM = "FreeBSD" ] ; then
pkg install gmake cunit openssl git devel/astyle bash devel/pep8 \
python
# Additional dependencies for building docs
pkg install doxygen mscgen
else
echo "pkgdep: unknown system type."
exit 1
fi

9
scripts/vagrant/build.sh Normal file → Executable file
View File

@ -32,15 +32,8 @@ echo DISTRIB_RELEASE: $DISTRIB_RELEASE
echo DISTRIB_CODENAME: $DISTRIB_CODENAME echo DISTRIB_CODENAME: $DISTRIB_CODENAME
echo DISTRIB_DESCRIPTION: $DISTRIB_DESCRIPTION echo DISTRIB_DESCRIPTION: $DISTRIB_DESCRIPTION
if [ -f /etc/lsb-release ]; then
apt-get install -y gcc g++ make libcunit1-dev libaio-dev libssl-dev
elif [ -f /etc/redhat-release ]; then
# Add EPEL repository for CUnit-devel
yum --enablerepo=extras install -y epel-release
yum install -y gcc gcc-c++ CUnit-devel libaio-devel openssl-devel
fi
cd $SPDK_DIR cd $SPDK_DIR
$SUDOCMD ./scripts/pkgdep.sh
$SUDOCMD ./configure --enable-debug $SUDOCMD ./configure --enable-debug
$SUDOCMD make clean $SUDOCMD make clean
$SUDOCMD make -j2 $SUDOCMD make -j2