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_PYTHON_WHL_README.md 3.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # Python whl package build support status
  2. * Windows build (cpu and gpu)
  3. * Linux build (cpu and gpu)
  4. * MacOS build (cpu only)
  5. * Android(termux) build (cpu only)
  6. # Build env prepare
  7. ## Linux
  8. * refer to [BUILD_README.md](../cmake-build/BUILD_README.md) Linux host build(CUDA env) section to init CUDA environment
  9. ```bash
  10. 1: please refer to https://docs.docker.com/engine/security/rootless/ to enable rootless docker env
  11. 2: cd ./scripts/whl/manylinux2014
  12. 3: ./build_image.sh
  13. 4: as aarch64-linux python3.5 pip do not provide megengine depends prebuild binary package, which definition
  14. in imperative/python/requires.txt, before install megengine wheel package(just python3.5), you need
  15. do follow step to init python3.5 arrow build env:
  16. 4a: wget https://apache.bintray.com/arrow/debian/apache-arrow-archive-keyring-latest-buster.deb
  17. 4b: sudo apt install ./apache-arrow-archive-keyring-latest-buster.deb
  18. 4c: sudo apt update
  19. 4d: sudo apt install libarrow-dev
  20. 4c: sudo apt install libarrow-python-dev
  21. 4e: sudo ln -s /usr/include/locale.h /usr/include/xlocale.h
  22. ```
  23. ## MacOS
  24. * refer to [BUILD_README.md](../cmake-build/BUILD_README.md) MacOS section to init base build environment
  25. * init other wheel build depends env by command:
  26. ```bash
  27. ./scripts/whl/macos/macos_whl_env_prepare.sh
  28. ```
  29. ## Android
  30. * install [termux](https://termux.com/) apk on Android Device
  31. * at least 8G DDR
  32. * at least Android 7
  33. * init wheel build-dependent env by command:
  34. ```bash
  35. ./scripts/whl/android/android_whl_env_prepare.sh
  36. ```
  37. ## Windows
  38. * refer to [BUILD_README.md](../cmake-build/BUILD_README.md) Windows section to init base build environment
  39. # How to build
  40. Note: Guarantee the git repo is mounted in docker container, do not use `git submodule update --init` in to init Project repo
  41. ## Build for linux
  42. * This Project delivers `wheel` package with `manylinux2014` tag defined in [PEP-571](https://www.python.org/dev/peps/pep-0571/).
  43. commands:
  44. ```bash
  45. ./scripts/whl/manylinux2014/build_wheel_common.sh -sdk cu101
  46. ```
  47. * And you can find all of the outputs in `output` directory.If you just want to build for a specific Python verison, you can use `ALL_PYTHON` environment variable. such as:
  48. ```bash
  49. ALL_PYTHON="36m" ./scripts/whl/manylinux2014/build_wheel_common.sh -sdk cu101
  50. ```
  51. * If you just want to build with cpu only version, you can set `-sdk` environment 'cpu'. such as:
  52. ```bash
  53. ALL_PYTHON="36m" ./scripts/whl/manylinux2014/build_wheel_common.sh -sdk cpu
  54. ```
  55. ## Build for MacOS
  56. * commands:
  57. ```bash
  58. ./scripts/whl/macos/macos_build_whl.sh
  59. ```
  60. * If you just want to build for a specific Python verison, you can use `ALL_PYTHON` environment variable. such as:
  61. ```bash
  62. ALL_PYTHON="3.7.7" ./scripts/whl/macos/macos_build_whl.sh
  63. ```
  64. ## Build for Windows
  65. * commands:
  66. ```bash
  67. ./scripts/whl/windows/windows_build_whl.sh
  68. ```
  69. * If you just want to build for a specific Python verison, you can use `ALL_PYTHON` environment variable. such as:
  70. ```bash
  71. ALL_PYTHON="3.8.3" ./scripts/whl/windows/windows_build_whl.sh
  72. ```
  73. * If you just want to build with cpu only version, you can set `BUILD_WHL_CPU_ONLY` environment 'ON'. such as:
  74. ```
  75. BUILD_WHL_CPU_ONLY="ON" ALL_PYTHON="3.8.3" ./scripts/whl/windows/windows_build_whl.sh
  76. ```
  77. ## Build for Android
  78. * commands:
  79. ```bash
  80. scripts/whl/android/android_build_whl.sh
  81. ```
  82. * If you just want to build for a specific Python verison, you can use `ALL_PYTHON` environment variable. such as:
  83. ```bash
  84. ALL_PYTHON="3.10.1" ./scripts/whl/android/android_build_whl.sh
  85. ```