Installing R igraph on Ubuntu 20.04 fails

I got compiler errors when trying to install igraph on R 4.1.1.
My OS is Ubuntu 20.04, and g++ version is 9.3.0.
I’ve been trying to install RStan following some tutorials like this one (How to Install R and two most popular R packages (tidyverse & rstan) in Ubuntu 20.04 LTS | Md Fahim Sikder) and the installation breaks on igraph.
I run R with sudo and then:
install.packages(“igraph”, dependencies = TRUE)

These are the errors that i’ve seen:

g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -DIGRAPH_THREAD_LOCAL=/**/ -DNDEBUG -Iprpack -I. -Iinclude -DPRPACK_IGRAPH_SUPPORT -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c bliss/graph.cc -o bliss/graph.o
bliss/graph.cc: In static member function ‘static bliss::Digraph* bliss::Digraph::read_dimacs(FILE*, FILE*)’:
bliss/graph.cc:2245:31: warning: null argument where non-null required (argument 1) [-Wnonnull]
 2245 |        nof_vertices, nof_edges);
      |                               ^
bliss/graph.cc:2256:52: warning: null argument where non-null required (argument 1) [-Wnonnull]
 2256 |       fprintf(verbstr, "Reading vertex colors...\n");
      |                                                    ^
bliss/graph.cc:2290:32: warning: null argument where non-null required (argument 1) [-Wnonnull]
 2290 |       fprintf(verbstr, "Done\n");
      |                                ^
bliss/graph.cc:2299:44: warning: null argument where non-null required (argument 1) [-Wnonnull]
 2299 |       fprintf(verbstr, "Reading edges...\n");
      |                                            ^
bliss/graph.cc:2333:32: warning: null argument where non-null required (argument 1) [-Wnonnull]
 2333 |       fprintf(verbstr, "Done\n");
      |                                ^
bliss/graph.cc: In static member function ‘static bliss::Graph* bliss::Graph::read_dimacs(FILE*, FILE*)’:
bliss/graph.cc:4097:31: warning: null argument where non-null required (argument 1) [-Wnonnull]
 4097 |        nof_vertices, nof_edges);
      |                               ^
bliss/graph.cc:4108:52: warning: null argument where non-null required (argument 1) [-Wnonnull]
 4108 |       fprintf(verbstr, "Reading vertex colors...\n");
      |                                                    ^
bliss/graph.cc:4142:32: warning: null argument where non-null required (argument 1) [-Wnonnull]
 4142 |       fprintf(verbstr, "Done\n");
      |                                ^
bliss/graph.cc:4151:44: warning: null argument where non-null required (argument 1) [-Wnonnull]
 4151 |       fprintf(verbstr, "Reading edges...\n");
      |                                            ^
bliss/graph.cc:4185:32: warning: null argument where non-null required (argument 1) [-Wnonnull]
 4185 |       fprintf(verbstr, "Done\n");
      |                                ^


gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iplfit -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.2.6\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c foreign.c -o foreign.o
foreign.c: In function ‘igraph_i_gml_tostring’:
foreign.c:1050:10: warning: function may return address of local variable [-Wreturn-local-addr]
 1050 |   return p;
      |          ^
foreign.c:1029:8: note: declared here
 1029 |   char tmp[256];
      |        ^~~
foreign.c:1050:10: warning: function may return address of local variable [-Wreturn-local-addr]
 1050 |   return p;
      |          ^
foreign.c:1029:8: note: declared here
 1029 |   char tmp[256];
      |        ^~~
foreign.c:1050:10: warning: function may return address of local variable [-Wreturn-local-addr]
 1050 |   return p;
      |          ^
foreign.c:1029:8: note: declared here
 1029 |   char tmp[256];
      |        ^~~

And compliation fails:

make: *** [/usr/share/R/share/make/shlib.mk:10: igraph.so] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/usr/local/lib/R/site-library/igraph’

Please any idea on what I can do to fix it?

Thank you very much

Can you please try installing the development version from Github and see whether it works? You can do it by running this in the R prompt:

install.package("remotes")
remotes::install_github("igraph/rigraph@master")

thanks for replying @tamas

got his error:

