From 228f180d99e154a0d01d559a1000ed71b8312373 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Fri, 12 Sep 2025 17:46:31 +0200 Subject: [PATCH 1/2] BLD: change file extension for libnpymath on win-arm64 from .a to .lib Closes gh-29577. --- doc/release/upcoming_changes/29750.change.rst | 5 +++++ numpy/meson.build | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 doc/release/upcoming_changes/29750.change.rst diff --git a/doc/release/upcoming_changes/29750.change.rst b/doc/release/upcoming_changes/29750.change.rst new file mode 100644 index 000000000000..5c72ef13db0f --- /dev/null +++ b/doc/release/upcoming_changes/29750.change.rst @@ -0,0 +1,5 @@ +The ``npymath`` and ``npyrandom`` libraries now have a ``.lib`` rather than a +``.a`` file extension, for compatibility for building with MSVC and +``setuptools``. Please note that using these static libraries is discouraged +and for existing projects using it, it's best to use it with a matching +compiler toolchain, which is ``clang-cl`` on Windows on Arm. diff --git a/numpy/meson.build b/numpy/meson.build index 67e4861d7ad6..45d5a2b52eb8 100644 --- a/numpy/meson.build +++ b/numpy/meson.build @@ -32,7 +32,7 @@ endif # than a `.a` file extension in order not to break including them in a # distutils-based build (see gh-23981 and # https://mesonbuild.com/FAQ.html#why-does-building-my-project-with-msvc-output-static-libraries-called-libfooa) -if is_windows and cc.get_id() == 'msvc' +if is_windows and cc.get_id() in ['msvc', 'clang-cl'] name_prefix_staticlib = '' name_suffix_staticlib = 'lib' else From 04378ddc5da5c5ad592d6f599bb6d88dc81f4600 Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Sun, 14 Sep 2025 14:57:57 +0200 Subject: [PATCH 2/2] apply suggested edit [skip ci] Co-authored-by: Matti Picus --- doc/release/upcoming_changes/29750.change.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/release/upcoming_changes/29750.change.rst b/doc/release/upcoming_changes/29750.change.rst index 5c72ef13db0f..2759c08d8349 100644 --- a/doc/release/upcoming_changes/29750.change.rst +++ b/doc/release/upcoming_changes/29750.change.rst @@ -1,5 +1,5 @@ The ``npymath`` and ``npyrandom`` libraries now have a ``.lib`` rather than a -``.a`` file extension, for compatibility for building with MSVC and +``.a`` file extension on win-arm64, for compatibility for building with MSVC and ``setuptools``. Please note that using these static libraries is discouraged and for existing projects using it, it's best to use it with a matching compiler toolchain, which is ``clang-cl`` on Windows on Arm.