From ca2f81df5b9e57619de8fd80c6abf9ef19ff1d90 Mon Sep 17 00:00:00 2001
From: Yaman Umuroglu <maltanar@gmail.com>
Date: Mon, 21 Sep 2020 23:25:26 +0200
Subject: [PATCH] [Docker] bring back xrtdeps for CI, warn user in dev
 container

installing xrtdeps fails on a lot of machines, unfortunately
---
 docker/Dockerfile.finn_ci |  6 ++++++
 docker/finn_entrypoint.sh | 26 ++++++++++++--------------
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/docker/Dockerfile.finn_ci b/docker/Dockerfile.finn_ci
index fac168d55..4518fe564 100644
--- a/docker/Dockerfile.finn_ci
+++ b/docker/Dockerfile.finn_ci
@@ -40,6 +40,12 @@ RUN apt-get install -y verilator zsh
 RUN apt-get -y install sshpass wget unzip
 RUN echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
 
+# XRT deps
+RUN wget https://raw.githubusercontent.com/Xilinx/XRT/master/src/runtime_src/tools/scripts/xrtdeps.sh
+RUN apt-get update
+RUN bash xrtdeps.sh
+RUN rm xrtdeps.sh
+
 # cloning dependency repos
 # Brevitas
 RUN git clone https://github.com/Xilinx/brevitas.git /workspace/brevitas
diff --git a/docker/finn_entrypoint.sh b/docker/finn_entrypoint.sh
index b750d3007..4569e5be7 100644
--- a/docker/finn_entrypoint.sh
+++ b/docker/finn_entrypoint.sh
@@ -46,20 +46,6 @@ if [ ! -z "$VIVADO_PATH" ];then
   export XILINX_VIVADO=$VIVADO_PATH
   source $VIVADO_PATH/settings64.sh
 fi
-if [ ! -z "$VITIS_PATH" ];then
-  # source Vitis env.vars
-  export XILINX_VITIS=$VITIS_PATH
-  source $VITIS_PATH/settings64.sh
-fi
-if [ ! -z "$XILINX_XRT" ];then
-  # TODO install XRT dependencies?
-  # wget https://raw.githubusercontent.com/Xilinx/XRT/master/src/runtime_src/tools/scripts/xrtdeps.sh
-  # apt-get update
-  # bash xrtdeps.sh
-  # rm xrtdeps.sh
-  # source XRT
-  source $XILINX_XRT/setup.sh
-fi
 
 # download PYNQ board files if not already there
 if [ ! -d "/workspace/finn/board_files" ]; then
@@ -80,4 +66,16 @@ if [ ! -d "/workspace/finn/board_files/ultra96v1" ]; then
     mv /workspace/finn/bdf/* /workspace/finn/board_files/
     rm -rf /workspace/finn/bdf
 fi
+if [ ! -z "$VITIS_PATH" ];then
+  # source Vitis env.vars
+  export XILINX_VITIS=$VITIS_PATH
+  source $VITIS_PATH/settings64.sh
+  if [ ! -z "$XILINX_XRT" ];then
+    gecho "For VitisBuild, please ensure the XRT dependencies are correctly installed"
+    gecho "by downloading and running:"
+    gecho "https://raw.githubusercontent.com/Xilinx/XRT/master/src/runtime_src/tools/scripts/xrtdeps.sh"
+    # source XRT
+    source $XILINX_XRT/setup.sh
+  fi
+fi
 exec "$@"
-- 
GitLab