error: ‘constexpr bool std::isnan(double)’ conflicts with a previous declaration

Hi,

I’m trying to update my igraph but end up with this error. it is killing me.

Thank you so much in advance for the help!!!

install.packages(“igraph”)
Installing package into ‘/data/msun/tools/R_lib’
(as ‘lib’ is unspecified)
trying URL ‘https://cran.rstudio.com/src/contrib/igraph_2.0.2.tar.gz
Content type ‘application/x-gzip’ length 4965448 bytes (4.7 MB)
==================================================
downloaded 4.7 MB

  • installing source package ‘igraph’ …
    ** package ‘igraph’ successfully unpacked and MD5 sums checked
    ** using staged installation
    libxml2 include directories: -I/usr/include/libxml2
    libxml2 library link flags: -lxml2 -lz -lm -ldl
    ** libs
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c simpleraytracer.cpp -o simpleraytracer.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c rinterface_extra.c -o rinterface_extra.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c rrandom.c -o rrandom.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c rinterface.c -o rinterface.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c cpp11.cpp -o cpp11.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c cpprinterface.cpp -o cpprinterface.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c lazyeval.c -o lazyeval.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c init.cpp -o init.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dnaupd.f -o vendor/arpack/dnaupd.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dstatn.f -o vendor/arpack/dstatn.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dsaupd.f -o vendor/arpack/dsaupd.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dvout.f -o vendor/arpack/dvout.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dstqrb.f -o vendor/arpack/dstqrb.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dlaqrb.f -o vendor/arpack/dlaqrb.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dsaup2.f -o vendor/arpack/dsaup2.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dmout.f -o vendor/arpack/dmout.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dngets.f -o vendor/arpack/dngets.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dneupd.f -o vendor/arpack/dneupd.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dsortc.f -o vendor/arpack/dsortc.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dnaup2.f -o vendor/arpack/dnaup2.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dseigt.f -o vendor/arpack/dseigt.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dneigh.f -o vendor/arpack/dneigh.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dseupd.f -o vendor/arpack/dseupd.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dsgets.f -o vendor/arpack/dsgets.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dnapps.f -o vendor/arpack/dnapps.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dsaitr.f -o vendor/arpack/dsaitr.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dstats.f -o vendor/arpack/dstats.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dnconv.f -o vendor/arpack/dnconv.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/second.f -o vendor/arpack/second.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dsesrt.f -o vendor/arpack/dsesrt.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dsapps.f -o vendor/arpack/dsapps.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dgetv0.f -o vendor/arpack/dgetv0.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dnaitr.f -o vendor/arpack/dnaitr.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dsortr.f -o vendor/arpack/dsortr.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/dsconv.f -o vendor/arpack/dsconv.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/wrap.f -o vendor/arpack/wrap.o
    gfortran -fvisibility=hidden -fpic -g -O2 -c vendor/arpack/ivout.f -o vendor/arpack/ivout.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/version.c -o vendor/cigraph/src/version.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/eigenvector.c -o vendor/cigraph/src/centrality/eigenvector.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/truss.cpp -o vendor/cigraph/src/centrality/truss.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/prpack.cpp -o vendor/cigraph/src/centrality/prpack.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/pagerank.c -o vendor/cigraph/src/centrality/pagerank.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/closeness.c -o vendor/cigraph/src/centrality/closeness.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/hub_authority.c -o vendor/cigraph/src/centrality/hub_authority.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/coreness.c -o vendor/cigraph/src/centrality/coreness.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/centralization.c -o vendor/cigraph/src/centrality/centralization.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/betweenness.c -o vendor/cigraph/src/centrality/betweenness.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/centrality_other.c -o vendor/cigraph/src/centrality/centrality_other.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/prpack/prpack_utils.cpp -o vendor/cigraph/src/centrality/prpack/prpack_utils.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/prpack/prpack_preprocessed_scc_graph.cpp -o vendor/cigraph/src/centrality/prpack/prpack_preprocessed_scc_graph.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/prpack/prpack_preprocessed_ge_graph.cpp -o vendor/cigraph/src/centrality/prpack/prpack_preprocessed_ge_graph.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/prpack/prpack_base_graph.cpp -o vendor/cigraph/src/centrality/prpack/prpack_base_graph.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/prpack/prpack_preprocessed_schur_graph.cpp -o vendor/cigraph/src/centrality/prpack/prpack_preprocessed_schur_graph.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/prpack/prpack_igraph_graph.cpp -o vendor/cigraph/src/centrality/prpack/prpack_igraph_graph.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/prpack/prpack_preprocessed_gs_graph.cpp -o vendor/cigraph/src/centrality/prpack/prpack_preprocessed_gs_graph.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/prpack/prpack_result.cpp -o vendor/cigraph/src/centrality/prpack/prpack_result.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/centrality/prpack/prpack_solver.cpp -o vendor/cigraph/src/centrality/prpack/prpack_solver.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/cliques/glet.c -o vendor/cigraph/src/cliques/glet.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/cliques/maximal_cliques.c -o vendor/cigraph/src/cliques/maximal_cliques.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/cliques/cliquer_wrapper.c -o vendor/cigraph/src/cliques/cliquer_wrapper.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/cliques/cliques.c -o vendor/cigraph/src/cliques/cliques.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/cliques/cliquer/cliquer.c -o vendor/cigraph/src/cliques/cliquer/cliquer.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/cliques/cliquer/reorder.c -o vendor/cigraph/src/cliques/cliquer/reorder.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/cliques/cliquer/cliquer_graph.c -o vendor/cigraph/src/cliques/cliquer/cliquer_graph.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/voronoi.c -o vendor/cigraph/src/community/voronoi.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/optimal_modularity.c -o vendor/cigraph/src/community/optimal_modularity.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/modularity.c -o vendor/cigraph/src/community/modularity.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/leiden.c -o vendor/cigraph/src/community/leiden.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/fluid.c -o vendor/cigraph/src/community/fluid.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/fast_modularity.c -o vendor/cigraph/src/community/fast_modularity.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/louvain.c -o vendor/cigraph/src/community/louvain.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/label_propagation.c -o vendor/cigraph/src/community/label_propagation.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/community_misc.c -o vendor/cigraph/src/community/community_misc.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/leading_eigenvector.c -o vendor/cigraph/src/community/leading_eigenvector.o
    gcc -std=gnu99 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/edge_betweenness.c -o vendor/cigraph/src/community/edge_betweenness.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/infomap/infomap_Greedy.cc -o vendor/cigraph/src/community/infomap/infomap_Greedy.o
    g++ -std=gnu++11 -I"/opt/R/4.1.1/lib/R/include" -DNDEBUG -DUSING_R -I. -Ivendor -Ivendor/cigraph/src -Ivendor/cigraph/include -Ivendor/cigraph/vendor -Ivendor/mini-gmp -I/usr/include/libxml2 -DNDEBUG -DNTIMER -DNPRINT -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -DHAVE_GFORTRAN=1 -D_GNU_SOURCE=1 -I’/data/msun/tools/R_lib/cpp11/include’ -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c vendor/cigraph/src/community/infomap/infomap.cc -o vendor/cigraph/src/community/infomap/infomap.o
    vendor/cigraph/src/community/infomap/infomap.cc:47:12: error: ‘constexpr bool std::isnan(double)’ conflicts with a previous declaration
    using std::isnan;
    ^
    In file included from /usr/include/features.h:375:0,
    from /usr/include/inttypes.h:25,
    from vendor/cigraph/include/igraph_types.h:37,
    from vendor/cigraph/include/igraph_complex.h:28,
    from vendor/cigraph/include/igraph_vector.h:27,
    from vendor/cigraph/include/igraph_matrix.h:29,
    from vendor/cigraph/include/igraph_arpack.h:29,
    from vendor/cigraph/include/igraph_community.h:29,
    from vendor/cigraph/src/community/infomap/infomap.cc:32:
    /usr/include/bits/mathcalls.h:235:1: note: previous declaration ‘int isnan(double)’
    __MATHDECL_1 (int,isnan, (Mdouble __value)) attribute ((const));
    ^
    make: *** [vendor/cigraph/src/community/infomap/infomap.o] Error 1
    ERROR: compilation failed for package ‘igraph’
  • removing ‘/data/msun/tools/R_lib/igraph’
  • restoring previous ‘/data/msun/tools/R_lib/igraph’
    Warning in install.packages :
    installation of package ‘igraph’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpvvQGOw/downloaded_packages’

