From 87f45fbd7b9c2d01fd75ac78e3b4917269fc4010 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 18 May 2026 00:15:16 +0100 Subject: [PATCH 01/17] fix windows arm build --- .github/workflows/build.yml | 80 +++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7848e9b..bf098af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -432,34 +432,62 @@ jobs: Remove-Item Env:CMAKE_GENERATOR_PLATFORM -ErrorAction SilentlyContinue Remove-Item Env:CMAKE_ARGS -ErrorAction SilentlyContinue - if (-not (Get-Command gfortran.exe -ErrorAction SilentlyContinue)) { - Write-Host "gfortran not found on PATH, installing MinGW fallback" - choco install mingw -y --no-progress + if ("${{ matrix.arch }}" -eq "arm64") { + # On arm64 Windows, the x86_64 MinGW at C:/mingw64 runs under emulation + # but produces x86_64 binaries, which would mismatch the arm64 wheel tag. + # Use the MSYS2 clangarm64 toolchain which includes native arm64 flang. + $msys2Arm64Bin = "C:\msys64\clangarm64\bin" + $msys2Usr = "C:\msys64\usr\bin" + + if (-not (Test-Path "$msys2Arm64Bin\flang.exe")) { + Write-Host "Installing MSYS2 clangarm64 Fortran toolchain" + & "$msys2Usr\pacman.exe" -S --noconfirm --needed ` + mingw-w64-clang-aarch64-toolchain ` + mingw-w64-clang-aarch64-flang + } + + "$msys2Arm64Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + $env:Path = "$msys2Arm64Bin;$msys2Usr;$env:Path" + + $env:CC = "clang" + $env:CXX = "clang++" + $env:FC = "flang" + + if (-not (Get-Command clang.exe -ErrorAction SilentlyContinue)) { throw "clang not found" } + if (-not (Get-Command flang.exe -ErrorAction SilentlyContinue)) { throw "flang not found" } + if (-not (Get-Command ninja.exe -ErrorAction SilentlyContinue)) { throw "ninja not found" } + } else { + # x64: prefer any pre-installed gfortran; fall back to Chocolatey MinGW. + if (-not (Get-Command gfortran.exe -ErrorAction SilentlyContinue)) { + Write-Host "gfortran not found on PATH, installing MinGW fallback" + choco install mingw -y --no-progress + } + + if (-not (Get-Command ninja.exe -ErrorAction SilentlyContinue)) { + Write-Host "ninja not found on PATH, installing Ninja" + choco install ninja -y --no-progress + } + + $mingwBinCandidates = @( + "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin", + "C:\tools\mingw64\bin", + "C:\mingw64\bin" + ) + $mingwBin = $mingwBinCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1 + if ($mingwBin) { + "$mingwBin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + $env:Path = "$mingwBin;$env:Path" + } + + $env:CC = "gcc" + $env:CXX = "g++" + $env:FC = "gfortran" + + if (-not (Get-Command gcc.exe -ErrorAction SilentlyContinue)) { throw "gcc not found" } + if (-not (Get-Command gfortran.exe -ErrorAction SilentlyContinue)) { throw "gfortran not found" } + if (-not (Get-Command ninja.exe -ErrorAction SilentlyContinue)) { throw "ninja not found" } } - if (-not (Get-Command ninja.exe -ErrorAction SilentlyContinue)) { - Write-Host "ninja not found on PATH, installing Ninja" - choco install ninja -y --no-progress - } - - $mingwBinCandidates = @( - "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin", - "C:\tools\mingw64\bin" - ) - $mingwBin = $mingwBinCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1 - if ($mingwBin) { - "$mingwBin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - $env:Path = "$mingwBin;$env:Path" - } - - $env:CC = "gcc" - $env:CXX = "g++" - $env:FC = "gfortran" - - if (-not (Get-Command gcc.exe -ErrorAction SilentlyContinue)) { throw "gcc not found" } - if (-not (Get-Command gfortran.exe -ErrorAction SilentlyContinue)) { throw "gfortran not found" } - if (-not (Get-Command ninja.exe -ErrorAction SilentlyContinue)) { throw "ninja not found" } - & $pythonExe -m build --wheel -o dist - name: Install wheel From 150b30d72f2f8cb55e7c478643a6b5901a77f1ff Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 18 May 2026 00:18:24 +0100 Subject: [PATCH 02/17] try msys2 on arm --- .github/workflows/build.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf098af..98bf2ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -421,6 +421,16 @@ jobs: run: | python -m venv env + - name: Set up MSYS2 clangarm64 toolchain (arm64 only) + if: matrix.arch == 'arm64' + uses: msys2/setup-msys2@e9898307ac31d1a803454791be09ab9973336e1c # v2.31.1 + with: + msystem: CLANGARM64 + install: >- + mingw-w64-clang-aarch64-toolchain + mingw-w64-clang-aarch64-flang + update: false + - name: Build wheel shell: pwsh run: | @@ -433,21 +443,12 @@ jobs: Remove-Item Env:CMAKE_ARGS -ErrorAction SilentlyContinue if ("${{ matrix.arch }}" -eq "arm64") { - # On arm64 Windows, the x86_64 MinGW at C:/mingw64 runs under emulation - # but produces x86_64 binaries, which would mismatch the arm64 wheel tag. - # Use the MSYS2 clangarm64 toolchain which includes native arm64 flang. + # The msys2/setup-msys2 action above installed the clangarm64 toolchain. + # Add its bin dir to PATH so cmake finds clang/flang/ninja. $msys2Arm64Bin = "C:\msys64\clangarm64\bin" - $msys2Usr = "C:\msys64\usr\bin" - - if (-not (Test-Path "$msys2Arm64Bin\flang.exe")) { - Write-Host "Installing MSYS2 clangarm64 Fortran toolchain" - & "$msys2Usr\pacman.exe" -S --noconfirm --needed ` - mingw-w64-clang-aarch64-toolchain ` - mingw-w64-clang-aarch64-flang - } "$msys2Arm64Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - $env:Path = "$msys2Arm64Bin;$msys2Usr;$env:Path" + $env:Path = "$msys2Arm64Bin;$env:Path" $env:CC = "clang" $env:CXX = "clang++" From 890d656c29d06d16823705cd2f424ff412889af6 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 18 May 2026 00:27:00 +0100 Subject: [PATCH 03/17] cache the msys step --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98bf2ed..9c7813f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -430,6 +430,7 @@ jobs: mingw-w64-clang-aarch64-toolchain mingw-w64-clang-aarch64-flang update: false + cache: true - name: Build wheel shell: pwsh From ce9f28c0fd14aaf7f223a71a4aeb504d24428ba3 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 18 May 2026 00:30:16 +0100 Subject: [PATCH 04/17] drop msys --- .github/workflows/build.yml | 45 ++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c7813f..f66f2ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -421,17 +421,6 @@ jobs: run: | python -m venv env - - name: Set up MSYS2 clangarm64 toolchain (arm64 only) - if: matrix.arch == 'arm64' - uses: msys2/setup-msys2@e9898307ac31d1a803454791be09ab9973336e1c # v2.31.1 - with: - msystem: CLANGARM64 - install: >- - mingw-w64-clang-aarch64-toolchain - mingw-w64-clang-aarch64-flang - update: false - cache: true - - name: Build wheel shell: pwsh run: | @@ -444,20 +433,36 @@ jobs: Remove-Item Env:CMAKE_ARGS -ErrorAction SilentlyContinue if ("${{ matrix.arch }}" -eq "arm64") { - # The msys2/setup-msys2 action above installed the clangarm64 toolchain. - # Add its bin dir to PATH so cmake finds clang/flang/ninja. - $msys2Arm64Bin = "C:\msys64\clangarm64\bin" - - "$msys2Arm64Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - $env:Path = "$msys2Arm64Bin;$env:Path" + # The arm64 runner ships with arm64-native LLVM (clang/flang) at + # C:\Program Files\LLVM. We just need VsDevCmd to put mt.exe and + # the Windows SDK linker libraries on PATH so flang can link. + $vswhere = Join-Path ${env:ProgramFiles(x86)} "Microsoft Visual Studio\Installer\vswhere.exe" + if (-not (Test-Path $vswhere)) { throw "vswhere.exe not found" } + $vsInstallPath = & $vswhere -latest -products * ` + -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ` + -property installationPath + if (-not $vsInstallPath) { throw "Could not locate a Visual Studio installation" } + $vsDevCmd = Join-Path $vsInstallPath "Common7\Tools\VsDevCmd.bat" + if (-not (Test-Path $vsDevCmd)) { throw "VsDevCmd.bat not found" } + + $envDump = & cmd.exe /s /c "`"$vsDevCmd`" -no_logo -host_arch=arm64 -arch=arm64 && set" + foreach ($line in $envDump) { + if ($line -match '^(.*?)=(.*)$') { + Set-Item -Path ("Env:" + $matches[1]) -Value $matches[2] + } + } + # Use the pre-installed arm64 LLVM toolchain (clang + flang) with Ninja. + # VsDevCmd may have set a VS generator; override back to Ninja. + $env:CMAKE_GENERATOR = "Ninja" + Remove-Item Env:CMAKE_GENERATOR_PLATFORM -ErrorAction SilentlyContinue $env:CC = "clang" $env:CXX = "clang++" $env:FC = "flang" - if (-not (Get-Command clang.exe -ErrorAction SilentlyContinue)) { throw "clang not found" } - if (-not (Get-Command flang.exe -ErrorAction SilentlyContinue)) { throw "flang not found" } - if (-not (Get-Command ninja.exe -ErrorAction SilentlyContinue)) { throw "ninja not found" } + if (-not (Get-Command clang.exe -ErrorAction SilentlyContinue)) { throw "clang not found" } + if (-not (Get-Command flang.exe -ErrorAction SilentlyContinue)) { throw "flang not found" } + if (-not (Get-Command ninja.exe -ErrorAction SilentlyContinue)) { throw "ninja not found" } } else { # x64: prefer any pre-installed gfortran; fall back to Chocolatey MinGW. if (-not (Get-Command gfortran.exe -ErrorAction SilentlyContinue)) { From 8d952ef296de0979ddd8d62c13256d87c5f6180d Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 18 May 2026 00:38:36 +0100 Subject: [PATCH 05/17] update submodule --- PyGeopack/__data/geopack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyGeopack/__data/geopack b/PyGeopack/__data/geopack index 4c54686..99f7969 160000 --- a/PyGeopack/__data/geopack +++ b/PyGeopack/__data/geopack @@ -1 +1 @@ -Subproject commit 4c546866232e60776bc8d7adbda514ef301df209 +Subproject commit 99f79696712ca713bdaa76e2f32708c0a0d126d1 From fc54046df269493daa10d7b6bd547c9522650107 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 18 May 2026 00:45:17 +0100 Subject: [PATCH 06/17] update submodule --- PyGeopack/__data/geopack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyGeopack/__data/geopack b/PyGeopack/__data/geopack index 99f7969..4ae6058 160000 --- a/PyGeopack/__data/geopack +++ b/PyGeopack/__data/geopack @@ -1 +1 @@ -Subproject commit 99f79696712ca713bdaa76e2f32708c0a0d126d1 +Subproject commit 4ae6058c9fdd36e62fcedd439f45451c2d235b96 From f4eaff7122af2b468e03ecf41c5c4438b82b228a Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 18 May 2026 00:53:34 +0100 Subject: [PATCH 07/17] update submodule --- PyGeopack/__data/geopack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyGeopack/__data/geopack b/PyGeopack/__data/geopack index 4ae6058..a50d48b 160000 --- a/PyGeopack/__data/geopack +++ b/PyGeopack/__data/geopack @@ -1 +1 @@ -Subproject commit 4ae6058c9fdd36e62fcedd439f45451c2d235b96 +Subproject commit a50d48b51443198471070800ed0c8e70c8994ec2 From b781abce37e7ad5f77f6ed1cc53920626042ab66 Mon Sep 17 00:00:00 2001 From: matt Date: Mon, 18 May 2026 00:59:14 +0100 Subject: [PATCH 08/17] another attempt --- .github/workflows/build.yml | 55 +++++++++++++++++++++++++++++++++---- CMakeLists.txt | 3 ++ 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f66f2ad..ac6c82e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -456,12 +456,31 @@ jobs: # VsDevCmd may have set a VS generator; override back to Ninja. $env:CMAKE_GENERATOR = "Ninja" Remove-Item Env:CMAKE_GENERATOR_PLATFORM -ErrorAction SilentlyContinue - $env:CC = "clang" - $env:CXX = "clang++" - $env:FC = "flang" + $llvmArm64Bin = Join-Path $vsInstallPath "VC\Tools\Llvm\ARM64\bin" + if (-not (Test-Path "$llvmArm64Bin\clang.exe")) { throw "ARM64 clang not found at $llvmArm64Bin" } + + if (Test-Path "$llvmArm64Bin\flang.exe") { + $fortranCompiler = Join-Path $llvmArm64Bin "flang.exe" + } elseif (Test-Path "C:\Program Files\LLVM\bin\flang.exe") { + # Fallback to standalone LLVM flang and force an ARM64 target triple. + $fortranCompiler = "C:\Program Files\LLVM\bin\flang.exe" + $env:FFLAGS = "--target=aarch64-pc-windows-msvc" + } else { + throw "No flang.exe found for Windows arm64 build" + } + + "$llvmArm64Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + $env:Path = "$llvmArm64Bin;$env:Path" + + $env:CC = (Join-Path $llvmArm64Bin "clang.exe") + $env:CXX = (Join-Path $llvmArm64Bin "clang++.exe") + $env:FC = $fortranCompiler + + # Disable OpenMP on Windows arm64 to avoid wrong-arch libomp runtime issues. + $env:CMAKE_ARGS = "-DPYGEOPACK_GEOPACK_USE_OPENMP=OFF" - if (-not (Get-Command clang.exe -ErrorAction SilentlyContinue)) { throw "clang not found" } - if (-not (Get-Command flang.exe -ErrorAction SilentlyContinue)) { throw "flang not found" } + if (-not (Get-Command $env:CC -ErrorAction SilentlyContinue)) { throw "clang not found" } + if (-not (Get-Command $env:FC -ErrorAction SilentlyContinue)) { throw "flang not found" } if (-not (Get-Command ninja.exe -ErrorAction SilentlyContinue)) { throw "ninja not found" } } else { # x64: prefer any pre-installed gfortran; fall back to Chocolatey MinGW. @@ -497,6 +516,32 @@ jobs: & $pythonExe -m build --wheel -o dist + - name: Verify DLL machine type (arm64) + if: matrix.arch == 'arm64' + shell: pwsh + run: | + .\env\Scripts\Activate.ps1 + $wheel = Get-ChildItem -Path dist -Filter *.whl | Select-Object -First 1 + if (-not $wheel) { throw "No wheel found in dist/" } + $tmp = Join-Path $env:RUNNER_TEMP "wheel_unpack" + if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse -Force } + New-Item -ItemType Directory -Path $tmp | Out-Null + python -m zipfile -e $wheel.FullName $tmp + $dll = Get-ChildItem -Path $tmp -Recurse -Filter libgeopack.dll | Select-Object -First 1 + if (-not $dll) { throw "libgeopack.dll not found inside wheel" } + + $dumpbin = Join-Path $env:VCToolsInstallDir "bin\HostARM64\arm64\dumpbin.exe" + if (-not (Test-Path $dumpbin)) { + $dumpbin = Join-Path $env:VCToolsInstallDir "bin\Hostx64\arm64\dumpbin.exe" + } + if (-not (Test-Path $dumpbin)) { throw "dumpbin.exe not found" } + + $headers = & $dumpbin /headers $dll.FullName + $headers | Out-String | Write-Host + if (-not ($headers -match "machine \(ARM64\)")) { + throw "libgeopack.dll is not ARM64" + } + - name: Install wheel shell: pwsh run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 2173afb..c922e6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,9 +19,12 @@ elseif(UNIX) set(_pygeopack_library_glob "*.so*") endif() +option(PYGEOPACK_GEOPACK_USE_OPENMP "Enable OpenMP in geopack dependency" ON) + set(_pygeopack_cmake_args -DGEOPACK_BUILD_TESTS=OFF -DGEOPACK_BUILD_SHARED=ON + -DGEOPACK_USE_OPENMP=${PYGEOPACK_GEOPACK_USE_OPENMP} -DCMAKE_BUILD_TYPE=Release ) From ec968766fc260138dfc795b84ca5b375aba7ca35 Mon Sep 17 00:00:00 2001 From: Matt James Date: Mon, 18 May 2026 19:24:58 +0100 Subject: [PATCH 09/17] ubmodule fixes --- PyGeopack/__data/geopack | 2 +- pyproject.toml | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/PyGeopack/__data/geopack b/PyGeopack/__data/geopack index a50d48b..552fbc6 160000 --- a/PyGeopack/__data/geopack +++ b/PyGeopack/__data/geopack @@ -1 +1 @@ -Subproject commit a50d48b51443198471070800ed0c8e70c8994ec2 +Subproject commit 552fbc6f46354605e2d9081c9b14d094c46c16e5 diff --git a/pyproject.toml b/pyproject.toml index 3b79a35..d8ac965 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,10 +33,6 @@ wheel.packages = ["PyGeopack"] wheel.install-dir = "PyGeopack/__data/geopack/lib" install.components = ["python"] -[tool.scikit-build.cmake.define] -GEOPACK_BUILD_TESTS = false -GEOPACK_BUILD_SHARED = true - [tool.scikit-build.metadata.version] provider = "scikit_build_core.metadata.regex" -input = "PyGeopack/__init__.py" \ No newline at end of file +input = "PyGeopack/__init__.py" From de56c6ec16de7dd63d046fdfe8216594f809a403 Mon Sep 17 00:00:00 2001 From: Matt James Date: Mon, 18 May 2026 19:32:18 +0100 Subject: [PATCH 10/17] update workflow --- .github/workflows/build.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac6c82e..0190b97 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -452,12 +452,13 @@ jobs: } } - # Use the pre-installed arm64 LLVM toolchain (clang + flang) with Ninja. + # Use the pre-installed arm64 LLVM toolchain with Ninja. The clang-cl + # driver matches the MSVC-style flags emitted by dependency CMake files. # VsDevCmd may have set a VS generator; override back to Ninja. $env:CMAKE_GENERATOR = "Ninja" Remove-Item Env:CMAKE_GENERATOR_PLATFORM -ErrorAction SilentlyContinue $llvmArm64Bin = Join-Path $vsInstallPath "VC\Tools\Llvm\ARM64\bin" - if (-not (Test-Path "$llvmArm64Bin\clang.exe")) { throw "ARM64 clang not found at $llvmArm64Bin" } + if (-not (Test-Path "$llvmArm64Bin\clang-cl.exe")) { throw "ARM64 clang-cl not found at $llvmArm64Bin" } if (Test-Path "$llvmArm64Bin\flang.exe") { $fortranCompiler = Join-Path $llvmArm64Bin "flang.exe" @@ -472,14 +473,14 @@ jobs: "$llvmArm64Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append $env:Path = "$llvmArm64Bin;$env:Path" - $env:CC = (Join-Path $llvmArm64Bin "clang.exe") - $env:CXX = (Join-Path $llvmArm64Bin "clang++.exe") + $env:CC = (Join-Path $llvmArm64Bin "clang-cl.exe") + $env:CXX = (Join-Path $llvmArm64Bin "clang-cl.exe") $env:FC = $fortranCompiler # Disable OpenMP on Windows arm64 to avoid wrong-arch libomp runtime issues. $env:CMAKE_ARGS = "-DPYGEOPACK_GEOPACK_USE_OPENMP=OFF" - if (-not (Get-Command $env:CC -ErrorAction SilentlyContinue)) { throw "clang not found" } + if (-not (Get-Command $env:CC -ErrorAction SilentlyContinue)) { throw "clang-cl not found" } if (-not (Get-Command $env:FC -ErrorAction SilentlyContinue)) { throw "flang not found" } if (-not (Get-Command ninja.exe -ErrorAction SilentlyContinue)) { throw "ninja not found" } } else { From 414de8ee4cb94e7acda9ad8fac3c9317b0d8c213 Mon Sep 17 00:00:00 2001 From: Matt James Date: Mon, 18 May 2026 19:39:08 +0100 Subject: [PATCH 11/17] update submodule --- PyGeopack/__data/geopack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyGeopack/__data/geopack b/PyGeopack/__data/geopack index 552fbc6..7161e99 160000 --- a/PyGeopack/__data/geopack +++ b/PyGeopack/__data/geopack @@ -1 +1 @@ -Subproject commit 552fbc6f46354605e2d9081c9b14d094c46c16e5 +Subproject commit 7161e99f4348a61bd96c8f42286e651acdb96dad From 07cb143adb9c5bb1633077b6d5bb3222b6c0a181 Mon Sep 17 00:00:00 2001 From: Matt James Date: Mon, 18 May 2026 19:49:01 +0100 Subject: [PATCH 12/17] update dll check --- .github/workflows/build.yml | 6 +++--- PyGeopack/_CheckFirstImport.py | 15 +++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0190b97..e573698 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -528,8 +528,8 @@ jobs: if (Test-Path $tmp) { Remove-Item -Path $tmp -Recurse -Force } New-Item -ItemType Directory -Path $tmp | Out-Null python -m zipfile -e $wheel.FullName $tmp - $dll = Get-ChildItem -Path $tmp -Recurse -Filter libgeopack.dll | Select-Object -First 1 - if (-not $dll) { throw "libgeopack.dll not found inside wheel" } + $dll = Get-ChildItem -Path $tmp -Recurse -Filter geopack.dll | Select-Object -First 1 + if (-not $dll) { throw "geopack.dll not found inside wheel" } $dumpbin = Join-Path $env:VCToolsInstallDir "bin\HostARM64\arm64\dumpbin.exe" if (-not (Test-Path $dumpbin)) { @@ -540,7 +540,7 @@ jobs: $headers = & $dumpbin /headers $dll.FullName $headers | Out-String | Write-Host if (-not ($headers -match "machine \(ARM64\)")) { - throw "libgeopack.dll is not ARM64" + throw "geopack.dll is not ARM64" } - name: Install wheel diff --git a/PyGeopack/_CheckFirstImport.py b/PyGeopack/_CheckFirstImport.py index e6f7168..efb0fa5 100644 --- a/PyGeopack/_CheckFirstImport.py +++ b/PyGeopack/_CheckFirstImport.py @@ -22,21 +22,24 @@ def getLibFilename(isShort=False): Filename of the source library """ - if(isShort): - libFilename = "libgeopack." - else: - libFilename = os.path.dirname(__file__) + "/__data/geopack/lib/libgeopack." - systype = platform.system() if systype == 'Linux': + libName = "libgeopack" extension = "so" elif systype == 'Windows': + libName = "geopack" extension = "dll" elif systype == 'Darwin': + libName = "libgeopack" extension = 'dylib' else: raise Exception("The Operating System is not supported") - + + if(isShort): + libFilename = libName + "." + else: + libFilename = os.path.dirname(__file__) + "/__data/geopack/lib/" + libName + "." + return libFilename + extension From ef00b7420995e0efcce8acef7b45cde3ec58c208 Mon Sep 17 00:00:00 2001 From: Matt James Date: Mon, 18 May 2026 19:52:54 +0100 Subject: [PATCH 13/17] fix workflow --- .github/workflows/build.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e573698..8bf3e66 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -451,6 +451,9 @@ jobs: Set-Item -Path ("Env:" + $matches[1]) -Value $matches[2] } } + if ($env:VCToolsInstallDir) { + "VCToolsInstallDir=$env:VCToolsInstallDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + } # Use the pre-installed arm64 LLVM toolchain with Ninja. The clang-cl # driver matches the MSVC-style flags emitted by dependency CMake files. @@ -531,9 +534,24 @@ jobs: $dll = Get-ChildItem -Path $tmp -Recurse -Filter geopack.dll | Select-Object -First 1 if (-not $dll) { throw "geopack.dll not found inside wheel" } - $dumpbin = Join-Path $env:VCToolsInstallDir "bin\HostARM64\arm64\dumpbin.exe" + $vcToolsInstallDir = $env:VCToolsInstallDir + if (-not $vcToolsInstallDir) { + $vswhere = Join-Path ${env:ProgramFiles(x86)} "Microsoft Visual Studio\Installer\vswhere.exe" + if (-not (Test-Path $vswhere)) { throw "vswhere.exe not found" } + $vsInstallPath = & $vswhere -latest -products * ` + -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ` + -property installationPath + if (-not $vsInstallPath) { throw "Could not locate a Visual Studio installation" } + $vcToolsRoot = Join-Path $vsInstallPath "VC\Tools\MSVC" + $vcToolsInstallDir = Get-ChildItem -Path $vcToolsRoot -Directory | + Sort-Object Name -Descending | + Select-Object -First 1 -ExpandProperty FullName + if (-not $vcToolsInstallDir) { throw "Could not locate VC tools directory" } + } + + $dumpbin = Join-Path $vcToolsInstallDir "bin\HostARM64\arm64\dumpbin.exe" if (-not (Test-Path $dumpbin)) { - $dumpbin = Join-Path $env:VCToolsInstallDir "bin\Hostx64\arm64\dumpbin.exe" + $dumpbin = Join-Path $vcToolsInstallDir "bin\Hostx64\arm64\dumpbin.exe" } if (-not (Test-Path $dumpbin)) { throw "dumpbin.exe not found" } From 80270868cde760cf9570b96e088dad716947d0fb Mon Sep 17 00:00:00 2001 From: Matt James Date: Mon, 18 May 2026 19:59:06 +0100 Subject: [PATCH 14/17] update submodule --- PyGeopack/__data/geopack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyGeopack/__data/geopack b/PyGeopack/__data/geopack index 7161e99..27b3be4 160000 --- a/PyGeopack/__data/geopack +++ b/PyGeopack/__data/geopack @@ -1 +1 @@ -Subproject commit 7161e99f4348a61bd96c8f42286e651acdb96dad +Subproject commit 27b3be46f26712716a8d1a4e5061850e2a2a9457 From b1c3957fb74c95d802f9e6c3d9bd5155f5798ead Mon Sep 17 00:00:00 2001 From: Matt James Date: Mon, 18 May 2026 20:03:20 +0100 Subject: [PATCH 15/17] update submodule --- PyGeopack/__data/geopack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyGeopack/__data/geopack b/PyGeopack/__data/geopack index 27b3be4..5b3d61a 160000 --- a/PyGeopack/__data/geopack +++ b/PyGeopack/__data/geopack @@ -1 +1 @@ -Subproject commit 27b3be46f26712716a8d1a4e5061850e2a2a9457 +Subproject commit 5b3d61ad722294ca985d0413bfa69dc86c35a573 From c20acc5dae44226f3d2062203e9633c3a2c29e93 Mon Sep 17 00:00:00 2001 From: Matt James Date: Mon, 18 May 2026 20:11:35 +0100 Subject: [PATCH 16/17] fix window x86 --- PyGeopack/__data/geopack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyGeopack/__data/geopack b/PyGeopack/__data/geopack index 5b3d61a..7646da9 160000 --- a/PyGeopack/__data/geopack +++ b/PyGeopack/__data/geopack @@ -1 +1 @@ -Subproject commit 5b3d61ad722294ca985d0413bfa69dc86c35a573 +Subproject commit 7646da9b36c1986f71124c882590257346c50a49 From 302ac1d952c01813ec6b727b9881fa5a14f8a7a8 Mon Sep 17 00:00:00 2001 From: Matt James Date: Mon, 18 May 2026 20:22:07 +0100 Subject: [PATCH 17/17] update submodule --- PyGeopack/__data/geopack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyGeopack/__data/geopack b/PyGeopack/__data/geopack index 7646da9..2f1ca24 160000 --- a/PyGeopack/__data/geopack +++ b/PyGeopack/__data/geopack @@ -1 +1 @@ -Subproject commit 7646da9b36c1986f71124c882590257346c50a49 +Subproject commit 2f1ca24f4f8ac7c6c0862bb056df252f61bd672b