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.

build.bat 1.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @rem Copyright 2020 Huawei Technologies Co., Ltd
  2. @rem
  3. @rem Licensed under the Apache License, Version 2.0 (the "License");
  4. @rem you may not use this file except in compliance with the License.
  5. @rem You may obtain a copy of the License at
  6. @rem
  7. @rem http://www.apache.org/licenses/LICENSE-2.0
  8. @rem
  9. @rem Unless required by applicable law or agreed to in writing, software
  10. @rem distributed under the License is distributed on an "AS IS" BASIS,
  11. @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. @rem See the License for the specific language governing permissions and
  13. @rem limitations under the License.
  14. @rem ============================================================================
  15. @echo off
  16. @title mindspore_build
  17. SET BASEPATH=%CD%
  18. IF NOT EXIST %BASEPATH%/build (
  19. md "build"
  20. )
  21. cd %BASEPATH%/build
  22. SET BUILD_PATH=%CD%
  23. IF NOT EXIST %BUILD_PATH%/mindspore (
  24. md "mindspore"
  25. )
  26. cd %CD%/mindspore
  27. cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CPU=ON -DENABLE_MINDDATA=ON -DUSE_GLOG=ON -G "CodeBlocks - MinGW Makefiles" ../..
  28. IF NOT %errorlevel% == 0 (
  29. goto run_fail
  30. )
  31. IF "%1%" == "" (
  32. cmake --build . --target package -- -j6
  33. ) ELSE (
  34. cmake --build . --target package -- -j%1%
  35. )
  36. IF NOT %errorlevel% == 0 (
  37. goto run_fail
  38. )
  39. cd %BASEPATH%
  40. goto run_eof
  41. :run_fail
  42. cd %BASEPATH%
  43. echo "build fail."
  44. :run_eof