Skip to content

Commit

Permalink
better pyopencl installation handling (Xilinx#2362)
Browse files Browse the repository at this point in the history
  • Loading branch information
AShivangi authored and maxzhen committed Nov 1, 2019
1 parent a0febf6 commit feaac01
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/CMake/config/postinst.in
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,23 @@ if [ -z $VERSION ] ; then
pip install --ignore-installed numpy==1.8
fi
pip install pyopencl
elif [ $VERSION -lt 2019 ]; then
# if older version of pyopencl and import fails prompt user to upgarde pyopencl
POCL_INSTALL=$(python -c "import pyopencl")
elif [ $VERSION -lt 2019 ] && [[ $POCL_INSTALL -ne 0 ]] ; then

echo "***********************************************************************"
echo "* Pyopencl ($VERSION) is installed on the system but pyopencl >= 2019.1"
echo "* is required. Please uninstall the current pyopencl by running"
echo "* 'apt remove python-pyopencl' and then reinstall the xrt package"
echo "* 'apt remove python-pyopencl' or 'pip uninstall pyopencl'"
echo "* and then reinstall the xrt package"
echo "***********************************************************************"
exit 0
else
echo "Skipping pyopencl installation..."
exit 0
fi

if python -c "import pyopencl"; then
if [[ $POCL_INSTALL -eq 0 ]]; then
echo "Successfully installed pyopencl"
else
echo "***********************************************************************"
Expand Down

0 comments on commit feaac01

Please sign in to comment.