Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CMake/cpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (${LINUX_FLAVOR} STREQUAL Ubuntu)
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_BINARY_DIR}/postinst;${CMAKE_CURRENT_BINARY_DIR}/prerm")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "ocl-icd-opencl-dev (>= 2.2.0), libboost-dev (>=1.58), libboost-filesystem-dev (>=1.58), uuid-dev (>= 2.27.1), dkms (>= 2.2.0), libprotoc-dev (>=2.6.1), protobuf-compiler (>=2.6.1), libncurses5-dev (>=6.0)")
elseif ((${LINUX_FLAVOR} STREQUAL Redhat) OR (${LINUX_FLAVOR} STREQUAL CentOS))
elseif (${LINUX_FLAVOR} MATCHES "^(RedHat|CentOS)")
SET(CPACK_GENERATOR "RPM;TGZ")
SET(PACKAGE_KIND "RPM")
SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/postinst")
Expand Down
125 changes: 87 additions & 38 deletions src/runtime_src/tools/scripts/xrtdeps.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
#!/bin/bash

set -e

usage()
{
echo "Usage: xrtdeps.sh [options]"
echo
echo "[-help] List this help"
echo "[-validate] Validate that required packages are installed"

exit 1
}

validate=0

while [ $# -gt 0 ]; do
case "$1" in
-help)
usage
;;
-validate)
validate=1
shift
;;
*)
echo "unknown option"
usage
;;
esac
done

# Script to install XRT dependencies
# Note all packages listed here are required for XRT. Some of them like jpeg, png, tiff, etc are used by applications
RH_LIST=(\
Expand All @@ -9,6 +38,8 @@ RH_LIST=(\
boost-static \
cmake \
compat-libtiff3 \
cppcheck \
curl \
dkms \
dmidecode \
gcc \
Expand All @@ -28,28 +59,28 @@ RH_LIST=(\
libuuid-devel \
lm_sensors \
make \
ncurses-devel \
ocl-icd \
ocl-icd-devel \
opencl-headers \
opencv \
pciutils \
perl \
pkgconfig \
protobuf-devel \
protobuf-compiler \
protobuf-static \
python \
redhat-lsb \
rpm-build \
strace \
unzip \
curl \
protobuf-devel \
protobuf-compiler \
protobuf-static \
ncurses-devel \
cppcheck \
)

UB_LIST=(\
cmake \
cppcheck \
curl \
dkms \
dmidecode \
g++ \
Expand All @@ -61,8 +92,10 @@ UB_LIST=(\
libboost-filesystem-dev \
libdrm-dev \
libjpeg-dev \
libncurses5-dev \
libopencv-core-dev \
libpng-dev \
libprotoc-dev \
libtiff5-dev \
linux-headers-$(uname -r) \
linux-libc-dev \
Expand All @@ -76,51 +109,67 @@ UB_LIST=(\
python \
pciutils \
pkg-config \
protobuf-compiler \
python3-sphinx \
python3-sphinx-rtd-theme \
sphinx-common \
strace \
unzip \
uuid-dev \
curl \
libprotoc-dev \
protobuf-compiler \
libncurses5-dev \
cppcheck \
)

FLAVOR=`grep '^ID=' /etc/os-release | awk -F= '{print $2}'`
FLAVOR=`echo $FLAVOR | tr -d '"'`

if [ $FLAVOR == "ubuntu" ]; then
echo "Installing Ubuntu packages..."
sudo apt install -y "${UB_LIST[@]}"
fi
validate()
{
if [ $FLAVOR == "ubuntu" ]; then
apt -qq list "${UB_LIST[@]}"
fi

# Enable EPEL on CentOS/RHEL
if [ $FLAVOR == "centos" ]; then
echo "Enabling EPEL repository..."
sudo yum install epel-release
elif [ $FLAVOR == "rhel" ]; then
echo "Enabling EPEL repository..."
rpm -q --quiet epel-release
if [ $? != 0 ]; then
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum check-update
if [ $FLAVOR == "centos" ] || [ $FLAVOR == "rhel" ] ; then
rpm -q "${RH_LIST[@]}"
fi
fi
}

# Enable GCC 6 compiler set on RHEL/CentOS 7.X
if [ $FLAVOR == "rhel" ]; then
echo "Enabling RHEL SCL repository..."
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
elif [ $FLAVOR == "centos" ]; then
echo "Enabling CentOS SCL repository..."
sudo yum install centos-release-scl
fi
install()
{
if [ $FLAVOR == "ubuntu" ]; then
echo "Installing Ubuntu packages..."
sudo apt install -y "${UB_LIST[@]}"
fi

# Enable EPEL on CentOS/RHEL
if [ $FLAVOR == "centos" ]; then
echo "Enabling EPEL repository..."
sudo yum install epel-release
elif [ $FLAVOR == "rhel" ]; then
echo "Enabling EPEL repository..."
rpm -q --quiet epel-release
if [ $? != 0 ]; then
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum check-update
fi
fi

# Enable GCC 6 compiler set on RHEL/CentOS 7.X
if [ $FLAVOR == "rhel" ]; then
echo "Enabling RHEL SCL repository..."
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
elif [ $FLAVOR == "centos" ]; then
echo "Enabling CentOS SCL repository..."
sudo yum install centos-release-scl
fi

if [ $FLAVOR == "rhel" ] || [ $FLAVOR == "centos" ]; then
echo "Installing RHEL/CentOS packages..."
sudo yum install -y "${RH_LIST[@]}"
sudo yum install devtoolset-6
fi
}

if [ $FLAVOR == "rhel" ] || [ $FLAVOR == "centos" ]; then
echo "Installing RHEL/CentOS packages..."
sudo yum install -y "${RH_LIST[@]}"
sudo yum install devtoolset-6
if [ $validate == 1 ]; then
validate
else
install
fi