The minimum stated version of gcc for building matplotlib is currently 4.8.1. When trying to build matplotlib with (our system default) gcc v4.8.5, I get
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
On the same system, if I point at gcc v8.1.0, the build works fine.
Suggested improvement
I suspect the simplest option would be to increase the stated minimum version in the installation guide, though I do not know what version that would be. I note that 4.8.5 came out in 2015.
It seems like it is not clear from the docs when this was turned on by default, so not clear if one should bump the version or possibly clarify how to build with 4.8.1? That is, how to pass the compiler flag (environment variable?).
I think the lazy fix here is to add a note that for old gcc the CXXFLAGS env needs to be set, the better fix (which I do not know the right place to do!) is to detect and add this flag as part of the build chain.
IMHO lazy is good enough here. If somebody is able and wiling enough to compile from source, we can expect them to read the docs (at least when something is not working). Also this will become less important one time less because it only affects older gcc versions. Both reasons make the issue less critical.
Activity
oscargus commented on Nov 22, 2022
It seems like it is not clear from the docs when this was turned on by default, so not clear if one should bump the version or possibly clarify how to build with 4.8.1? That is, how to pass the compiler flag (environment variable?).
tacaswell commented on Nov 22, 2022
https://gcc.gnu.org/projects/cxx-status.html#cxx11 says 4.8.1 is the minimum that implements c++11 and 6.5 (https://gcc.gnu.org/onlinedocs/gcc-6.5.0/gcc/Standards.html#C_002b_002b-Language) is the first version that defaults to c++11 (well, actually gnu++14 which I am assuming is a superset of c++11).
I think the lazy fix here is to add a note that for old gcc the CXXFLAGS env needs to be set, the better fix (which I do not know the right place to do!) is to detect and add this flag as part of the build chain.
timhoffm commented on Nov 23, 2022
IMHO lazy is good enough here. If somebody is able and wiling enough to compile from source, we can expect them to read the docs (at least when something is not working). Also this will become less important one time less because it only affects older gcc versions. Both reasons make the issue less critical.
DOC: add note about enabling c++11 support for old gcc
DOC: add note about enabling c++11 support for old gcc
DOC: add note about enabling c++11 support for old gcc
DOC: add note about enabling c++11 support for old gcc