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.

lite_release_package.sh 3.5 kB

5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/bash
  2. # Copyright 2020-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. function android_release_package()
  18. {
  19. arch=$1
  20. device=$2
  21. pkg_name="mindspore-lite-${version}-android-${arch}"
  22. rm -rf ${pkg_name}
  23. tar -xzf ${input_path}/android_${arch}/${device}/${pkg_name}.tar.gz
  24. # Copy java runtime to Android package
  25. cp ${input_path}/aar/mindspore-lite-*.aar ${pkg_name}
  26. mkdir -p ${output_path}/release/android/${device}/
  27. tar -czf ${output_path}/release/android/${device}/${pkg_name}.tar.gz ${pkg_name}
  28. rm -rf ${pkg_name}
  29. cd ${output_path}/release/android/${device}/
  30. sha256sum ${pkg_name}.tar.gz > ${pkg_name}.tar.gz.sha256
  31. }
  32. function ios_release_package()
  33. {
  34. mkdir -p ${output_path}/release/ios/
  35. cp ${input_path}/ios_aarch64/*.tar.gz* ${output_path}/release/ios/
  36. cp ${input_path}/ios_aarch32/*.tar.gz* ${output_path}/release/ios/
  37. }
  38. function linux_release_package()
  39. {
  40. mkdir -p ${output_path}/release/linux/nnie/
  41. mkdir -p ${output_path}/release/linux/x86_64/
  42. mkdir -p ${output_path}/release/linux/x86_64/tensorrt/
  43. mkdir -p ${output_path}/release/linux/aarch64/
  44. mkdir -p ${output_path}/release/linux/ascend/
  45. cp ${input_path}/centos_x86/avx/*.tar.gz* ${output_path}/release/linux/x86_64/
  46. cp ${input_path}/linux_aarch64/*.tar.gz* ${output_path}/release/linux/aarch64/
  47. cp ${input_path}/centos_x86/ascend/*.tar.gz* ${output_path}/release/linux/ascend/
  48. cp ${input_path}/centos_x86/tensorrt/*.tar.gz* ${output_path}/release/linux/x86_64/tensorrt/
  49. cp -r ${input_path}/linux_aarch32/nnie/Hi* ${output_path}/release/linux/nnie/
  50. cp -r ${input_path}/linux_aarch64/nnie/Hi* ${output_path}/release/linux/nnie/
  51. cp ${input_path}/centos_x86/nnie/Hi3516D/*.tar.gz* ${output_path}/release/linux/nnie/
  52. }
  53. function windows_release_package()
  54. {
  55. mkdir -p ${output_path}/release/windows/
  56. cp ${input_path}/windows_x64/avx/*.zip* ${output_path}/release/windows/
  57. cp ${input_path}/windows_x32/sse/*.zip* ${output_path}/release/windows/
  58. }
  59. function openharmony_release_package()
  60. {
  61. mkdir -p ${output_path}/release/openharmony/
  62. cp ${input_path}/ohos_aarch32/*.tar.gz* ${output_path}/release/openharmony/
  63. }
  64. echo "============================== begin =============================="
  65. echo "Usage: bash lite_release_package.sh input_path output_path"
  66. input_path=$1
  67. output_path=$2
  68. version=`ls ${input_path}/android_aarch64/npu/mindspore-lite-*-*.tar.gz | awk -F'/' '{print $NF}' | cut -d"-" -f3`
  69. android_release_package aarch32 npu
  70. android_release_package aarch32 cpu
  71. android_release_package aarch64 npu
  72. android_release_package aarch64 gpu
  73. ios_release_package
  74. linux_release_package
  75. windows_release_package
  76. openharmony_release_package
  77. echo "Create release package success!"
  78. echo "=============================== end ==============================="