You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

option_proc_lite.sh 1.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. set -e
  17. build_option_proc_n()
  18. {
  19. if [[ "X$OPTARG" == "Xoff" || "X$OPTARG" == "Xlite" || "X$OPTARG" == "Xfull" || "X$OPTARG" == "Xlite_cv" || "X$OPTARG" == "Xwrapper" ]]; then
  20. export COMPILE_MINDDATA_LITE="$OPTARG"
  21. else
  22. echo "Invalid value ${OPTARG} for option -n"
  23. usage
  24. exit 1
  25. fi
  26. }
  27. build_option_proc_upper_i()
  28. {
  29. COMPILE_LITE="on"
  30. if [[ "$OPTARG" == "arm64" ]]; then
  31. LITE_PLATFORM="arm64"
  32. elif [[ "$OPTARG" == "arm32" ]]; then
  33. LITE_PLATFORM="arm32"
  34. elif [[ "$OPTARG" == "x86_64" ]]; then
  35. export LITE_PLATFORM="x86_64"
  36. else
  37. echo "-I parameter must be arm64、arm32 or x86_64"
  38. exit 1
  39. fi
  40. }
  41. build_option_proc_upper_a()
  42. {
  43. export COMPILE_LITE="on"
  44. if [[ "$OPTARG" == "on" ]]; then
  45. export LITE_ENABLE_AAR="on"
  46. fi
  47. }
  48. build_option_proc_upper_w()
  49. {
  50. if [[ "$OPTARG" != "sse" && "$OPTARG" != "off" && "$OPTARG" != "avx" && "$OPTARG" != "avx512" && "$OPTARG" != "neon" ]]; then
  51. echo "Invalid value ${OPTARG} for option -W, -W parameter must be sse|neon|avx|avx512|off"
  52. usage
  53. exit 1
  54. fi
  55. if [[ "$OPTARG" == "sse" || "$OPTARG" == "avx" || "$OPTARG" == "avx512" ]]; then
  56. export X86_64_SIMD="$OPTARG"
  57. fi
  58. if [[ "$OPTARG" == "neon" ]]; then
  59. export ARM_SIMD="$OPTARG"
  60. fi
  61. }