c++ version requirement


It appears to me that the rigraph (and igraph) code requires a C++ version 11 compiler. I wonder if exactly C++ 11 is required, or if compilers for more recent C++ versions will compile the code correctly?

I appreciate your consideration and guidance.

Thank you.


I think it’s unusual that a compiler supports newer versions of the standard, but not C++ 11. So when anybody says you need C++11 support, then they probably mean there’s some old compilers that wouldn’t work, but newer is fine.
Are you thinking about a specific compiler? Recent versions of GCC, Clang or the Visual Studio compiler should all work.

(I don’t know anything about building rigraph locally, this is just some general info)

Just to clarify: Do you just want to use rigraph, or do you want to do something special, like modify it? Because if you want to use it, can’t you just


and see if that works?

Is there any practical issue that you are having with the installation? If yes, just describe the symptoms and we’ll see if we can help.

If you are having problems with installation, the cause is not the lack C++11 support in your compiler. These days it’s basically impossible to find a system without C++11 support, unless you’re a retrocomputing enthusiast.


Expanding a bit, I maintain an R package on CRAN that uses and includes rigraph source code modules as a convenience to users so that they avoid having to install the igraph library. The configure/Makevars files specify a CXX11 compiler to build the source code, because the rigraph files specify CXX11. Recently, CRAN’s automated tests flagged the CXX11 spec with a note, so the CRAN repository guardians want me to justify the CXX11 requirement. I a weak understanding of the C++ standard versions and the related compiler flags. The CRAN people seem to suggest that I simply remove the dependence on CXX11 but I am too timid to do so without assurance that the package won’t exhibit undefined behavior.

I hope my explanation is clear.

I appreciate your patience and guidance.

Thank you.


I will just say that igraph 0.9 (which R/igraph is currently based on) does compile (and work) correctly with the current latest C17 and C++20 standards.

As for the CRAN warning, perhaps @krlmlr or @tamas can comment.

Note: Some minor adjustments will be needed for the upcoming C23 standard (note C23, not C++23!), and these will only be made in the 0.10 series, not in 0.9. But C23 is not even finalized yet, and I expect it will take some years before R, not to mention any compiler, would start to use it by default.

I vaguely remember that I messed around with the C++11 requirement around the release of v1.4.0; right now none of the Makevars files in R-igraph’s source tree mention C++11 explicitly. (This is where it was removed: fix: remove C++11 specification because of CRAN pretests · igraph/rigraph@941c073 · GitHub ).

So I’d say if CRAN wants you to remove the C++11 requirement, go ahead and remove it, and resubmit. Worst thing that can happen is that it won’t compile, in which case you have a justification for requiring C++11.


I appreciate enormously your kind and detailed guidance. Thank you!

Ever grateful,