msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.28k stars 1.22k forks source link

h5py: UserWarning: Signature for <class 'numpy.float128'> does not match any known type #14086

Open sbourdeauducq opened 1 year ago

sbourdeauducq commented 1 year ago

Description

Installing mingw-w64-x86_64-python-h5py and then importing it prints this warning:

# python
Python 3.10.8 (main, Nov  6 2022, 23:27:16)  [GCC 12.2.0 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import h5py
C:/msys64/mingw64/lib/python3.10/site-packages/numpy/core/getlimits.py:493: UserWarning: Signature b
'\x00\xd0\xcc\xcc\xcc\xcc\xcc\xcc\xfb\xbf^\x8d\x99\x00\x00\x00' for <class 'numpy.float128'> does no
t match any known type: falling back to type probe function.
This warnings indicates broken support for the dtype!
  machar = _get_machar(dtype)

Verification

Windows Version

Microsoft Windows [Version 10.0.17763.3650]

MINGW environments affected

Expected behavior

No warning is emitted

Actual behavior

The warning above is printed

Repro steps

pacman -S mingw-w64-x86_64-python-h5py python import h5py

Are you willing to submit a PR?

No response

lazka commented 1 year ago

likely related to the float128 ABI being different with mingw

wlph17 commented 1 year ago

image Left: Linux, Right: Mingw64 maybe the float128 is not working right in mingw?

wlph17 commented 1 year ago

image from https://github.com/numpy/numpy/blob/a24ddad5d1d43ec9bea474abf8068ee6b8db01db/numpy/meson.build#L21 I think the reason is that the float128 is basically float64, so the ABI does not match here.

lazka commented 1 year ago

Meson support in numpy is two weeks old, so we don't use that for building. If something similar exists in the default build system then it might be something we need to adjust, yeah.

wlph17 commented 1 year ago

oh, I thought that was the reason because I found that it is 64bits for float128 in numpy in current mingw64. Maybe there are something similar that results 64bits?