3

I have some problems to install ggraph, I tried different ways like: How to install GGRAPH package to the latest R (v.3.3.2) or R on OSX: ggraph install error.

I already installed the packages igraph and ggforce

But the installation wasn't successful and I'm getting error messages like these:

devtools::install_github("thomasp85/ggraph#78", dependencies=TRUE)
Downloading GitHub repo klmr/ggraph@fix-narrowing-conversion
from URL https://api.github.com/repos/klmr/ggraph/zipball/fix-narrowing-conversion
Installing ggraph
versuche URL 'https://cran.rstudio.com/src/contrib/igraph_1.1.2.tar.gz'
Content type 'application/x-gzip' length 3376958 bytes (3.2 MB)
==================================================
downloaded 3.2 MB

Installing igraph
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  '/tmp/Rtmp66ifdk/devtools34415beb6487/igraph' --library='/home/knecht/R/x86_64-pc-linux-gnu-library/3.4'  \
  --install-tests 

* installing *source* package ‘igraph’ ...
** Paket ‘igraph’ erfolgreich entpackt und MD5 Summen überprüft
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++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -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 how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /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... none
checking for __gmpz_add in -lgmp... no
configure: creating ./config.status
config.status: creating src/Makevars.tmp
config.status: creating src/Makevars
config.status: creating src/config.h
** libs
gfortran   -fpic  -g -O2 -fstack-protector-strong  -c AMD/Source/amd.f -o AMD/Source/amd.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iglpk -Iplfit -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.1.1\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c AMD/Source/amd_1.c -o AMD/Source/amd_1.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iglpk -Iplfit -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.1.1\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c AMD/Source/amd_2.c -o AMD/Source/amd_2.o
…
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iglpk -Iplfit -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.1.1\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c foreign-gml-lexer.c -o foreign-gml-lexer.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iglpk -Iplfit -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.1.1\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c foreign-gml-parser.c -o foreign-gml-parser.o
In file included from src/foreign-gml-parser.y:59:0:
igraph_hacks_internal.h:42:0: warning: "strdup" redefined
 #  define strdup igraph_i_strdup
 ^
In file included from /usr/include/string.h:630:0,
                 from src/foreign-gml-parser.y:54:
/usr/include/x86_64-linux-gnu/bits/string2.h:1291:0: note: this is the location of the previous definition
 #   define strdup(s) __strdup (s)
 ^
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG     -DUSING_R -I. -Iinclude -Ics -Iglpk -Iplfit -ICHOLMOD/Include -IAMD/Include -ICOLAMD/Include -ISuiteSparse_config -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -DPACKAGE_VERSION=\"1.1.1\" -DINTERNAL_ARPACK -DIGRAPH_THREAD_LOCAL=/**/ -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c foreign-graphml.c -o foreign-graphml.o
foreign-graphml.c: In function ‘igraph_write_graph_graphml’:
foreign-graphml.c:1408:46: error: expected ‘)’ before ‘GRAPHML_NAMESPACE_URI’
   ret=fprintf(outstream, "<graphml xmlns=\"" GRAPHML_NAMESPACE_URI "\"\n");
                                              ^
foreign-graphml.c:1412:59: error: expected ‘)’ before ‘GRAPHML_NAMESPACE_URI’
   ret=fprintf(outstream, "         xsi:schemaLocation=\"" GRAPHML_NAMESPACE_URI "\n");
                                                           ^
foreign-graphml.c:1414:38: error: expected ‘)’ before ‘GRAPHML_NAMESPACE_URI’
   ret=fprintf(outstream, "         " GRAPHML_NAMESPACE_URI "/1.0/graphml.xsd\">\n");
                                      ^
/usr/lib/R/etc/Makeconf:159: die Regel für Ziel „foreign-graphml.o“ scheiterte
make: *** [foreign-graphml.o] Fehler 1
ERROR: compilation failed for package ‘igraph’
* removing ‘/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/igraph’
Installation failed: Command failed (1)
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  '/tmp/Rtmp66ifdk/devtools344115aec704/klmr-ggraph-81327aa'  \
  --library='/home/knecht/R/x86_64-pc-linux-gnu-library/3.4' --install-tests 

* installing *source* package ‘ggraph’ ...
** libs
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c circlePack.cpp -o circlePack.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c iciclePlot.cpp -o iciclePlot.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c lineCutter.cpp -o lineCutter.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c pathAttr.cpp -o pathAttr.o
g++  -I/usr/share/R/include -DNDEBUG  -I"/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include"    -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c treemap.cpp -o treemap.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o ggraph.so RcppExports.o circlePack.o iciclePlot.o init.o lineCutter.o pathAttr.o treemap.o -L/usr/lib/R/lib -lR
installing to /home/knecht/R/x86_64-pc-linux-gnu-library/3.4/ggraph/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace ‘igraph’ 0.7.1 is being loaded, but >= 1.0.0 is required
ERROR: lazy loading failed for package ‘ggraph’
* removing ‘/home/knecht/R/x86_64-pc-linux-gnu-library/3.4/ggraph’
Installation failed: Command failed (1)

1 Answers1

0

I just had a similar problem. I wanted to ask questions, but I exceeded the limit of asking questions :).

After selecting Tools-> Check for Package Updates in R Studio (Packages->Updata Packages... in R), I clicked Select All and updated all my packages. Then I shut down my computer and rebooted and repeated the command to install the "ggraph" package. There was no problem. The "ggraph" packet took some time to load, but "failed" was no longer on the screen. I hope that will be useful.

NCC1701
  • 139
  • 11