From 4124084c5763dfd8eb26e07f53627b6d2d022d06 Mon Sep 17 00:00:00 2001 From: nihuini Date: Sat, 19 Nov 2022 13:17:50 +0800 Subject: [PATCH 01/19] update release ci --- .github/workflows/release-python.yml | 11 +++++++---- .github/workflows/release.yml | 20 ++++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index d11442659f5..8bc03ab8643 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -53,10 +53,12 @@ jobs: brew uninstall --ignore-dependencies libomp - name: Build wheels - uses: pypa/cibuildwheel@v2.11.2 + uses: pypa/cibuildwheel@v2 env: CIBW_ARCHS_MACOS: x86_64 universal2 arm64 CIBW_ARCHS_LINUX: x86_64 i686 + CIBW_ARCHS_WINDOWS: x86 AMD64 ARM64 + CIBW_ENVIRONMENT: CMAKE_BUILD_PARALLEL_LEVEL=2 - name: Show files run: ls -lh wheelhouse @@ -79,7 +81,7 @@ jobs: fail-fast: false matrix: arch: [aarch64, ppc64le, s390x] - build: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*"] + build: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"] include: - arch: aarch64 build: "pp37-*" @@ -103,10 +105,11 @@ jobs: platforms: all - name: Build wheels - uses: pypa/cibuildwheel@v2.11.2 + uses: pypa/cibuildwheel@v2 env: CIBW_ARCHS_LINUX: ${{ matrix.arch }} CIBW_BUILD: ${{ matrix.build }} + CIBW_ENVIRONMENT: CMAKE_BUILD_PARALLEL_LEVEL=2 - name: Show files run: ls -lh wheelhouse @@ -138,7 +141,7 @@ jobs: name: artifact path: dist - - uses: pypa/gh-action-pypi-publish@v1.5.1 + - uses: pypa/gh-action-pypi-publish@v1 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9add249d239..3a73d733a21 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: steps: - name: get-version id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT full-source: needs: [setup] @@ -237,7 +237,7 @@ jobs: path: ${{ env.PACKAGENAME }}.zip openmp-macos: - runs-on: macos-latest + runs-on: macos-11 steps: - name: cache-openmp id: cache-openmp @@ -290,7 +290,7 @@ jobs: macos: needs: [setup, openmp-macos] - runs-on: macos-latest + runs-on: macos-11 env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-macos steps: @@ -358,7 +358,7 @@ jobs: macos-gpu: needs: [setup, openmp-macos] - runs-on: macos-latest + runs-on: macos-11 env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-macos-vulkan steps: @@ -454,7 +454,7 @@ jobs: path: ${{ env.PACKAGENAME }}.zip openmp-ios: - runs-on: macos-latest + runs-on: macos-11 steps: - name: cache-openmp id: cache-openmp @@ -511,7 +511,7 @@ jobs: ios: needs: [setup, openmp-ios] - runs-on: macos-latest + runs-on: macos-11 env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-ios steps: @@ -594,7 +594,7 @@ jobs: ios-gpu: needs: [setup, openmp-ios] - runs-on: macos-latest + runs-on: macos-11 env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-ios-vulkan steps: @@ -693,7 +693,7 @@ jobs: path: ${{ env.PACKAGENAME }}.zip openmp-ios-bitcode: - runs-on: macos-latest + runs-on: macos-11 steps: - name: cache-openmp id: cache-openmp @@ -750,7 +750,7 @@ jobs: ios-bitcode: needs: [setup, openmp-ios-bitcode] - runs-on: macos-latest + runs-on: macos-11 env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-ios-bitcode steps: @@ -833,7 +833,7 @@ jobs: ios-gpu-bitcode: needs: [setup, openmp-ios-bitcode] - runs-on: macos-latest + runs-on: macos-11 env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-ios-vulkan-bitcode steps: From 3e040fe86c07f963b1cdaac9ec9cbb1c8c2767c8 Mon Sep 17 00:00:00 2001 From: nihuini Date: Sat, 19 Nov 2022 13:57:51 +0800 Subject: [PATCH 02/19] find modern glslang --- CMakeLists.txt | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39ae83e58b7..62ea76885a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -495,29 +495,38 @@ endif() if(NCNN_VULKAN) if(NCNN_SYSTEM_GLSLANG) - set(GLSLANG_TARGET_DIR "GLSLANG-NOTFOUND" CACHE PATH "Absolute path to glslangTargets.cmake directory") - if(NOT GLSLANG_TARGET_DIR AND NOT DEFINED ENV{GLSLANG_TARGET_DIR}) - message(WARNING "GLSLANG_TARGET_DIR must be defined! NCNN_SYSTEM_GLSLANG will be turned off.") - set(NCNN_SYSTEM_GLSLANG OFF) + find_package(Threads) + find_package(glslang QUIET) + if(glslang_FOUND) + add_library(glslang ALIAS glslang::glslang) + add_library(SPIRV ALIAS glslang::SPIRV) else() - message(STATUS "Using glslang install located at ${GLSLANG_TARGET_DIR}") - - find_package(Threads) - - include("${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake") - include("${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake") - if(EXISTS "${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") - # hlsl support can be optional - include("${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") - endif() - include("${GLSLANG_TARGET_DIR}/glslangTargets.cmake") - include("${GLSLANG_TARGET_DIR}/SPIRVTargets.cmake") - - if (NOT TARGET glslang OR NOT TARGET SPIRV) - message(WARNING "glslang or SPIRV target not found! NCNN_SYSTEM_GLSLANG will be turned off.") + set(GLSLANG_TARGET_DIR "GLSLANG-NOTFOUND" CACHE PATH "Absolute path to glslangTargets.cmake directory") + if(NOT GLSLANG_TARGET_DIR AND NOT DEFINED ENV{GLSLANG_TARGET_DIR}) + message(WARNING "set glslang_DIR to glslang-config.cmake directory for using system glslang.") + message(WARNING "GLSLANG_TARGET_DIR must be defined! NCNN_SYSTEM_GLSLANG will be turned off.") set(NCNN_SYSTEM_GLSLANG OFF) + else() + include("${GLSLANG_TARGET_DIR}/OSDependentTargets.cmake") + include("${GLSLANG_TARGET_DIR}/OGLCompilerTargets.cmake") + if(EXISTS "${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") + # hlsl support can be optional + include("${GLSLANG_TARGET_DIR}/HLSLTargets.cmake") + endif() + include("${GLSLANG_TARGET_DIR}/glslangTargets.cmake") + include("${GLSLANG_TARGET_DIR}/SPIRVTargets.cmake") endif() endif() + + if (TARGET glslang AND TARGET SPIRV) + get_property(glslang_location TARGET glslang PROPERTY LOCATION) + get_property(SPIRV_location TARGET SPIRV PROPERTY LOCATION) + message(STATUS "Found glslang: ${glslang_location} (found version \"${glslang_VERSION}\")") + message(STATUS "Found SPIRV: ${SPIRV_location} (found version \"${glslang_VERSION}\")") + else() + message(WARNING "glslang or SPIRV target not found! NCNN_SYSTEM_GLSLANG will be turned off.") + set(NCNN_SYSTEM_GLSLANG OFF) + endif() endif() if(NOT NCNN_SYSTEM_GLSLANG) From 4ec30cf671f3ebc6312bdf6101c7e06c352ab104 Mon Sep 17 00:00:00 2001 From: nihuini Date: Sat, 19 Nov 2022 14:08:51 +0800 Subject: [PATCH 03/19] fix --- .github/workflows/release-python.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 8bc03ab8643..f310aa50f8f 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -53,7 +53,7 @@ jobs: brew uninstall --ignore-dependencies libomp - name: Build wheels - uses: pypa/cibuildwheel@v2 + uses: pypa/cibuildwheel@v2.11.2 env: CIBW_ARCHS_MACOS: x86_64 universal2 arm64 CIBW_ARCHS_LINUX: x86_64 i686 @@ -105,7 +105,7 @@ jobs: platforms: all - name: Build wheels - uses: pypa/cibuildwheel@v2 + uses: pypa/cibuildwheel@v2.11.2 env: CIBW_ARCHS_LINUX: ${{ matrix.arch }} CIBW_BUILD: ${{ matrix.build }} From e2efb1f2e21bb4a154d9d6a3595b1e26253e2c91 Mon Sep 17 00:00:00 2001 From: nihuini Date: Sat, 19 Nov 2022 14:30:22 +0800 Subject: [PATCH 04/19] fix python build --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 3c97205e453..89e78bf7764 100644 --- a/setup.py +++ b/setup.py @@ -67,6 +67,8 @@ def build_extension(self, ext): "-DPYTHON_EXECUTABLE={}".format(sys.executable), "-DCMAKE_BUILD_TYPE={}".format(cfg), # not used on MSVC, but no harm "-DNCNN_PYTHON=ON", + "-DNCNN_DISABLE_RTTI=OFF", + "-DNCNN_DISABLE_EXCEPTION=OFF", "-DNCNN_BUILD_BENCHMARK=OFF", "-DNCNN_BUILD_EXAMPLES=OFF", "-DNCNN_BUILD_TOOLS=OFF", From 487270fadb039b754f9ba0943cc5581dbbf20db6 Mon Sep 17 00:00:00 2001 From: nihuini Date: Sat, 19 Nov 2022 14:36:14 +0800 Subject: [PATCH 05/19] parallel jobs on windows --- .github/workflows/release.yml | 8 ++++++++ .github/workflows/windows-arm-cpu.yml | 2 ++ .github/workflows/windows-arm64-cpu.yml | 2 ++ .github/workflows/windows-x64-cpu-vs2019-python.yml | 2 ++ .github/workflows/windows-x64-cpu.yml | 2 ++ .github/workflows/windows-x64-gpu.yml | 2 ++ .github/workflows/windows-x86-cpu.yml | 2 ++ 7 files changed, 20 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3a73d733a21..d1762616790 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1267,6 +1267,7 @@ jobs: runs-on: windows-2019 env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-windows-vs2015 + UseMultiToolTask: true steps: - uses: actions/checkout@v3 with: @@ -1332,6 +1333,7 @@ jobs: runs-on: windows-2019 env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-windows-vs2015-shared + UseMultiToolTask: true steps: - uses: actions/checkout@v3 with: @@ -1397,6 +1399,7 @@ jobs: runs-on: windows-2019 env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-windows-vs2017 + UseMultiToolTask: true steps: - uses: actions/checkout@v3 with: @@ -1462,6 +1465,7 @@ jobs: runs-on: windows-2019 env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-windows-vs2017-shared + UseMultiToolTask: true steps: - uses: actions/checkout@v3 with: @@ -1527,6 +1531,7 @@ jobs: runs-on: windows-latest env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-windows-vs2019 + UseMultiToolTask: true steps: - uses: actions/checkout@v3 with: @@ -1608,6 +1613,7 @@ jobs: runs-on: windows-latest env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-windows-vs2019-shared + UseMultiToolTask: true steps: - uses: actions/checkout@v3 with: @@ -1689,6 +1695,7 @@ jobs: runs-on: windows-latest env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-windows-vs2022 + UseMultiToolTask: true steps: - uses: actions/checkout@v3 with: @@ -1770,6 +1777,7 @@ jobs: runs-on: windows-latest env: PACKAGENAME: ncnn-${{ needs.setup.outputs.VERSION }}-windows-vs2022-shared + UseMultiToolTask: true steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/windows-arm-cpu.yml b/.github/workflows/windows-arm-cpu.yml index 2b1441ed74b..d789482a595 100644 --- a/.github/workflows/windows-arm-cpu.yml +++ b/.github/workflows/windows-arm-cpu.yml @@ -41,6 +41,8 @@ jobs: toolset-version: v143 os: windows-2022 + env: + UseMultiToolTask: true steps: - uses: actions/checkout@v3 - name: build diff --git a/.github/workflows/windows-arm64-cpu.yml b/.github/workflows/windows-arm64-cpu.yml index 49cd6e200ff..a6bdbda01de 100644 --- a/.github/workflows/windows-arm64-cpu.yml +++ b/.github/workflows/windows-arm64-cpu.yml @@ -41,6 +41,8 @@ jobs: toolset-version: v143 os: windows-2022 + env: + UseMultiToolTask: true steps: - uses: actions/checkout@v3 - name: build diff --git a/.github/workflows/windows-x64-cpu-vs2019-python.yml b/.github/workflows/windows-x64-cpu-vs2019-python.yml index 7ef6a1adcec..3d4e6583766 100644 --- a/.github/workflows/windows-x64-cpu-vs2019-python.yml +++ b/.github/workflows/windows-x64-cpu-vs2019-python.yml @@ -32,6 +32,8 @@ jobs: strategy: matrix: python-version: [3.6, 3.7, 3.8, 3.9] + env: + UseMultiToolTask: true steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/windows-x64-cpu.yml b/.github/workflows/windows-x64-cpu.yml index c93fc8adfe1..200185d1a56 100644 --- a/.github/workflows/windows-x64-cpu.yml +++ b/.github/workflows/windows-x64-cpu.yml @@ -55,6 +55,8 @@ jobs: toolset-version: v143 os: windows-2022 + env: + UseMultiToolTask: true steps: - uses: actions/checkout@v3 - name: cache-protobuf diff --git a/.github/workflows/windows-x64-gpu.yml b/.github/workflows/windows-x64-gpu.yml index 4101e43ce25..3d707c17052 100644 --- a/.github/workflows/windows-x64-gpu.yml +++ b/.github/workflows/windows-x64-gpu.yml @@ -57,6 +57,8 @@ jobs: toolset-version: v143 os: windows-2022 + env: + UseMultiToolTask: true steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/windows-x86-cpu.yml b/.github/workflows/windows-x86-cpu.yml index 8e692e0d695..b48431a97ac 100644 --- a/.github/workflows/windows-x86-cpu.yml +++ b/.github/workflows/windows-x86-cpu.yml @@ -49,6 +49,8 @@ jobs: toolset-version: v143 os: windows-2022 + env: + UseMultiToolTask: true steps: - uses: actions/checkout@v3 - name: build From c47945665fd2d96af85eaa3047cb2ea72e7ebf7d Mon Sep 17 00:00:00 2001 From: nihuini Date: Sat, 19 Nov 2022 15:15:59 +0800 Subject: [PATCH 06/19] update pybind11 --- python/pybind11 | 2 +- python/src/pybind11_allocator.h | 41 +++++++++++++++----------------- python/src/pybind11_datareader.h | 10 ++++---- python/src/pybind11_modelbin.h | 10 ++++---- 4 files changed, 30 insertions(+), 33 deletions(-) diff --git a/python/pybind11 b/python/pybind11 index 70a58c577ea..80dc998efce 160000 --- a/python/pybind11 +++ b/python/pybind11 @@ -1 +1 @@ -Subproject commit 70a58c577eaf067748c2ec31bfd0b0a614cffba6 +Subproject commit 80dc998efced8ceb2be59756668a7e90e8bef917 diff --git a/python/src/pybind11_allocator.h b/python/src/pybind11_allocator.h index 7c568209cfe..64ce553c752 100644 --- a/python/src/pybind11_allocator.h +++ b/python/src/pybind11_allocator.h @@ -25,11 +25,11 @@ class PyAllocator : public Base using Base::Base; // Inherit constructors void* fastMalloc(size_t size) override { - PYBIND11_OVERLOAD_PURE(void*, Base, fastMalloc, size); + PYBIND11_OVERRIDE_PURE(void*, Base, fastMalloc, size); } void fastFree(void* ptr) override { - PYBIND11_OVERLOAD_PURE(void, Base, fastFree, ptr); + PYBIND11_OVERRIDE_PURE(void, Base, fastFree, ptr); } }; @@ -40,11 +40,11 @@ class PyAllocatorOther : public PyAllocator using PyAllocator::PyAllocator; void* fastMalloc(size_t size) override { - PYBIND11_OVERLOAD(void*, Other, fastMalloc, size); + PYBIND11_OVERRIDE(void*, Other, fastMalloc, size); } void fastFree(void* ptr) override { - PYBIND11_OVERLOAD(void, Other, fastFree, ptr); + PYBIND11_OVERRIDE(void, Other, fastFree, ptr); } }; @@ -56,23 +56,23 @@ class PyVkAllocator : public Base using Base::Base; // Inherit constructors void clear() override { - PYBIND11_OVERLOAD(void, Base, clear, ); + PYBIND11_OVERRIDE(void, Base, clear, ); } ncnn::VkBufferMemory* fastMalloc(size_t size) override { - PYBIND11_OVERLOAD_PURE(ncnn::VkBufferMemory*, Base, fastMalloc, size); + PYBIND11_OVERRIDE_PURE(ncnn::VkBufferMemory*, Base, fastMalloc, size); } void fastFree(ncnn::VkBufferMemory* ptr) override { - PYBIND11_OVERLOAD_PURE(void, Base, fastFree, ptr); + PYBIND11_OVERRIDE_PURE(void, Base, fastFree, ptr); } int flush(ncnn::VkBufferMemory* ptr) override { - PYBIND11_OVERLOAD(int, Base, flush, ptr); + PYBIND11_OVERRIDE(int, Base, flush, ptr); } int invalidate(ncnn::VkBufferMemory* ptr) override { - PYBIND11_OVERLOAD(int, Base, invalidate, ptr); + PYBIND11_OVERRIDE(int, Base, invalidate, ptr); } }; @@ -83,15 +83,15 @@ class PyVkAllocatorOther : public PyVkAllocator using PyVkAllocator::PyVkAllocator; void clear() override { - PYBIND11_OVERLOAD(void, Other, clear, ); + PYBIND11_OVERRIDE(void, Other, clear, ); } ncnn::VkBufferMemory* fastMalloc(size_t size) override { - PYBIND11_OVERLOAD(ncnn::VkBufferMemory*, Other, fastMalloc, size); + PYBIND11_OVERRIDE(ncnn::VkBufferMemory*, Other, fastMalloc, size); } void fastFree(ncnn::VkBufferMemory* ptr) override { - PYBIND11_OVERLOAD(void, Other, fastFree, ptr); + PYBIND11_OVERRIDE(void, Other, fastFree, ptr); } }; @@ -102,17 +102,15 @@ class PyVkBlobAllocator : public Base using Base::Base; // Inherit constructors void clear() override { - PYBIND11_OVERLOAD(void, Base, clear, ); + PYBIND11_OVERRIDE(void, Base, clear, ); } - ncnn::VkImageMemory* fastMalloc(int width, int height, - VkFormat format) override + ncnn::VkImageMemory* fastMalloc(int width, int height, VkFormat format) override { - PYBIND11_OVERLOAD_PURE(ncnn::VkImageMemory*, Base, fastMalloc, width, - height, format); + PYBIND11_OVERRIDE_PURE(ncnn::VkImageMemory*, Base, fastMalloc, width, height, format); } void fastFree(ncnn::VkImageMemory* ptr) override { - PYBIND11_OVERLOAD_PURE(void, Base, fastFree, ptr); + PYBIND11_OVERRIDE_PURE(void, Base, fastFree, ptr); } }; @@ -124,14 +122,13 @@ class PyVkBlobAllocator : public Base // ncnn::VkImageMemory* fastMalloc(int width, int height, // VkFormat format) override // { -// PYBIND11_OVERLOAD(ncnn::VkImageMemory*, Other, fastMalloc, width, height, -// format); +// PYBIND11_OVERRIDE(ncnn::VkImageMemory*, Other, fastMalloc, width, height, format); // } // void fastFree(ncnn::VkImageMemory* ptr) override // { -// PYBIND11_OVERLOAD(void, Other, fastFree, ptr); +// PYBIND11_OVERRIDE(void, Other, fastFree, ptr); // } //}; #endif // NCNN_VULKAN -#endif \ No newline at end of file +#endif diff --git a/python/src/pybind11_datareader.h b/python/src/pybind11_datareader.h index e9ecfb8058e..63b67ee47c7 100644 --- a/python/src/pybind11_datareader.h +++ b/python/src/pybind11_datareader.h @@ -42,12 +42,12 @@ class PyDataReader : public Base #if NCNN_STRING int scan(const char* format, void* p) const override { - PYBIND11_OVERLOAD(int, Base, scan, format, p); + PYBIND11_OVERRIDE(int, Base, scan, format, p); } #endif // NCNN_STRING size_t read(void* buf, size_t size) const override { - PYBIND11_OVERLOAD(size_t, Base, read, buf, size); + PYBIND11_OVERRIDE(size_t, Base, read, buf, size); } }; @@ -59,13 +59,13 @@ class PyDataReaderOther : public PyDataReader #if NCNN_STRING int scan(const char* format, void* p) const override { - PYBIND11_OVERLOAD(int, Other, scan, format, p); + PYBIND11_OVERRIDE(int, Other, scan, format, p); } #endif // NCNN_STRING size_t read(void* buf, size_t size) const override { - PYBIND11_OVERLOAD(size_t, Other, read, buf, size); + PYBIND11_OVERRIDE(size_t, Other, read, buf, size); } }; -#endif \ No newline at end of file +#endif diff --git a/python/src/pybind11_modelbin.h b/python/src/pybind11_modelbin.h index 6b5e3a676ca..5f875061c88 100644 --- a/python/src/pybind11_modelbin.h +++ b/python/src/pybind11_modelbin.h @@ -25,13 +25,13 @@ class PyModelBin : public Base using Base::Base; // Inherit constructors ncnn::Mat load(int w, int type) const override { - PYBIND11_OVERLOAD_PURE(ncnn::Mat, Base, load, w, type); + PYBIND11_OVERRIDE_PURE(ncnn::Mat, Base, load, w, type); } //ncnn::Mat load(int w, int h, int type) const override { - // PYBIND11_OVERLOAD(ncnn::Mat, Base, load, w, h, type); + // PYBIND11_OVERRIDE(ncnn::Mat, Base, load, w, h, type); //} //ncnn::Mat load(int w, int h, int c, int type) const override { - // PYBIND11_OVERLOAD(ncnn::Mat, Base, load, w, h, c, type); + // PYBIND11_OVERRIDE(ncnn::Mat, Base, load, w, h, c, type); //} }; @@ -42,8 +42,8 @@ class PyModelBinOther : public PyModelBin using PyModelBin::PyModelBin; ncnn::Mat load(int w, int type) const override { - PYBIND11_OVERLOAD(ncnn::Mat, Other, load, w, type); + PYBIND11_OVERRIDE(ncnn::Mat, Other, load, w, type); } }; -#endif \ No newline at end of file +#endif From 23a44bd58e2b977ae7088bb0263adfe5a21d34af Mon Sep 17 00:00:00 2001 From: nihui Date: Sat, 19 Nov 2022 22:20:31 +0800 Subject: [PATCH 07/19] find python --- .github/workflows/release-python.yml | 27 ++++++++++++++++++--------- python/CMakeLists.txt | 1 + 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index f310aa50f8f..9c50c162c95 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -1,8 +1,9 @@ name: release-python -on: - push: - tags: - - '*' +on: [push, pull_request] +# on: +# push: +# tags: +# - '*' jobs: build_sdist: @@ -31,12 +32,20 @@ jobs: path: dist/*.tar.gz build_wheels: - name: Build wheels on ${{ matrix.os }} + name: Build wheels ${{ matrix.arch }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2019, macos-11] + include: + - { os: ubuntu-20.04, arch: x86_64 } + - { os: ubuntu-20.04, arch: i686 } + - { os: windows-2019, arch: x86 } + - { os: windows-2019, arch: AMD64 } + - { os: windows-2019, arch: ARM64 } + - { os: macos-11, arch: x86_64 } + - { os: macos-11, arch: arm64 } + - { os: macos-11, arch: universal2 } steps: - uses: actions/checkout@v3 @@ -55,9 +64,9 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.11.2 env: - CIBW_ARCHS_MACOS: x86_64 universal2 arm64 - CIBW_ARCHS_LINUX: x86_64 i686 - CIBW_ARCHS_WINDOWS: x86 AMD64 ARM64 + CIBW_ARCHS_MACOS: ${{ matrix.arch }} + CIBW_ARCHS_LINUX: ${{ matrix.arch }} + CIBW_ARCHS_WINDOWS: ${{ matrix.arch }} CIBW_ENVIRONMENT: CMAKE_BUILD_PARALLEL_LEVEL=2 - name: Show files diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 140555ce706..8e6c4916159 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -8,6 +8,7 @@ add_definitions(-DVERSION_INFO="${PACKAGE_VERSION}") set( CMAKE_CXX_STANDARD 11 ) set( CMAKE_CXX_STANDARD_REQUIRED ON ) +find_package(Python COMPONENTS Interpreter Development REQUIRED) add_subdirectory(pybind11) if("${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" STREQUAL "") From c4b7af5ae0cd7a6bae6531622de78f80c3ff865a Mon Sep 17 00:00:00 2001 From: nihui Date: Sat, 19 Nov 2022 22:24:21 +0800 Subject: [PATCH 08/19] debug --- .github/workflows/release-python.yml | 31 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 9c50c162c95..899aba6af23 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -38,14 +38,14 @@ jobs: fail-fast: false matrix: include: - - { os: ubuntu-20.04, arch: x86_64 } - - { os: ubuntu-20.04, arch: i686 } - - { os: windows-2019, arch: x86 } - - { os: windows-2019, arch: AMD64 } + # - { os: ubuntu-20.04, arch: x86_64 } + # - { os: ubuntu-20.04, arch: i686 } + # - { os: windows-2019, arch: x86 } + # - { os: windows-2019, arch: AMD64 } - { os: windows-2019, arch: ARM64 } - - { os: macos-11, arch: x86_64 } - - { os: macos-11, arch: arm64 } - - { os: macos-11, arch: universal2 } + # - { os: macos-11, arch: x86_64 } + # - { os: macos-11, arch: arm64 } + # - { os: macos-11, arch: universal2 } steps: - uses: actions/checkout@v3 @@ -90,14 +90,15 @@ jobs: fail-fast: false matrix: arch: [aarch64, ppc64le, s390x] - build: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"] - include: - - arch: aarch64 - build: "pp37-*" - - arch: aarch64 - build: "pp38-*" - - arch: aarch64 - build: "pp39-*" + build: ["cp311-*"] + # build: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"] + # include: + # - arch: aarch64 + # build: "pp37-*" + # - arch: aarch64 + # build: "pp38-*" + # - arch: aarch64 + # build: "pp39-*" steps: - uses: actions/checkout@v3 From b09520245d494e0d6d7c3e484c3ba6c1213254bc Mon Sep 17 00:00:00 2001 From: nihui Date: Sat, 19 Nov 2022 22:55:52 +0800 Subject: [PATCH 09/19] hack --- python/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 8e6c4916159..a351466cdf0 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -8,7 +8,10 @@ add_definitions(-DVERSION_INFO="${PACKAGE_VERSION}") set( CMAKE_CXX_STANDARD 11 ) set( CMAKE_CXX_STANDARD_REQUIRED ON ) -find_package(Python COMPONENTS Interpreter Development REQUIRED) +if(CMAKE_CROSSCOMPILING) + option(PYBIND11_PYTHONLIBS_OVERWRITE "" OFF) + set(PYTHON_LIBRARY "C:/Users/runneradmin/AppData/Local/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.3.9.10/tools/libs/python39.lib") +endif() add_subdirectory(pybind11) if("${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" STREQUAL "") From dfbe29133a2cd8a944416c4899f87048ca1ccec3 Mon Sep 17 00:00:00 2001 From: nihui Date: Sat, 19 Nov 2022 23:03:39 +0800 Subject: [PATCH 10/19] debug --- .github/workflows/release-python.yml | 2 ++ python/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 899aba6af23..ae08cfa7543 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -67,6 +67,7 @@ jobs: CIBW_ARCHS_MACOS: ${{ matrix.arch }} CIBW_ARCHS_LINUX: ${{ matrix.arch }} CIBW_ARCHS_WINDOWS: ${{ matrix.arch }} + CIBW_BUILD_VERBOSITY: 1 CIBW_ENVIRONMENT: CMAKE_BUILD_PARALLEL_LEVEL=2 - name: Show files @@ -119,6 +120,7 @@ jobs: env: CIBW_ARCHS_LINUX: ${{ matrix.arch }} CIBW_BUILD: ${{ matrix.build }} + CIBW_BUILD_VERBOSITY: 1 CIBW_ENVIRONMENT: CMAKE_BUILD_PARALLEL_LEVEL=2 - name: Show files diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index a351466cdf0..6c1bef8918b 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -8,7 +8,7 @@ add_definitions(-DVERSION_INFO="${PACKAGE_VERSION}") set( CMAKE_CXX_STANDARD 11 ) set( CMAKE_CXX_STANDARD_REQUIRED ON ) -if(CMAKE_CROSSCOMPILING) +if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "ARM64") option(PYBIND11_PYTHONLIBS_OVERWRITE "" OFF) set(PYTHON_LIBRARY "C:/Users/runneradmin/AppData/Local/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.3.9.10/tools/libs/python39.lib") endif() From 8aaf611318197194e9416a9e9f90f30a6c0d1e8d Mon Sep 17 00:00:00 2001 From: nihui Date: Sat, 19 Nov 2022 23:10:17 +0800 Subject: [PATCH 11/19] debug --- python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 6c1bef8918b..83065a62fec 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -10,7 +10,7 @@ set( CMAKE_CXX_STANDARD_REQUIRED ON ) if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "ARM64") option(PYBIND11_PYTHONLIBS_OVERWRITE "" OFF) - set(PYTHON_LIBRARY "C:/Users/runneradmin/AppData/Local/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.3.9.10/tools/libs/python39.lib") + set(PYTHON_PREFIX "C:/Users/runneradmin/AppData/Local/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.3.9.10/tools") endif() add_subdirectory(pybind11) From eab94119cb38ef2300acb9783eb07956292b70fa Mon Sep 17 00:00:00 2001 From: nihui Date: Sun, 20 Nov 2022 12:16:25 +0800 Subject: [PATCH 12/19] hack python path --- python/CMakeLists.txt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 83065a62fec..09e309a6fcf 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -8,11 +8,21 @@ add_definitions(-DVERSION_INFO="${PACKAGE_VERSION}") set( CMAKE_CXX_STANDARD 11 ) set( CMAKE_CXX_STANDARD_REQUIRED ON ) +add_subdirectory(pybind11) + if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "ARM64") - option(PYBIND11_PYTHONLIBS_OVERWRITE "" OFF) - set(PYTHON_PREFIX "C:/Users/runneradmin/AppData/Local/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.3.9.10/tools") + message(WARNING + " This is hack for cibuildwheel on github action" + " Use the right way to cross-compile python module for windows arm64 like follows" + " option(PYBIND11_PYTHONLIBS_OVERWRITE \"\" OFF)" + " set(PYTHON_PREFIX \"\")" + ) + # option(PYBIND11_PYTHONLIBS_OVERWRITE "" OFF) + # set(PYTHON_PREFIX "C:/Users/runneradmin/AppData/Local/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.3.9.10/tools") + + string(REPLACE "nuget-cpython/python." "nuget-cpython/pythonarm64." PYTHON_LIBRARIES "${PYTHON_LIBRARIES}") + string(REPLACE "nuget-cpython/python." "nuget-cpython/pythonarm64." PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS}") endif() -add_subdirectory(pybind11) if("${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" STREQUAL "") if(MSVC OR CMAKE_GENERATOR STREQUAL "Xcode") From 54dd0fb67ec87b4e8caa2b0d8f0e0f4b153bfd7f Mon Sep 17 00:00:00 2001 From: nihui Date: Sun, 20 Nov 2022 14:12:40 +0800 Subject: [PATCH 13/19] hack --- python/CMakeLists.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 09e309a6fcf..53f8bfc9be3 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -8,22 +8,22 @@ add_definitions(-DVERSION_INFO="${PACKAGE_VERSION}") set( CMAKE_CXX_STANDARD 11 ) set( CMAKE_CXX_STANDARD_REQUIRED ON ) -add_subdirectory(pybind11) - if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "ARM64") message(WARNING - " This is hack for cibuildwheel on github action" - " Use the right way to cross-compile python module for windows arm64 like follows" - " option(PYBIND11_PYTHONLIBS_OVERWRITE \"\" OFF)" - " set(PYTHON_PREFIX \"\")" + " This is hack for cibuildwheel on github action\n" + " Use the right way to cross-compile python module for windows arm64 like follows\n" + " option(PYBIND11_PYTHONLIBS_OVERWRITE \"\" OFF)\n" + " set(PYTHON_PREFIX \"\")\n" ) - # option(PYBIND11_PYTHONLIBS_OVERWRITE "" OFF) - # set(PYTHON_PREFIX "C:/Users/runneradmin/AppData/Local/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.3.9.10/tools") - - string(REPLACE "nuget-cpython/python." "nuget-cpython/pythonarm64." PYTHON_LIBRARIES "${PYTHON_LIBRARIES}") - string(REPLACE "nuget-cpython/python." "nuget-cpython/pythonarm64." PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS}") + option(PYBIND11_PYTHONLIBS_OVERWRITE "" OFF) + message(WARNING "VIRTUAL_ENV = $ENV{VIRTUAL_ENV}") + string(REPLACE "nuget-cpython/python." "nuget-cpython/pythonarm64." ARM64_VIRTUAL_ENV "$ENV{VIRTUAL_ENV}") + message(WARNING "ARM64_VIRTUAL_ENV = $ARM64_VIRTUAL_ENV") + set(PYTHON_PREFIX "C:/Users/runneradmin/AppData/Local/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.3.9.10/tools") endif() +add_subdirectory(pybind11) + if("${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" STREQUAL "") if(MSVC OR CMAKE_GENERATOR STREQUAL "Xcode") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/ncnn/) From 862bfd71058b9a8291b145a03c6e6b30e7079354 Mon Sep 17 00:00:00 2001 From: nihui Date: Sun, 20 Nov 2022 14:18:33 +0800 Subject: [PATCH 14/19] hack --- python/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 53f8bfc9be3..9be75603795 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -16,9 +16,9 @@ if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "ARM64") " set(PYTHON_PREFIX \"\")\n" ) option(PYBIND11_PYTHONLIBS_OVERWRITE "" OFF) - message(WARNING "VIRTUAL_ENV = $ENV{VIRTUAL_ENV}") - string(REPLACE "nuget-cpython/python." "nuget-cpython/pythonarm64." ARM64_VIRTUAL_ENV "$ENV{VIRTUAL_ENV}") - message(WARNING "ARM64_VIRTUAL_ENV = $ARM64_VIRTUAL_ENV") + message(WARNING "pythonLocation = $ENV{pythonLocation}") + string(REPLACE "nuget-cpython/python." "nuget-cpython/pythonarm64." pythonLocation_arm64 "$ENV{pythonLocation}") + message(WARNING "pythonLocation_arm64 = ${pythonLocation_arm64}") set(PYTHON_PREFIX "C:/Users/runneradmin/AppData/Local/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.3.9.10/tools") endif() From fa9d9a217a9131fa84c888f2676f42ee7abfc1e5 Mon Sep 17 00:00:00 2001 From: nihui Date: Sun, 20 Nov 2022 14:30:20 +0800 Subject: [PATCH 15/19] hack --- python/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 9be75603795..9b7cdc918fe 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -16,9 +16,13 @@ if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "ARM64") " set(PYTHON_PREFIX \"\")\n" ) option(PYBIND11_PYTHONLIBS_OVERWRITE "" OFF) - message(WARNING "pythonLocation = $ENV{pythonLocation}") - string(REPLACE "nuget-cpython/python." "nuget-cpython/pythonarm64." pythonLocation_arm64 "$ENV{pythonLocation}") - message(WARNING "pythonLocation_arm64 = ${pythonLocation_arm64}") + message(WARNING "PYTHON_VERSION = $ENV{PYTHON_VERSION}") + message(WARNING "PYTHON_ARCH = $ENV{PYTHON_ARCH}") + + execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "environment") + + # string(REPLACE "nuget-cpython/python." "nuget-cpython/pythonarm64." pythonLocation_arm64 "$ENV{pythonLocation}") + # message(WARNING "pythonLocation_arm64 = ${pythonLocation_arm64}") set(PYTHON_PREFIX "C:/Users/runneradmin/AppData/Local/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.3.9.10/tools") endif() From e46d6de8d9afabf1742b2fb9e49ef029b95eed5a Mon Sep 17 00:00:00 2001 From: nihui Date: Sun, 20 Nov 2022 14:41:12 +0800 Subject: [PATCH 16/19] ok --- .github/workflows/release-python.yml | 14 +++++++------- python/CMakeLists.txt | 21 ++++++++------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index ae08cfa7543..bd0b7c31f8d 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -38,14 +38,14 @@ jobs: fail-fast: false matrix: include: - # - { os: ubuntu-20.04, arch: x86_64 } - # - { os: ubuntu-20.04, arch: i686 } - # - { os: windows-2019, arch: x86 } - # - { os: windows-2019, arch: AMD64 } + - { os: ubuntu-20.04, arch: x86_64 } + - { os: ubuntu-20.04, arch: i686 } + - { os: windows-2019, arch: x86 } + - { os: windows-2019, arch: AMD64 } - { os: windows-2019, arch: ARM64 } - # - { os: macos-11, arch: x86_64 } - # - { os: macos-11, arch: arm64 } - # - { os: macos-11, arch: universal2 } + - { os: macos-11, arch: x86_64 } + - { os: macos-11, arch: arm64 } + - { os: macos-11, arch: universal2 } steps: - uses: actions/checkout@v3 diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 9b7cdc918fe..999efa1deb6 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -9,21 +9,16 @@ set( CMAKE_CXX_STANDARD 11 ) set( CMAKE_CXX_STANDARD_REQUIRED ON ) if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "ARM64") - message(WARNING - " This is hack for cibuildwheel on github action\n" - " Use the right way to cross-compile python module for windows arm64 like follows\n" - " option(PYBIND11_PYTHONLIBS_OVERWRITE \"\" OFF)\n" - " set(PYTHON_PREFIX \"\")\n" - ) option(PYBIND11_PYTHONLIBS_OVERWRITE "" OFF) - message(WARNING "PYTHON_VERSION = $ENV{PYTHON_VERSION}") - message(WARNING "PYTHON_ARCH = $ENV{PYTHON_ARCH}") - execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "environment") - - # string(REPLACE "nuget-cpython/python." "nuget-cpython/pythonarm64." pythonLocation_arm64 "$ENV{pythonLocation}") - # message(WARNING "pythonLocation_arm64 = ${pythonLocation_arm64}") - set(PYTHON_PREFIX "C:/Users/runneradmin/AppData/Local/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.3.9.10/tools") + set(PYTHON_PREFIX "$ENV{LOCALAPPDATA}/pypa/cibuildwheel/Cache/nuget-cpython/pythonarm64.$ENV{PYTHON_VERSION}/tools") + if(NOT DEFINED $ENV{CIBUILDWHEEL}) + message(WARNING + " This is hack for cibuildwheel on github action\n" + " Use the right way to cross-compile python module for windows arm64 like follows\n" + " set(PYTHON_PREFIX \"\")\n" + ) + endif() endif() add_subdirectory(pybind11) From e473599ead877fe741a6b6e2adc3535d78501826 Mon Sep 17 00:00:00 2001 From: nihui Date: Sun, 20 Nov 2022 16:04:31 +0800 Subject: [PATCH 17/19] wip --- .github/workflows/release-python.yml | 42 +++++++++++++++------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index bd0b7c31f8d..d6dc7f7d424 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -32,20 +32,24 @@ jobs: path: dist/*.tar.gz build_wheels: - name: Build wheels ${{ matrix.arch }} on ${{ matrix.os }} + name: ${{ matrix.arch }} ${{ matrix.build }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - - { os: ubuntu-20.04, arch: x86_64 } - - { os: ubuntu-20.04, arch: i686 } - - { os: windows-2019, arch: x86 } - - { os: windows-2019, arch: AMD64 } - - { os: windows-2019, arch: ARM64 } - - { os: macos-11, arch: x86_64 } - - { os: macos-11, arch: arm64 } - - { os: macos-11, arch: universal2 } + - { os: ubuntu-20.04, arch: x86_64, build: 'cp*' } + - { os: ubuntu-20.04, arch: x86_64, build: 'pp*' } + - { os: ubuntu-20.04, arch: i686, build: 'cp*' } + - { os: ubuntu-20.04, arch: i686, build: 'pp*' } + - { os: windows-2019, arch: x86, build: 'cp*' } + - { os: windows-2019, arch: AMD64, build: 'cp*' } + - { os: windows-2019, arch: AMD64, build: 'pp*' } + - { os: windows-2019, arch: ARM64, build: 'cp*' } + - { os: macos-11, arch: x86_64, build: 'cp*' } + - { os: macos-11, arch: x86_64, build: 'pp*' } + - { os: macos-11, arch: arm64, build: 'cp*' } + - { os: macos-11, arch: universal2, build: 'cp*' } steps: - uses: actions/checkout@v3 @@ -67,6 +71,7 @@ jobs: CIBW_ARCHS_MACOS: ${{ matrix.arch }} CIBW_ARCHS_LINUX: ${{ matrix.arch }} CIBW_ARCHS_WINDOWS: ${{ matrix.arch }} + CIBW_BUILD: ${{ matrix.build }} CIBW_BUILD_VERBOSITY: 1 CIBW_ENVIRONMENT: CMAKE_BUILD_PARALLEL_LEVEL=2 @@ -84,22 +89,21 @@ jobs: path: wheelhouse/*.whl build_wheels_qemu: - name: Build wheels ${{ matrix.arch }} ${{ matrix.build }} + name: ${{ matrix.arch }} ${{ matrix.build }} runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: arch: [aarch64, ppc64le, s390x] - build: ["cp311-*"] - # build: ["cp36-*", "cp37-*", "cp38-*", "cp39-*", "cp310-*", "cp311-*"] - # include: - # - arch: aarch64 - # build: "pp37-*" - # - arch: aarch64 - # build: "pp38-*" - # - arch: aarch64 - # build: "pp39-*" + build: ['cp36-*', 'cp37-*', 'cp38-*', 'cp39-*', 'cp310-*', 'cp311-*'] + include: + - arch: aarch64 + build: 'pp37-*' + - arch: aarch64 + build: 'pp38-*' + - arch: aarch64 + build: 'pp39-*' steps: - uses: actions/checkout@v3 From f1a2a1132e3c13d368a40bc468b26c0dafee2175 Mon Sep 17 00:00:00 2001 From: nihui Date: Sun, 20 Nov 2022 16:54:31 +0800 Subject: [PATCH 18/19] wip --- .github/workflows/release-python.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index d6dc7f7d424..60831986565 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -38,18 +38,20 @@ jobs: fail-fast: false matrix: include: - - { os: ubuntu-20.04, arch: x86_64, build: 'cp*' } - - { os: ubuntu-20.04, arch: x86_64, build: 'pp*' } - - { os: ubuntu-20.04, arch: i686, build: 'cp*' } - - { os: ubuntu-20.04, arch: i686, build: 'pp*' } - - { os: windows-2019, arch: x86, build: 'cp*' } - - { os: windows-2019, arch: AMD64, build: 'cp*' } - - { os: windows-2019, arch: AMD64, build: 'pp*' } - - { os: windows-2019, arch: ARM64, build: 'cp*' } - - { os: macos-11, arch: x86_64, build: 'cp*' } - - { os: macos-11, arch: x86_64, build: 'pp*' } - - { os: macos-11, arch: arm64, build: 'cp*' } - - { os: macos-11, arch: universal2, build: 'cp*' } + - { os: ubuntu-20.04, arch: x86_64, build: 'cp*-manylinux*' } + - { os: ubuntu-20.04, arch: x86_64, build: 'cp*-musllinux*' } + - { os: ubuntu-20.04, arch: x86_64, build: 'pp*' } + - { os: ubuntu-20.04, arch: i686, build: 'cp*-manylinux*' } + - { os: ubuntu-20.04, arch: i686, build: 'cp*-musllinux*' } + - { os: ubuntu-20.04, arch: i686, build: 'pp*' } + - { os: windows-2019, arch: x86, build: 'cp*' } + - { os: windows-2019, arch: AMD64, build: 'cp*' } + - { os: windows-2019, arch: AMD64, build: 'pp*' } + - { os: windows-2019, arch: ARM64, build: 'cp*' } + - { os: macos-11, arch: x86_64, build: 'cp*' } + - { os: macos-11, arch: x86_64, build: 'pp*' } + - { os: macos-11, arch: arm64, build: 'cp*' } + - { os: macos-11, arch: universal2, build: 'cp*' } steps: - uses: actions/checkout@v3 From 9f53bd6923a91b76424b286633df7d41f19882a0 Mon Sep 17 00:00:00 2001 From: nihui Date: Sun, 20 Nov 2022 19:03:11 +0800 Subject: [PATCH 19/19] done --- .github/workflows/release-python.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 60831986565..6529c24ef4f 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -1,9 +1,9 @@ name: release-python -on: [push, pull_request] -# on: -# push: -# tags: -# - '*' +# on: [push, pull_request] +on: + push: + tags: + - '*' jobs: build_sdist: