extract build option function

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
pull/9566/head
zhoufeng 4 years ago
parent 45fefc80bb
commit 3296a8cab8

@ -340,23 +340,8 @@ checkopts()
esac esac
done done
} }
checkopts "$@"
echo "---------------- MindSpore: build start ----------------"
mkdir -pv "${BUILD_PATH}/package/mindspore/lib"
git submodule update --init graphengine
if [[ "X$ENABLE_AKG" = "Xon" ]] && [[ "X$ENABLE_D" = "Xon" || "X$ENABLE_GPU" = "Xon" ]]; then
git submodule update --init --recursive akg
fi
build_exit() parse_device()
{
echo "$@" >&2
stty echo
exit 1
}
# Create building path
build_mindspore()
{ {
# Process build option # Process build option
if [[ "X$DEVICE" == "Xgpu" ]]; then if [[ "X$DEVICE" == "Xgpu" ]]; then
@ -403,7 +388,27 @@ build_mindspore()
usage usage
exit 1 exit 1
fi fi
}
checkopts "$@"
parse_device
echo "---------------- MindSpore: build start ----------------"
mkdir -pv "${BUILD_PATH}/package/mindspore/lib"
git submodule update --init graphengine
if [[ "X$ENABLE_AKG" = "Xon" ]] && [[ "X$ENABLE_D" = "Xon" || "X$ENABLE_GPU" = "Xon" ]]; then
git submodule update --init --recursive akg
fi
build_exit()
{
echo "$@" >&2
stty echo
exit 1
}
# Create building path
build_mindspore()
{
echo "start build mindspore project." echo "start build mindspore project."
mkdir -pv "${BUILD_PATH}/mindspore" mkdir -pv "${BUILD_PATH}/mindspore"
cd "${BUILD_PATH}/mindspore" cd "${BUILD_PATH}/mindspore"
@ -692,9 +697,6 @@ build_lite()
{ {
get_version get_version
echo "============ Start building MindSpore Lite ${VERSION_STR} ============" echo "============ Start building MindSpore Lite ${VERSION_STR} ============"
if [[ "X$DEVICE" == "Xgpu" ]]; then
ENABLE_GPU="on"
fi
if [ "${ENABLE_GPU}" == "on" ] && [ "${LITE_PLATFORM}" == "arm64" ]; then if [ "${ENABLE_GPU}" == "on" ] && [ "${LITE_PLATFORM}" == "arm64" ]; then
echo "start build opencl" echo "start build opencl"
build_opencl build_opencl

Loading…
Cancel
Save