diff --git a/.github/workflows/basemap-for-windows.yml b/.github/workflows/basemap-for-windows.yml index 3a86895a3..f00b86c69 100644 --- a/.github/workflows/basemap-for-windows.yml +++ b/.github/workflows/basemap-for-windows.yml @@ -93,6 +93,11 @@ jobs: ["x64", "x86"] msvc-toolset: ["9.0", "14.0"] + include: + - msvc-toolset: "9.0" + python-version: "2.7" + - msvc-toolset: "14.0" + python-version: "3.5" max-parallel: 4 fail-fast: false needs: lint @@ -106,26 +111,26 @@ jobs: path: . - name: Set MSVC toolset - uses: pylegacy/actions/setup-msvc@v1 + uses: pylegacy/actions/setup-msvc@v2 with: - architecture: ${{ matrix.arch }} - version: ${{ matrix.msvc-toolset }} + arch: ${{ matrix.arch }} + toolset: ${{ matrix.msvc-toolset }} - name: Set CMake uses: jwlawson/actions-setup-cmake@v1.13 with: - cmake-version: "3.14.7" + cmake-version: "3.24.2" - name: Set Python uses: actions/setup-python@v4 with: architecture: ${{ matrix.arch }} - python-version: "3.6" + python-version: ${{ matrix.python-version }} - name: Build GEOS from source run: | cd ${{ env.PKGDIR }} - python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', njobs=16)" + python -c "import utils; utils.GeosLibrary('3.6.5').build('extern', toolset='${{ matrix.msvc-toolset }}', njobs=16)" - name: Upload GEOS artifacts uses: actions/upload-artifact@v1 @@ -151,20 +156,6 @@ jobs: with: name: checkout path: . - - - name: Set MSVC toolset version - run: | - if ("${{ matrix.python-version }}" -eq "2.7") { - echo "msvc-toolset=9.0" >> $env:GITHUB_ENV - } else { - echo "msvc-toolset=14.0" >> $env:GITHUB_ENV - } - - - name: Set MSVC toolset - uses: pylegacy/actions/setup-msvc@v1 - with: - architecture: ${{ matrix.arch }} - version: ${{ env.msvc-toolset }} - name: Set Python uses: actions/setup-python@v4 @@ -186,6 +177,20 @@ jobs: } $env:SETUPTOOLS_USE_DISTUTILS = "stdlib" python -m pip install "numpy == ${pkgvers}" + - + name: Set MSVC toolset version + run: | + if ("${{ matrix.python-version }}" -eq "2.7") { + echo "msvc-toolset=9.0" >> $env:GITHUB_ENV + } else { + echo "msvc-toolset=14.0" >> $env:GITHUB_ENV + } + - + name: Set MSVC toolset + uses: pylegacy/actions/setup-msvc@v2 + with: + arch: ${{ matrix.arch }} + toolset: ${{ env.msvc-toolset }} - name: Download GEOS artifacts uses: actions/download-artifact@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 45208d1e4..c1c493118 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,10 @@ https://semver.org/spec/v2.0.0.html ### Changed - Upgrade bundled GEOS library to 3.6.5. +### Fixed +- Set MSVC 14.0 (VS2015) to build the `_geoslib` module in the + precompiled Windows wheels (PR [#565]). + ## [1.3.6] - 2022-10-31 ### Added @@ -32,8 +36,8 @@ https://semver.org/spec/v2.0.0.html - Upgrade `pyproj` upper pin to 3.5. ### Fixed -- Set MSVC 14.0 (VS2015) to build the precompiled Windows wheels in - GitHub workflows (PR [#564]). +- Set MSVC 14.0 (VS2015) to build the GEOS library bundled in the + precompiled Windows wheels (PR [#564]). ## [1.3.5] - 2022-10-25 @@ -959,6 +963,8 @@ https://semver.org/spec/v2.0.0.html - Fix glitches in drawing of parallels and meridians. +[#565]: +https://github.com/matplotlib/basemap/pull/565 [#564]: https://github.com/matplotlib/basemap/pull/564 [#563]: diff --git a/packages/basemap/utils/GeosLibrary.py b/packages/basemap/utils/GeosLibrary.py index abbb839c7..0aec77016 100644 --- a/packages/basemap/utils/GeosLibrary.py +++ b/packages/basemap/utils/GeosLibrary.py @@ -242,13 +242,18 @@ def build(self, installdir=None, toolset=None, njobs=1): # Define custom configure and build options. if os.name == "nt": - config_opts += ["-DCMAKE_CXX_FLAGS='/wd4251 /wd4458 /wd4530 /EHsc'"] + win64 = (8 * struct.calcsize("P") == 64) + config_opts += ["-DCMAKE_CXX_FLAGS='/wd4251 /wd4355 /wd4458 /wd4530 /EHsc'"] if version >= (3, 6, 0) and sys.version_info[:2] >= (3, 3): + config_opts = ["-A", "x64" if win64 else "Win32"] + config_opts if toolset is not None: - config_opts += ["-DCMAKE_GENERATOR_TOOLSET={0}".format(toolset)] + try: + msvc = "v{0:d}".format(int(float(toolset) * 10)) + except (TypeError, ValueError): + msvc = toolset + config_opts += ["-DCMAKE_GENERATOR_TOOLSET={0}".format(msvc)] build_opts = ["-j", "{0:d}".format(njobs)] + build_opts else: - win64 = (8 * struct.calcsize("P") == 64) config_opts = ["-G", "NMake Makefiles"] + config_opts build_opts.extend([ "--",