Files
openvino/scripts/setupvars/setupvars.sh
Przemyslaw Wysocki d72d833a96 [PyOV] Enable Python 3.11 (#15144)
* Bump ONNX version

* Bump protobuf

* Add xfails and skips

* Add tickets

* Skip ONNX Serialization tests

* Compile ONNX with C++17

* Force cpp17 - 2

* Use MSVC check

* Relax python reqs, enable 311 in azure

* Fix setupvars error

* Ignore watchdog error

* Update tensorflow

* Minor change

* Bump onnx to 1.13.1

* Bump protobuf to 3.20.3

* Debug test tf

* Xfail tests in comp

* Update comp tests

* Update tf reqs

* Remove deprecated ONNX function

* Align PDPD FE protobuf req with 2.4.1

* Satisfy dependency review

* Attempt to fix dependency review

* Revert pdpd protobuf

* Skip pdpd tests

* Fix MO-TF-PB test

* Skip TF test case

* Enable py311 on rest of jobs

* Try disabling pdpd req

* Exclude pdpd form cmake

* Update .ci/azure/linux.yml

Fixed unmerged merge-conflict

* CR

* Fix reqs

* Skip pdpd tests

* Disable pdpd tests building in cmake

* Skip another pdpd cmake

* Add file

* Add paddle constraint to tests

* Disable paddle reqs

* Debug prints

* Skip TF test if Python ver is 3.11

* Apply Mish cr comments

* Debug

* Debug

* Constrain tensorflow_addons

* Fix pdpd skipping

* Add debug prints

* Update skips

* Remove prints

* Minor change

* Update OMZ commit

* Fix some tests

* Minor change

* Disable pdpd at all

* Disable pdpd at all

---------

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
2023-04-17 13:30:17 +04:00

168 lines
6.7 KiB
Bash
Executable File

#!/bin/bash
# Copyright (C) 2018-2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
abs_path () {
script_path=$(eval echo "$1")
directory=$(dirname "$script_path")
echo "$(cd "$directory" || exit; pwd -P)";
}
SCRIPT_DIR="$(abs_path "${BASH_SOURCE[0]}")" >/dev/null 2>&1
INSTALLDIR="${SCRIPT_DIR}"
export INTEL_OPENVINO_DIR="$INSTALLDIR"
# parse command line options
while [ $# -gt 0 ]
do
key="$1"
case $key in
-pyver)
python_version=$2
echo python_version = "${python_version}"
shift
;;
*)
# unknown option
;;
esac
shift
done
if [ -e "$INSTALLDIR/runtime" ]; then
export InferenceEngine_DIR=$INSTALLDIR/runtime/cmake
export ngraph_DIR=$INSTALLDIR/runtime/cmake
export OpenVINO_DIR=$INSTALLDIR/runtime/cmake
system_type=$(ls "$INSTALLDIR/runtime/lib/")
OV_PLUGINS_PATH=$INSTALLDIR/runtime/lib/$system_type
if [[ "$OSTYPE" == "darwin"* ]]; then
export DYLD_LIBRARY_PATH=${OV_PLUGINS_PATH}/Release:${OV_PLUGINS_PATH}/Debug${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}
export LD_LIBRARY_PATH=${OV_PLUGINS_PATH}/Release:${OV_PLUGINS_PATH}/Debug${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export PKG_CONFIG_PATH=${OV_PLUGINS_PATH}/Release/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
else
export LD_LIBRARY_PATH=${OV_PLUGINS_PATH}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export PKG_CONFIG_PATH=$OV_PLUGINS_PATH/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
fi
if [ -e "$INSTALLDIR/runtime/3rdparty/tbb" ]; then
tbb_lib_path=$INSTALLDIR/runtime/3rdparty/tbb/lib
if [ -d "$tbb_lib_path/$system_type" ]; then
lib_path=$(find "$tbb_lib_path/$system_type" -name "libtbb*" | sort -r | head -n1)
if [ -n "$lib_path" ]; then
tbb_lib_path=$(dirname "$lib_path")
fi
fi
if ls "$tbb_lib_path"/libtbb* >/dev/null 2>&1; then
if [[ "$OSTYPE" == "darwin"* ]]; then
export DYLD_LIBRARY_PATH=$tbb_lib_path:${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}
fi
export LD_LIBRARY_PATH=$tbb_lib_path:${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH}
else
echo "[setupvars.sh] WARNING: Directory with TBB libraries is not detected. Please, add TBB libraries to LD_LIBRARY_PATH / DYLD_LIBRARY_PATH manually"
fi
if [ -e "$INSTALLDIR/runtime/3rdparty/tbb/lib/cmake/TBB" ]; then
export TBB_DIR=$INSTALLDIR/runtime/3rdparty/tbb/lib/cmake/TBB
elif [ -e "$INSTALLDIR/runtime/3rdparty/tbb/lib/cmake/tbb" ]; then
export TBB_DIR=$INSTALLDIR/runtime/3rdparty/tbb/lib/cmake/tbb
elif [ -e "$INSTALLDIR/runtime/3rdparty/tbb/lib64/cmake/TBB" ]; then
export TBB_DIR=$INSTALLDIR/runtime/3rdparty/tbb/lib64/cmake/TBB
elif [ -e "$INSTALLDIR/runtime/3rdparty/tbb/cmake" ]; then
export TBB_DIR=$INSTALLDIR/runtime/3rdparty/tbb/cmake
else
echo "[setupvars.sh] WARNING: TBB_DIR directory is not defined automatically by setupvars.sh. Please, set it manually to point to TBBConfig.cmake"
fi
fi
fi
if [ -e "$INSTALLDIR/tools/compile_tool" ]; then
export LD_LIBRARY_PATH=$INSTALLDIR/tools/compile_tool${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
fi
# OpenCV environment
if [ -f "$INSTALLDIR/opencv/setupvars.sh" ]; then
# shellcheck source=/dev/null
source "$INSTALLDIR/opencv/setupvars.sh"
fi
if [ -f "$INSTALLDIR/extras/opencv/setupvars.sh" ]; then
# shellcheck source=/dev/null
source "$INSTALLDIR/extras/opencv/setupvars.sh"
fi
OS_NAME=""
if command -v lsb_release >/dev/null 2>&1; then
OS_NAME=$(lsb_release -i -s)
fi
PYTHON_VERSION_MAJOR="3"
MIN_REQUIRED_PYTHON_VERSION_MINOR="7"
MAX_SUPPORTED_PYTHON_VERSION_MINOR="11"
check_python_version () {
if [ -z "$python_version" ]; then
python_version_major=$( python3 -c 'import sys; print(str(sys.version_info[0]))' )
python_version_minor=$( python3 -c 'import sys; print(str(sys.version_info[1]))' )
python_version="$python_version_major.$python_version_minor"
else
python_version_major=$( python3 -c "import sys; print(str(\"${python_version}\".split('.')[0]))" )
python_version_minor=$( python3 -c "import sys; print(str(\"${python_version}\".split('.')[1]))" )
fi
if [ "$PYTHON_VERSION_MAJOR" != "$python_version_major" ] ||
[ "$python_version_minor" -lt "$MIN_REQUIRED_PYTHON_VERSION_MINOR" ] ||
[ "$python_version_minor" -gt "$MAX_SUPPORTED_PYTHON_VERSION_MINOR" ] ; then
echo "[setupvars.sh] WARNING: Unsupported Python version. Please install one of Python" \
"${PYTHON_VERSION_MAJOR}.${MIN_REQUIRED_PYTHON_VERSION_MINOR} -" \
"${PYTHON_VERSION_MAJOR}.${MAX_SUPPORTED_PYTHON_VERSION_MINOR} (64-bit) from https://www.python.org/downloads/"
return 0
fi
if command -v python"$python_version" > /dev/null 2>&1; then
python_interp=python"$python_version"
else
python_interp=python"$python_version_major"
fi
python_bitness=$("$python_interp" -c 'import sys; print(64 if sys.maxsize > 2**32 else 32)')
if [ "$python_bitness" != "" ] && [ "$python_bitness" != "64" ] && [ "$OS_NAME" != "Raspbian" ]; then
echo "[setupvars.sh] WARNING: 64 bitness for Python $python_version is required"
fi
if [ -n "$python_version" ]; then
if [[ -d $INTEL_OPENVINO_DIR/python ]]; then
# add path to OpenCV API for Python 3.x
export PYTHONPATH="$INTEL_OPENVINO_DIR/python/python3:$PYTHONPATH"
pydir=$INTEL_OPENVINO_DIR/python/python$python_version
if [[ -d $pydir ]]; then
# add path to Inference Engine Python API
export PYTHONPATH="${pydir}:${PYTHONPATH}"
else
echo "[setupvars.sh] WARNING: Can not find OpenVINO Python module for python${python_version} by path ${pydir}"
echo "[setupvars.sh] WARNING: OpenVINO Python environment does not set properly"
fi
else
echo "[setupvars.sh] WARNING: Can not find OpenVINO Python binaries by path ${INTEL_OPENVINO_DIR}/python"
echo "[setupvars.sh] WARNING: OpenVINO Python environment does not set properly"
fi
fi
}
python_version_to_check="$python_version"
if [ -z "$python_version" ]; then
python_version_to_check="3"
fi
if ! command -v python"$python_version_to_check" > /dev/null 2>&1; then
echo "[setupvars.sh] WARNING: Python is not installed. Please install one of Python" \
"${PYTHON_VERSION_MAJOR}.${MIN_REQUIRED_PYTHON_VERSION_MINOR} -" \
"${PYTHON_VERSION_MAJOR}.${MAX_SUPPORTED_PYTHON_VERSION_MINOR} (64-bit) from https://www.python.org/downloads/"
else
check_python_version
fi
echo "[setupvars.sh] OpenVINO environment initialized"