diff --git a/scripts/setupvars/setupvars.sh b/scripts/setupvars/setupvars.sh index 3cdf4987d73..c9bcc61c643 100755 --- a/scripts/setupvars/setupvars.sh +++ b/scripts/setupvars/setupvars.sh @@ -4,12 +4,12 @@ # SPDX-License-Identifier: Apache-2.0 abs_path () { - path=$(eval echo "$1") - directory=$(dirname "$path") - echo "$(cd "$directory" || exit; pwd -P)/$(basename "$path")"; + script_path=$(eval echo "$1") + directory=$(dirname "$script_path") + echo "$(cd "$directory" || exit; pwd -P)"; } -SCRIPT_DIR="$( cd "$( dirname "$(abs_path "${BASH_SOURCE[0]}")" )" >/dev/null 2>&1 && pwd )" +SCRIPT_DIR="$(abs_path "${BASH_SOURCE[0]}")" >/dev/null 2>&1 INSTALLDIR="${SCRIPT_DIR}" export INTEL_OPENVINO_DIR="$INSTALLDIR" @@ -121,7 +121,12 @@ check_python_version () { "${PYTHON_VERSION_MAJOR}.${MAX_SUPPORTED_PYTHON_VERSION_MINOR} (64-bit) from https://www.python.org/downloads/" return 0 fi - python_bitness=$(python"$python_version" -c 'import sys; print(64 if sys.maxsize > 2**32 else 32)') + 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" @@ -144,7 +149,7 @@ check_python_version () { echo "[setupvars.sh] WARNING: OpenVINO Python environment does not set properly" fi fi -} +} python_version_to_check="$python_version" if [ -z "$python_version" ]; then diff --git a/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake b/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake index 73a4f21f871..05f75ceeb51 100644 --- a/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake +++ b/src/bindings/python/src/compatibility/openvino/cmake/CythonConfig.cmake @@ -36,7 +36,8 @@ if( PYTHONINTERP_FOUND ) file(TO_CMAKE_PATH "$ENV{HOME}" ENV_HOME) find_host_program( CYTHON_EXECUTABLE NAMES cython cython.bat cython3 - HINTS ${_python_path} ${ENV_HOME}/.local/bin $ENV{HOMEBREW_OPT}/cython/bin + HINTS ${_python_path} ${ENV_HOME}/.local/bin $ENV{HOMEBREW_OPT}/cython/bin + ${ENV_HOME}/Library/Python/${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/bin ) else() find_host_program( CYTHON_EXECUTABLE diff --git a/src/bindings/python/src/compatibility/openvino/inference_engine/CMakeLists.txt b/src/bindings/python/src/compatibility/openvino/inference_engine/CMakeLists.txt index 7c503d6070f..cfeb78aa1c3 100644 --- a/src/bindings/python/src/compatibility/openvino/inference_engine/CMakeLists.txt +++ b/src/bindings/python/src/compatibility/openvino/inference_engine/CMakeLists.txt @@ -22,6 +22,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") ie_add_compiler_flags(/wd4267) ie_add_compiler_flags(/wd4244) endif() +if (OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX) + ie_add_compiler_flags(-Wno-undef) +endif() if(UNUSED_BUT_SET_VARIABLE_SUPPORTED) ie_add_compiler_flags(-Wno-unused-but-set-variable) endif()