> remotes::install_github("igraph/rigraph@master")
Downloading GitHub repo igraph/rigraph@master
✔  checking for file ‘/tmp/Rtmpru6vPo/remotes258315a2ebbde/igraph-rigraph-46bfafd/DESCRIPTION’ ...
─  preparing ‘igraph’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘igraph_1.2.6.9118.tar.gz’
   
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
* installing *source* package ‘igraph’ ...
** using staged installation
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=gnu++14 accepts -g... yes
checking how to run the C++ preprocessor... g++ -std=gnu++14 -E
checking for rintf... yes
checking for finite... yes
checking for expm1... yes
checking for rint... yes
checking for log2... yes
checking for logbl... yes
checking for snprintf... yes
checking for log1p... yes
checking for round... yes
checking for fmin... yes
checking for stpcpy... yes
checking whether isfinite is declared... yes
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether stpcpy is declared... yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking net/if.h usability... yes
checking net/if.h presence... yes
checking for net/if.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking net/if_dl.h usability... no
checking net/if_dl.h presence... no
checking for net/if_dl.h... no
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking for struct sockaddr.sa_len... no
checking for xml2-config... /usr/bin/xml2-config
checking for xmlSAXUserParseFile in -lxml2... yes
checking libxml/parser.h usability... yes
checking libxml/parser.h presence... yes
checking for libxml/parser.h... yes
checking for __gmpz_add in -lgmp... yes
checking gmp.h usability... yes
checking gmp.h presence... yes
checking for gmp.h... yes
checking for glp_read_mps in -lglpk... no
configure: creating ./config.status
config.status: creating src/Makevars.tmp
config.status: creating src/Makevars
config.status: creating src/config.h
** libs
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -DIGRAPH_THREAD_LOCAL=/**/ -DNDEBUG -Iprpack -I. -Iinclude -DPRPACK_IGRAPH_SUPPORT -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c DensityGrid.cpp -o DensityGrid.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -DIGRAPH_THREAD_LOCAL=/**/ -DNDEBUG -Iprpack -I. -Iinclude -DPRPACK_IGRAPH_SUPPORT -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c DensityGrid_3d.cpp -o DensityGrid_3d.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -DIGRAPH_THREAD_LOCAL=/**/ -DNDEBUG -Iprpack -I. -Iinclude -DPRPACK_IGRAPH_SUPPORT -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c NetDataTypes.cpp -o NetDataTypes.o
...
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iplfit -ISuiteSparse_config -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.2.6.9118\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c zeroin.c -o zeroin.o
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong  -c dgetv0.f -o dgetv0.o
...
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong  -c second.f -o second.o
...
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iplfit -ISuiteSparse_config -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.2.6.9118\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c uuid/parse.c -o uuid/parse.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iplfit -ISuiteSparse_config -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.2.6.9118\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c uuid/unpack.c -o uuid/unpack.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iplfit -ISuiteSparse_config -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.2.6.9118\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c uuid/unparse.c -o uuid/unparse.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iplfit -ISuiteSparse_config -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.2.6.9118\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c rinterface.c -o rinterface.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iplfit -ISuiteSparse_config -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.2.6.9118\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c rinterface_extra.c -o rinterface_extra.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iplfit -ISuiteSparse_config -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -I/usr/include/libxml2 -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.2.6.9118\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-QwogzP/r-base-4.1.1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c lazyeval.c -o lazyeval.o
g++ -std=gnu++14 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o igraph.so DensityGrid.o DensityGrid_3d.o NetDataTypes.o NetRoutines.o SuiteSparse_config/SuiteSparse_config.o adjlist.o arpack.o array.o atlas.o attributes.o basic_query.o bfgs.o bigint.o bignum.o bipartite.o blas.o bliss.o bliss/bliss_heap.o bliss/defs.o bliss/graph.o bliss/orbit.o bliss/partition.o bliss/uintseqhash.o bliss/utils.o cattributes.o centrality.o cliquer/cliquer.o cliquer/cliquer_graph.o cliquer/reorder.o cliques.o clustertool.o cocitation.o cohesive_blocks.o coloring.o community.o community_leiden.o complex.o components.o conversion.o cores.o cs/cs_add.o cs/cs_amd.o cs/cs_chol.o cs/cs_cholsol.o cs/cs_compress.o cs/cs_counts.o cs/cs_cumsum.o cs/cs_dfs.o cs/cs_dmperm.o cs/cs_droptol.o cs/cs_dropzeros.o cs/cs_dupl.o cs/cs_entry.o cs/cs_ereach.o cs/cs_etree.o cs/cs_fkeep.o cs/cs_gaxpy.o cs/cs_happly.o cs/cs_house.o cs/cs_ipvec.o cs/cs_leaf.o cs/cs_load.o cs/cs_lsolve.o cs/cs_ltsolve.o cs/cs_lu.o cs/cs_lusol.o cs/cs_malloc.o cs/cs_maxtrans.o cs/cs_multiply.o cs/cs_norm.o cs/cs_permute.o cs/cs_pinv.o cs/cs_post.o cs/cs_print.o cs/cs_pvec.o cs/cs_qr.o cs/cs_qrsol.o cs/cs_randperm.o cs/cs_reach.o cs/cs_scatter.o cs/cs_scc.o cs/cs_schol.o cs/cs_spsolve.o cs/cs_sqr.o cs/cs_symperm.o cs/cs_tdfs.o cs/cs_transpose.o cs/cs_updown.o cs/cs_usolve.o cs/cs_util.o cs/cs_utsolve.o decomposition.o degree_sequence.o distances.o dotproduct.o dqueue.o drl_graph.o drl_graph_3d.o drl_layout.o drl_layout_3d.o drl_parse.o eigen.o embedding.o fast_community.o feedback_arc_set.o flow.o foreign-dl-lexer.o foreign-dl-parser.o foreign-gml-lexer.o foreign-gml-parser.o foreign-graphml.o foreign-lgl-lexer.o foreign-lgl-parser.o foreign-ncol-lexer.o foreign-ncol-parser.o foreign-pajek-lexer.o foreign-pajek-parser.o foreign.o forestfire.o fortran_intrinsics.o games.o gengraph_box_list.o gengraph_degree_sequence.o gengraph_graph_molloy_hash.o gengraph_graph_molloy_optimized.o gengraph_mr-connected.o gengraph_powerlaw.o gengraph_random.o glet.o glpk_support.o gml_tree.o hacks.o heap.o igraph_buckets.o igraph_cliquer.o igraph_error.o igraph_estack.o igraph_fixed_vectorlist.o igraph_grid.o igraph_hashtable.o igraph_heap.o igraph_hrg.o igraph_hrg_types.o igraph_marked_queue.o igraph_psumtree.o igraph_set.o igraph_stack.o igraph_strvector.o igraph_trie.o infomap.o infomap_FlowGraph.o infomap_Greedy.o infomap_Node.o interrupt.o iterators.o lad.o lapack.o layout.o layout_dh.o layout_fr.o layout_gem.o layout_kk.o lsap.o matching.o math.o matrix.o maximal_cliques.o memory.o microscopic_update.o mixing.o motifs.o operators.o optimal_modularity.o other.o paths.o plfit/error.o plfit/gss.o plfit/hzeta.o plfit/kolmogorov.o plfit/lbfgs.o plfit/mt.o plfit/options.o plfit/platform.o plfit/plfit.o plfit/rbinom.o plfit/sampling.o pottsmodel_2.o progress.o prpack.o prpack/prpack_base_graph.o prpack/prpack_igraph_graph.o prpack/prpack_preprocessed_ge_graph.o prpack/prpack_preprocessed_gs_graph.o prpack/prpack_preprocessed_scc_graph.o prpack/prpack_preprocessed_schur_graph.o prpack/prpack_result.o prpack/prpack_solver.o prpack/prpack_utils.o qsort.o qsort_r.o random.o random_walk.o sbm.o scan.o scg.o scg_approximate_methods.o scg_exact_scg.o scg_kmeans.o scg_optimal_method.o scg_utils.o separators.o sir.o spanning_trees.o sparsemat.o spectral_properties.o spmatrix.o st-cuts.o statusbar.o structural_properties.o structure_generators.o sugiyama.o topology.o triangles.o type_indexededgelist.o types.o vector.o vector_ptr.o version.o visitors.o walktrap.o walktrap_communities.o walktrap_graph.o walktrap_heap.o zeroin.o dgetv0.o dlaqrb.o dmout.o dnaitr.o dnapps.o dnaup2.o dnaupd.o dnconv.o dneigh.o dneupd.o dngets.o dsaitr.o dsapps.o dsaup2.o dsaupd.o dsconv.o dseigt.o dsesrt.o dseupd.o dsgets.o dsortc.o dsortr.o dstatn.o dstats.o dstqrb.o dvout.o ivout.o second.o wrap.o simpleraytracer/Color.o simpleraytracer/Light.o simpleraytracer/Point.o simpleraytracer/RIgraphRay.o simpleraytracer/Ray.o simpleraytracer/RayTracer.o simpleraytracer/RayVector.o simpleraytracer/Shape.o simpleraytracer/Sphere.o simpleraytracer/Triangle.o simpleraytracer/unit_limiter.o uuid/R.o uuid/clear.o uuid/compare.o uuid/copy.o uuid/gen_uuid.o uuid/isnull.o uuid/pack.o uuid/parse.o uuid/unpack.o uuid/unparse.o rinterface.o rinterface_extra.o lazyeval.o -lxml2 -lgmp -llapack -lblas -lgfortran -lm -lquadmath -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:10: igraph.so] Error 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/usr/local/lib/R/site-library/igraph’
Warning message:
In i.p(...) :
  installation of package ‘/tmp/Rtmpru6vPo/file2583137e0cd1f/igraph_1.2.6.9118.tar.gz’ had non-zero exit status
> 

the last lines of log are:
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:10: igraph.so] Error 1
ERROR: compilation failed for package ‘igraph’

  • removing ‘/usr/local/lib/R/site-library/igraph’
    Warning message:
    In i.p(…) :
    installation of package ‘/tmp/Rtmpru6vPo/file2583137e0cd1f/igraph_1.2.6.9118.tar.gz’ had non-zero exit status

do you think it might be this “cannot find -llapack, cannot find -lblas” ?

You need to install libblas-dev, liblapack-dev and libarpack2-dev to compile igraph. Maybe also other packages like libxml2-dev and libgmp-dev.

1 Like