Skip to content

BUG: numpy build fails with gcc version 4.9.2 #21302

@jzombi

Description

@jzombi

Describe the issue:

Numpy fails to build with gcc version 4.9.2 with the following error:

RuntimeError: Broken toolchain: cannot link a simple C++ program. note: A compiler with support for C++11 language features is required.

This should not be a problem, because C++11 standard is supported since gcc 4.8.1.

The problem is that when compiling the test code in numpy/core/setup.py, the -std=c++11 flag is not passed to the compiler.
The default c++ standard was changed in version 6.1 from C++98 to C++14, so this issue might affect all prior gcc versions.

By monkey-patching setup.py to include the -std=c++11 flag, the build run successfully.

Reproduce the code example:

python setup.py build

Error message:

RuntimeError: Broken toolchain: cannot link a simple C++ program. note: A compiler with support for C++11 language features is required.

NumPy/Python version information:

1.22.3 3.8.12 (default, Jan 12 2022, 09:59:17)
[GCC 4.9.2]

Metadata

Metadata

Assignees

No one assigned

    Labels

    00 - BugC++Related to introduction and use of C++ in the NumPy code basecomponent: build

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions