From f0a37743e1cdc00964e5577e0bdc4d996512febd Mon Sep 17 00:00:00 2001 From: Alexey Suhov Date: Fri, 16 Oct 2020 21:03:46 +0300 Subject: [PATCH] [install_dependencies.sh] install latest cmake if current version is lower 3.13 (#2695) * [install_dependencies.sh] install latest cmake if current version is lower 3.13 * add shellcheck for Ubuntu * install python 2.7 for Ubuntu --- build-instruction.md | 6 +++--- ...ependencies.sh => install_build_dependencies.sh | 23 ++++++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) rename install_dependencies.sh => install_build_dependencies.sh (89%) diff --git a/build-instruction.md b/build-instruction.md index 801c6f5..9d16305 100644 --- a/build-instruction.md +++ b/build-instruction.md @@ -69,13 +69,13 @@ The software was validated on: cd openvino git submodule update --init --recursive ``` -2. Install build dependencies using the `install_dependencies.sh` script in the +2. Install build dependencies using the `install_build_dependencies.sh` script in the project root folder. ```sh - chmod +x install_dependencies.sh + chmod +x install_build_dependencies.sh ``` ```sh - ./install_dependencies.sh + ./install_build_dependencies.sh ``` 3. By default, the build enables the Inference Engine GPU plugin to infer models on your Intel® Processor Graphics. This requires you to diff --git a/install_dependencies.sh b/install_build_dependencies.sh similarity index 89% rename from install_dependencies.sh rename to install_build_dependencies.sh index 8e9ea32..64b69bf 100755 --- a/install_dependencies.sh +++ b/install_build_dependencies.sh @@ -32,7 +32,6 @@ if [ -f /etc/lsb-release ]; then sudo -E apt update sudo -E apt-get install -y \ build-essential \ - cmake \ curl \ wget \ libssl-dev \ @@ -46,6 +45,8 @@ if [ -f /etc/lsb-release ]; then automake \ libtool \ autoconf \ + shellcheck \ + python \ libcairo2-dev \ libpango1.0-dev \ libglib2.0-dev \ @@ -101,13 +102,6 @@ elif [ -f /etc/redhat-release ]; then sudo -E yum install -y rh-python36 source scl_source enable rh-python36 - wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz - tar xf cmake-3.12.3.tar.gz - cd cmake-3.12.3 - ./configure - make -j16 - sudo -E make install - echo echo "FFmpeg is required for processing audio and video streams with OpenCV. Please select your preferred method for installing FFmpeg:" echo @@ -135,7 +129,6 @@ elif [ -f /etc/os-release ] && grep -q "raspbian" /etc/os-release; then sudo -E apt update sudo -E apt-get install -y \ build-essential \ - cmake \ curl \ wget \ libssl-dev \ @@ -166,4 +159,14 @@ elif [ -f /etc/os-release ] && grep -q "raspbian" /etc/os-release; then fi else echo "Unknown OS, please install build dependencies manually" -fi \ No newline at end of file +fi + +# cmake 3.13 or higher is required to build OpenVINO +current_cmake_version=$(cmake --version | sed -ne 's/[^0-9]*\(\([0-9]\.\)\{0,4\}[0-9][^.]\).*/\1/p') +required_cmake_ver=3.13 +if [ ! "$(printf '%s\n' "$required_cmake_ver" "$current_cmake_version" | sort -V | head -n1)" = "$required_cmake_ver" ]; then + wget "https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4.tar.gz" + tar xf cmake-3.18.4.tar.gz + (cd cmake-3.18.4 && ./bootstrap --parallel="$(nproc --all)" && make --jobs="$(nproc --all)" && sudo make install) + rm -rf cmake-3.18.4 cmake-3.18.4.tar.gz +fi -- 2.7.4