Skip to content

setup.py: honor CMAKE_GENERATOR_PLATFORM for the Windows -A flag#592

Merged
ax3l merged 1 commit into
AMReX-Codes:developmentfrom
ax3l:fix-setup-py-win-arm64
Jul 6, 2026
Merged

setup.py: honor CMAKE_GENERATOR_PLATFORM for the Windows -A flag#592
ax3l merged 1 commit into
AMReX-Codes:developmentfrom
ax3l:fix-setup-py-win-arm64

Conversation

@ax3l

@ax3l ax3l commented Jul 6, 2026

Copy link
Copy Markdown
Member

The Windows build hardcoded the Visual Studio target architecture to x64 for any 64-bit interpreter (if sys.maxsize > 2**32: -A x64). On win-arm64 the interpreter is 64-bit but the architecture is ARM, so this mis-targeted the build and find_package(Python) then failed. Honor an explicit CMAKE_GENERATOR_PLATFORM (e.g. "ARM64") from the environment, falling back to the previous behavior otherwise.

Same as openPMD/openPMD-api#1910

The Windows build hardcoded the Visual Studio target architecture to x64 for
any 64-bit interpreter (`if sys.maxsize > 2**32: -A x64`). On win-arm64 the
interpreter is 64-bit but the architecture is ARM, so this mis-targeted the
build and find_package(Python) then failed. Honor an explicit
CMAKE_GENERATOR_PLATFORM (e.g. "ARM64") from the environment, falling back to
the previous behavior otherwise.
@ax3l ax3l requested review from EZoni, WeiqunZhang and atmyers July 6, 2026 16:46
@ax3l ax3l added the install Build and installation label Jul 6, 2026
@ax3l ax3l mentioned this pull request Jul 6, 2026
1 task
@ax3l ax3l enabled auto-merge (squash) July 6, 2026 18:05
@ax3l ax3l merged commit 91965e3 into AMReX-Codes:development Jul 6, 2026
20 checks passed
@ax3l ax3l deleted the fix-setup-py-win-arm64 branch July 6, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

install Build and installation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants