From 73c75a8f4484c622c7a60ccbc113d6056830722e Mon Sep 17 00:00:00 2001 From: Philippe Verney Date: Mon, 25 Nov 2024 10:36:35 +0100 Subject: [PATCH] Generate Windows wheels --- .github/workflows/github-actions.yml | 34 ++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 57a2449c..f7eabdf4 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -166,6 +166,40 @@ jobs: with: name: ubuntu-20.04-${{ matrix.cxx }} path: ${{ runner.temp }}/fesapi-install + build_wheels_windows: + name: Build wheels on windows-latest + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Stub `setup.py` check + # It will be generated during CMake run + # https://github.com/pypa/cibuildwheel/issues/1139 + run: touch python/setup.py + - name: Build wheels + uses: pypa/cibuildwheel@v2.21.3 + env: + CIBW_BUILD: cp38-win_amd64 cp39-win_amd64 cp310-win_amd64 cp311-win_amd64 cp312-win_amd64 cp313-win_amd64 + CIBW_ARCHS: auto64 + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 + CIBW_BEFORE_ALL: > + %VCPKG_INSTALLATION_ROOT%\vcpkg install boost-uuid minizip hdf5[zlib] && + cd ${{ runner.temp }} && + mkdir fesapi-build && + cd fesapi-build && + cmake -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%\scripts\buildsystems\vcpkg.cmake -G"Visual Studio 17 2022" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DWITH_PYTHON_WRAPPING=TRUE -DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/fesapi-install ${{ github.workspace }} && + cmake --build . --config Release -j2 && + cmake --build . --config Release --target INSTALL && + pip install delvewheel + CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: > + delvewheel repair -vv --add-path ${{ runner.temp }}\fesapi-build\Release --namespace-pkg fesapi -w {dest_dir} {wheel} + CIBW_TEST_COMMAND: python ${{github.workspace}}\python\example\example.py + with: + package-dir: ./python + output-dir: wheelhouse + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-windows + path: ./wheelhouse/*.whl build_wheels_linux: name: Build wheels on ubuntu-latest runs-on: ubuntu-latest diff --git a/README.md b/README.md index 8ff42b53..3e85e8e6 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Download (build and install if necessary) third party libraries: - HDF5: Versions of 1.8.* (starting from 1.8.18), 1.10.* ([starting from 1.10.2](https://www.hdfgroup.org/2018/04/why-should-i-care-about-the-hdf5-1-10-2-release/)), all 1.12.* and all 1.14.* should be ok. https://support.hdfgroup.org/ftp/HDF5/releases/ - MINIZIP : Version 1.1 is needed : it is the official version included in [current zlib distribution](https://www.zlib.net/) (look into "contrib" folder). You can directly install minizip development package on most of Linux distributions (https://packages.ubuntu.com/xenial/libminizip-dev). On Windows (or older Linux distributions), you can copy the CMakeLists.txt file from fesapi/cmake/minizip to the zlib minizip directory to help you to build minizip (we also provide a copy of minizip 1.1 with cmake files on github : https://github.com/F2I-Consulting/Minizip). It is also highly recommended to link minizip to the same zlib library than the one associated to your HDF5 library. -- BOOST : Starting from version 1.44.0 (and at least 1.67.0 if you don't want to face [valgrid false positives](https://www.boost.org/doc/libs/1_66_0/libs/uuid/doc/uuid.html#Design%20notes)). FYI, on windows, boost uuid depends on bcrypt library. +- BOOST (uuid) : Starting from version 1.44.0 (and at least 1.67.0 if you don't want to face [valgrid false positives](https://www.boost.org/doc/libs/1_66_0/libs/uuid/doc/uuid.html#Design%20notes)). FYI, on windows, boost uuid depends on bcrypt library. We advise you to install these third party libraries respectively into - fesapiEnv/dependencies/hdf5-particularVersion