Skip to content

Commit

Permalink
backport CR-1066596 Can't build XRT on an Amazon Linux 2 (#3655) to 2…
Browse files Browse the repository at this point in the history
…020.1 (#3690)
  • Loading branch information
xuhz committed Jul 29, 2020
1 parent 9211651 commit d09c4a4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CORE=`grep -c ^processor /proc/cpuinfo`
CMAKE=cmake
CPU=`uname -m`

if [[ $OSDIST == "centos" ]] || [[ $OSDIST == "amazon" ]] || [[ $OSDIST == "rhel" ]]; then
if [[ $OSDIST == "centos" ]] || [[ $OSDIST == "amzn" ]] || [[ $OSDIST == "rhel" ]]; then
CMAKE=cmake3
if [[ ! -x "$(command -v $CMAKE)" ]]; then
echo "$CMAKE is not installed, please run xrtdeps.sh"
Expand Down
27 changes: 24 additions & 3 deletions src/runtime_src/tools/scripts/xrtdeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ rh_package_list()
pkgconfig \
protobuf-devel \
protobuf-compiler \
redhat-lsb \
rpm-build \
strace \
unzip \
Expand All @@ -93,6 +92,16 @@ rh_package_list()
python3-pip \
)

if [ $FLAVOR == "amzn" ]; then
RH_LIST+=(\
system-lsb-core \
)
else
RH_LIST+=(\
redhat-lsb \
)
fi

# Centos8
if [ $MAJOR == 8 ]; then

Expand Down Expand Up @@ -198,7 +207,7 @@ update_package_list()
{
if [ $FLAVOR == "ubuntu" ] || [ $FLAVOR == "debian" ]; then
ub_package_list
elif [ $FLAVOR == "centos" ] || [ $FLAVOR == "rhel" ]; then
elif [ $FLAVOR == "centos" ] || [ $FLAVOR == "rhel" ] || [ $FLAVOR == "amzn" ]; then
rh_package_list
else
echo "unknown OS flavor $FLAVOR"
Expand Down Expand Up @@ -318,6 +327,16 @@ prep_rhel()
yum install -y cmake3
}

prep_amzn()
{
echo "Installing amazon EPEL..."
amazon-linux-extras install epel
echo "Installing cmake3 from EPEL repository..."
yum install cmake3
echo "Installing opencl header from EPEL repository..."
yum install ocl-icd ocl-icd-devel opencl-headers
}

install()
{
if [ $FLAVOR == "ubuntu" ] || [ $FLAVOR == "debian" ]; then
Expand All @@ -332,14 +351,16 @@ install()
prep_centos
elif [ $FLAVOR == "rhel" ]; then
prep_rhel
elif [ $FLAVOR == "amzn" ]; then
prep_amzn
fi

if [ $FLAVOR == "rhel" ] || [ $FLAVOR == "centos" ] || [ $FLAVOR == "amzn" ]; then
echo "Installing RHEL/CentOS packages..."
yum install -y "${RH_LIST[@]}"
if [ $ARCH == "ppc64le" ]; then
yum install -y devtoolset-7
elif [ $MAJOR -lt "8" ]; then
elif [ $MAJOR -lt "8" ] && [ $FLAVOR != "amzn" ]; then
yum install -y devtoolset-6
fi
fi
Expand Down

0 comments on commit d09c4a4

Please sign in to comment.