From fcc4e604415d4aedc50c5e0ff514dcdf88832d45 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Mon, 5 Dec 2022 21:38:52 +0400 Subject: [PATCH] Amazon linux 2 support (#14412) * Use prebuilt cmake in install-dependencies steps * Removed building of custom python to save Azure CI time * Adjusted conditions in cmake * Download VPU custom kernels compiler only for x86 * Removed -pyver argument * Improvements * Detect glibc version * Usage of new glic variable * Fixed typo * Increased glibc version for MYRIAD case * Made OpenVINO cmake Linux flavors agnostic * Detect glibc version on RedHat * Use clcompiler only since ubuntu 18.04 * Universal way to detect glibc version * Revert some changes * Added support of AmaZon Linux 2 * Amazon Linux 2 support --- install_build_dependencies.sh | 2 +- .../install_openvino_dependencies.sh | 13 +++++++++---- src/cmake/install_tbb.cmake | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/install_build_dependencies.sh b/install_build_dependencies.sh index 8f1aa9a6b56..2b17cae5820 100755 --- a/install_build_dependencies.sh +++ b/install_build_dependencies.sh @@ -109,7 +109,7 @@ if [ -f /etc/lsb-release ] || [ -f /etc/debian_version ] ; then else apt-get install -y nlohmann-json-dev fi -elif [ -f /etc/redhat-release ]; then +elif [ -f /etc/redhat-release ] || grep -q "rhel" /etc/os-release ; then # RHEL 8 / CentOS 7 yum update yum install -y centos-release-scl epel-release diff --git a/scripts/install_dependencies/install_openvino_dependencies.sh b/scripts/install_dependencies/install_openvino_dependencies.sh index 8ce95ccd9d5..64afe1bf5c4 100755 --- a/scripts/install_dependencies/install_openvino_dependencies.sh +++ b/scripts/install_dependencies/install_openvino_dependencies.sh @@ -88,7 +88,7 @@ if [ "$os" == "auto" ] ; then fi case $os in centos7|centos8|rhel8|rhel9.1|\ - almalinux8.7|\ + almalinux8.7|amzn2|\ fedora34|fedora35|fedora36|fedora37|fedora38|\ raspbian9|debian9|ubuntu18.04|\ raspbian10|debian10|ubuntu20.04|ubuntu20.10|ubuntu21.04|\ @@ -182,9 +182,14 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || [ "$os" == "rhel8" ] || [ "$os" == "rhel9.1" ] || [ "$os" == "fedora34" ] || [ "$os" == "fedora35" ] || [ "$os" == "fedora36" ] || [ "$os" == "fedora36" ] || [ "$os" == "fedora38" ] || - [ "$os" == "almalinux8.7" ] ; then + [ "$os" == "almalinux8.7" ] || [ "$os" == "amzn2" ] ; then arch=$(uname -m) + + if [ "$os" == "amzn2" ] ; then + amazon-linux-extras install epel python3.8 + fi + pkgs_dev=(gcc gcc-c++ make glibc libstdc++ libgcc cmake3 json-devel.$arch zlib-devel.$arch sudo) if [ "$os" == "rhel9.1" ] ; then @@ -203,7 +208,7 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || pkgs_myriad=(libusbx.$arch) fi - if [ "$os" == "centos7" ] ; then + if [ "$os" == "centos7" ] || [ "$os" == "amzn2" ] ; then pkgs_core=(tbb.$arch pugixml.$arch gflags.$arch) pkgs_dev+=(gflags-devel.$arch) pkgs_opencv_opt=( @@ -323,7 +328,7 @@ elif [ "$os" == "centos7" ] || [ "$os" == "centos8" ] || [ "$os" == "rhel8" ] || [ "$os" == "rhel9.1" ] || [ "$os" == "fedora34" ] || [ "$os" == "fedora35" ] || [ "$os" == "fedora36" ] || [ "$os" == "fedora36" ] || [ "$os" == "fedora38" ] || - [ "$os" == "almalinux8.7" ] ; then + [ "$os" == "almalinux8.7" ] || [ "$os" == "amzn2" ] ; then [ -z "$interactive" ] && iopt="--assumeyes" [ -n "$dry" ] && iopt="--downloadonly" diff --git a/src/cmake/install_tbb.cmake b/src/cmake/install_tbb.cmake index 1f296291766..e5904fcd801 100644 --- a/src/cmake/install_tbb.cmake +++ b/src/cmake/install_tbb.cmake @@ -92,7 +92,7 @@ if(THREADING MATCHES "^(TBB|TBB_AUTO)$" AND set(tbb_custom ON) endif() - if(OV_GLIBC_VERSION VERSION_LESS_EQUAL 2.24) + if(OV_GLIBC_VERSION VERSION_LESS_EQUAL 2.26) set(_ov_system_tbb_is_obsolete ON) endif()