Ming

My sessioninfo is this:
R version 4.1.1 (2021-08-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.3.so

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] backports_1.4.1 plyr_1.8.9 igraph_1.4.2 lazyeval_0.2.2
[5] sp_1.6-0 splines_4.1.1 BiocParallel_1.32.6 listenv_0.9.0
[9] scattermore_0.8 usethis_2.1.6 GenomeInfoDb_1.34.9 ggplot2_3.4.4
[13] digest_0.6.34 htmltools_0.5.5 fansi_1.0.6 magrittr_2.0.3
[17] checkmate_2.1.0 memoise_2.0.1 tensor_1.5 cluster_2.1.2
[21] ROCR_1.0-11 limma_3.50.3 remotes_2.4.2 globals_0.16.2
[25] Biostrings_2.66.0 annotate_1.72.0 matrixStats_0.63.0 spatstat.sparse_3.0-1
[29] prettyunits_1.1.1 colorspace_2.1-0 blob_1.2.4 ggrepel_0.9.5
[33] xfun_0.38 dplyr_1.1.4 callr_3.7.3 crayon_1.5.2
[37] RCurl_1.98-1.14 jsonlite_1.8.8 spatstat.data_3.0-1 genefilter_1.76.0
[41] progressr_0.13.0 survival_3.5-5 zoo_1.8-11 glue_1.7.0
[45] polyclip_1.10-6 gtable_0.3.4 DEFormats_1.22.0 zlibbioc_1.44.0
[49] XVector_0.38.0 leiden_0.4.3 DelayedArray_0.20.0 pkgbuild_1.4.0
[53] future.apply_1.10.0 BiocGenerics_0.44.0 abind_1.4-5 scales_1.3.0
[57] DBI_1.2.1 edgeR_3.36.0 spatstat.random_3.1-4 ggthemes_4.2.4
[61] miniUI_0.1.1.1 Rcpp_1.0.12 viridisLite_0.4.2 xtable_1.8-4
[65] reticulate_1.30 bit_4.0.5 stats4_4.1.1 profvis_0.3.7
[69] htmlwidgets_1.6.2 httr_1.4.7 RColorBrewer_1.1-3 ellipsis_0.3.2
[73] Seurat_4.3.0 ica_1.0-3 urlchecker_1.0.1 pkgconfig_2.0.3
[77] XML_3.99-0.16.1 uwot_0.1.14 deldir_1.0-6 locfit_1.5-9.7
[81] utf8_1.2.4 reshape2_1.4.4 tidyselect_1.2.0 rlang_1.1.3
[85] later_1.3.0 AnnotationDbi_1.60.2 munsell_0.5.0 tools_4.1.1
[89] cachem_1.0.8 cli_3.6.2 generics_0.1.3 RSQLite_2.3.5
[93] devtools_2.4.5 ggridges_0.5.4 evaluate_0.20 stringr_1.5.1
[97] fastmap_1.1.1 goftest_1.2-3 yaml_2.3.7 processx_3.8.0
[101] knitr_1.42 bit64_4.0.5 fs_1.6.3 fitdistrplus_1.1-8
[105] purrr_1.0.2 RANN_2.6.1 KEGGREST_1.38.0 nlme_3.1-152
[109] pbapply_1.7-0 future_1.32.0 mime_0.12 compiler_4.1.1
[113] rstudioapi_0.14 plotly_4.10.1 curl_5.2.0 png_0.1-8
[117] spatstat.utils_3.0-2 tibble_3.2.1 geneplotter_1.72.0 stringi_1.8.3
[121] ps_1.7.4 desc_1.4.2 lattice_0.21-8 Matrix_1.5-4
[125] vctrs_0.6.5 pillar_1.9.0 lifecycle_1.0.4 spatstat.geom_3.1-0
[129] lmtest_0.9-40 RcppAnnoy_0.0.20 data.table_1.15.0 cowplot_1.1.3
[133] bitops_1.0-7 irlba_2.3.5.1 patchwork_1.2.0 httpuv_1.6.9
[137] GenomicRanges_1.46.1 R6_2.5.1 promises_1.2.0.1 KernSmooth_2.23-20
[141] gridExtra_2.3 IRanges_2.32.0 parallelly_1.35.0 sessioninfo_1.2.2
[145] codetools_0.2-18 MASS_7.3-54 pkgload_1.3.2 SummarizedExperiment_1.24.0
[149] DESeq2_1.34.0 rprojroot_2.0.3 withr_3.0.0 SeuratObject_4.1.3
[153] sctransform_0.3.5 S4Vectors_0.36.2 GenomeInfoDbData_1.2.9 parallel_4.1.1
[157] grid_4.1.1 tidyr_1.3.1 rmarkdown_2.21 MatrixGenerics_1.6.0
[161] Rtsne_0.16 spatstat.explore_3.1-0 Biobase_2.58.0 shiny_1.7.4

I looked into this. The short answer is that we cannot afford (in time and resources) to support the 10-year-old CentOS 7. Please use a newer system, or if you have no control over this system, let your sysadmin know that their failure to keep up to date is preventing you from doing your work.


The longer answer is: CentOS is 10 years old and ships GCC 4.8 by default. This old GCC appears to be not fully standards compliant, and it cannot compile igraph. I am not willing to spend more effort on trying to work around this since the line that triggers the error is already a workaround for issues in GCC 5 and older. You can also try using a newer GCC on CentOS 7, but keep in mind that the issue may be in the standard library headers—so a newer GCC with old headers might still not work.

My suggestion is: If you have any control over this, save yourself some trouble and use an OS that is not 10 years old. I do understand that there are some HPC clusters still running this OS, but unfortunately the effort they save by avoiding an upgrade would simply be shifted to others (like us) if we try to work around this …