3 # Copyright (c) 2018 Intel Corporation
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
20 echo "Error on or near line $1: $2; exiting with status ${code}"
22 echo "Error on or near line $1; exiting with status ${code}"
26 trap 'error ${LINENO}' ERR
28 SAMPLES_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
30 if [[ -z "${InferenceEngine_DIR}" ]]; then
31 printf "\nInferenceEngine_DIR environment variable is not set. Trying to find setupvars.sh to set it. \n"
33 setvars_path=$SAMPLES_PATH/../..
34 if [ -e "$setvars_path/inference_engine/bin/setvars.sh" ]; then # for Intel Deep Learning Deployment Toolkit package
35 setvars_path="$setvars_path/inference_engine/bin/setvars.sh"
36 elif [ -e "$setvars_path/../bin/setupvars.sh" ]; then # for OpenVINO package
37 setvars_path="$setvars_path/../bin/setupvars.sh"
38 elif [ -e "$setvars_path/../setupvars.sh" ]; then
39 setvars_path="$setvars_path/../setupvars.sh"
41 printf "Error: setupvars.sh is not found in hardcoded paths. \n\n"
44 if ! source $setvars_path ; then
45 printf "Unable to run ./setupvars.sh. Please check its presence. \n\n"
50 if ! command -v cmake &>/dev/null; then
51 printf "\n\nCMAKE is not installed. It is required to build Inference Engine samples. Please install it. \n\n"
55 build_dir=$HOME/inference_engine_samples_build
58 cmake -DCMAKE_BUILD_TYPE=Release $SAMPLES_PATH
61 printf "\nBuild completed, you can find binaries for all samples in the $HOME/inference_engine_samples_build/intel64/Release subfolder.\n\n"