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.3 kB

5 years ago
4 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
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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-*maven*.zip ${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/aarch64/
  43. mkdir -p ${output_path}/release/linux/ascend/
  44. cp ${input_path}/centos_x86/avx/*.tar.gz* ${output_path}/release/linux/x86_64/
  45. cp ${input_path}/linux_aarch64/*.tar.gz* ${output_path}/release/linux/aarch64/
  46. cp ${input_path}/centos_x86/ascend/*.tar.gz* ${output_path}/release/linux/ascend/
  47. cp -r ${input_path}/linux_aarch32/nnie/Hi* ${output_path}/release/linux/nnie/
  48. cp -r ${input_path}/linux_aarch64/nnie/Hi* ${output_path}/release/linux/nnie/
  49. cp ${input_path}/centos_x86/nnie/Hi3516D/*.tar.gz* ${output_path}/release/linux/nnie/
  50. }
  51. function windows_release_package()
  52. {
  53. mkdir -p ${output_path}/release/windows/
  54. cp ${input_path}/windows_x64/avx/*.zip* ${output_path}/release/windows/
  55. cp ${input_path}/windows_x32/sse/*.zip* ${output_path}/release/windows/
  56. }
  57. function openharmony_release_package()
  58. {
  59. mkdir -p ${output_path}/release/openharmony/
  60. cp ${input_path}/ohos_aarch32/*.tar.gz* ${output_path}/release/openharmony/
  61. }
  62. echo "============================== begin =============================="
  63. echo "Usage: bash lite_release_package.sh input_path output_path"
  64. input_path=$1
  65. output_path=$2
  66. version=`ls ${input_path}/android_aarch64/npu/mindspore-lite-*-*.tar.gz | awk -F'/' '{print $NF}' | cut -d"-" -f3`
  67. android_release_package aarch32 npu
  68. android_release_package aarch32 cpu
  69. android_release_package aarch64 npu
  70. android_release_package aarch64 gpu
  71. ios_release_package
  72. linux_release_package
  73. windows_release_package
  74. openharmony_release_package
  75. echo "Create release package success!"
  76. echo "=============================== end ==============================="