1#!/bin/bash 2# Copyright 2021 Huawei Technologies Co., Ltd 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# ============================================================================ 16 17set -e 18 19usage() 20{ 21 echo "Usage:" 22 echo "bash build.sh [-d] [-r] [-v] [-c on|off] [-t ut|st] [-g on|off] [-h] [-b ge] [-m infer|train] \\" 23 echo " [-a on|off] [-p on|off] [-i] [-R] [-D on|off] [-j[n]] [-e gpu|ascend|cpu] \\" 24 echo " [-P on|off] [-z [on|off]] [-M on|off] [-V 10.1|11.1|310|910] [-I arm64|arm32|x86_64] [-K] \\" 25 echo " [-B on|off] [-E] [-l on|off] [-n full|lite|off] [-H on|off] \\" 26 echo " [-A on|off] [-S on|off] [-k on|off] [-W sse|neon|avx|avx512|off] \\" 27 echo " [-L Tensor-RT path] [-y on|off] \\" 28 echo "" 29 echo "Options:" 30 echo " -d Debug mode" 31 echo " -r Release mode, default mode" 32 echo " -v Display build command" 33 echo " -c Enable code coverage, default off" 34 echo " -t Run testcases, default off" 35 echo " -g Use glog to output log, default on" 36 echo " -h Print usage" 37 echo " -b Select other backend, available: \\" 38 echo " ge:graph engine" 39 echo " -m Select graph engine backend mode, available: infer, train, default is infer" 40 echo " -a Enable ASAN, default off" 41 echo " -p Enable pipeline profile, print to stdout, default off" 42 echo " -R Enable pipeline profile, record to json, default off" 43 echo " -i Enable increment building, default off" 44 echo " -j[n] Set the threads when building (Default: -j8)" 45 echo " -e Use cpu, gpu or ascend" 46 echo " -s Enable security, default off" 47 echo " -P Enable dump anf graph to file in ProtoBuffer format, default on" 48 echo " -D Enable dumping of function graph ir, default on" 49 echo " -z Compile dataset & mindrecord, default on" 50 echo " -n Compile minddata with mindspore lite, available: off, lite, full, lite_cv, full mode in lite train and lite_cv, wrapper mode in lite predict" 51 echo " -M Enable MPI and NCCL for GPU training, gpu default on" 52 echo " -V Specify the device version, if -e gpu, default CUDA 10.1, if -e ascend, default Ascend 910" 53 echo " -I Enable compiling mindspore lite for arm64, arm32 or x86_64, default disable mindspore lite compilation" 54 echo " -A Enable compiling mindspore lite aar package, option: on/off, default: off" 55 echo " -K Compile with AKG, default on" 56 echo " -B Enable debugger, default on" 57 echo " -E Enable IBVERBS for parameter server, default off" 58 echo " -l Compile with python dependency, default on" 59 echo " -S Enable enable download cmake compile dependency from gitee , default off" 60 echo " -k Enable make clean, clean up compilation generated cache " 61 echo " -W Enable SIMD instruction set, use [sse|neon|avx|avx512|off], default avx for cloud CPU backend" 62 echo " -H Enable hidden" 63 echo " -L Link and specify Tensor-RT library path, default disable Tensor-RT lib linking" 64 echo " -y Compile the symbol table switch and save the symbol table to the directory output" 65}