Skip to content

"npy_common.h: warning: '_fseeki64' redeclared" when building in MinGW-w64/MSYS2 #18541

Closed
@ExpHP

Description

@ExpHP

I get the following error when installing in MSYS2 with MinGW-w64.

Reproduction steps:

  1. Follow all steps at https://www.msys2.org/ to install MSYS2 and mingw-w64.
  2. In a MSYS2 / MinGW-w64 64-bit console:
pacman -S mingw-w64-x86_64-python-pip
python3 -m pip install wheel

# in numpy git root
python3 -m pip install .

(Note: You may need to apply the 2-line change in #18539 first)

Error message

  x86_64-w64-mingw32-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -D_WIN32_WINNT=0x0601 -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fwrapv -D__USE_MINGW_ANSI_STDIO=1 -D_WIN32_WINNT=0x0601 -DNDEBUG -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.mingw-3.8/numpy/core/include/numpy -Ibuild/src.mingw-3.8/numpy/distutils/include -Ibuild/src.mingw-3.8/numpy/core/src/umath -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/src/_simd -IC:/msys64/mingw64/include/python3.8 -Ibuild/src.mingw-3.8/numpy/core/src/common -Ibuild/src.mingw-3.8/numpy/core/src/npymath -c build/src.mingw-3.8/numpy/core/src/common/npy_cpu_features.c -o build/temp.mingw-3.8/build/src.mingw-3.8/numpy/core/src/common/npy_cpu_features.o
  In file included from numpy/core/src/common/npy_cpu_features.c.src:3:
  numpy/core/include/numpy/npy_common.h:185:20: warning: '_fseeki64' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
    185 | extern int __cdecl _fseeki64(FILE *, long long, int);
        |                    ^~~~~~~~~
  numpy/core/include/numpy/npy_common.h:186:26: warning: '_ftelli64' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
    186 | extern long long __cdecl _ftelli64(FILE *);
        |                          ^~~~~~~~~
cc1.exe: all warnings being treated as errors

Note

This may not even be worth fixing, as it appears that the package maintainers for MinGW are already doing something to work around this; the package mingw64-w64-x86_64-python-numpy provides a fully-up-to-date numpy 1.20.1.

NumPy/Python version information:

$ python3 --version
Python 3.8.8

$ which python3
/mingw64/bin/python3

$ x86_64-w64-mingw32-gcc --version
x86_64-w64-mingw32-gcc.exe (Rev6, Built by MSYS2 project) 10.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions