1

I'm having trouble installing igraph on R 3.1.0 on OS X Mavericks with XCode 5.1.1. The error message I get is:

ld: illegal text-relocation to '___gmp_binvert_limb_table' in /usr/local/lib/libgmp.a(mp_minv_tab.o) from '___gmpn_divexact_1' in /usr/local/lib/libgmp.a(dive_1.o) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [igraph.so] Error 1
ERROR: compilation failed for package ‘igraph’

Looking around, I found that I'm not the only one to have this issue and it's not limited to igraph (here and here), but adding CXXFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future to ~/.R/Makevars didn't help. From the error message, it looks like R found the system installation of GMP and not the Macports version, which could conceivably have been built for a different architecture. (Installing from binaries also didn't work for me, with an error message of image not found, but it looks like this is a separate issue.) Has anyone else encountered similar issues?

sessionInfo() gives:

R version 3.1.0 (2014-04-10)
Platform: x86_64-apple-darwin13.0.2 (64-bit)

Thanks in advance!

Community
  • 1
  • 1
ben
  • 467
  • 3
  • 11
  • I have the same config as you do and `igraph` v0.7.0 (binary) installs fine with `install.packages()`. v0.7.1 (source) install did not work at all but was/is due to a `quadmath` lib error. – hrbrmstr Jun 11 '14 at 03:19
  • You can try downloading the binary from http://cran.r-project.org/web/packages/igraph/index.html (the one for Snow Leopard if you need 0.7.1). – Gabor Csardi Jun 11 '14 at 03:36
  • Btw. if you are building R with MacPorts, that is not supported, so you are on your own. – Gabor Csardi Jun 11 '14 at 03:36
  • No, I built R from scratch. That was my first thought. – ben Jun 11 '14 at 11:44
  • I tried installing v0.6.6 from source, and got the same error. Installing from binary appears to work, but when I `require` igraph, I get an `image not found` error and it won't load. – ben Jun 11 '14 at 14:04
  • Unless you have a specific reason for building R, I suggest using the Snow Leopard installer they provide. The binary packages on CRAN and igraph.org are compatible with that, but not necessarily compatible with your build. – Gabor Csardi Jun 11 '14 at 19:47
  • Great! Reinstalling R from source let me use the R binaries. If you want to add your comment as an answer I can accept it. Thanks for your help! – ben Jun 12 '14 at 13:52

1 Answers1

1

In case this is helpful to anyone else, here is the solution from Gabor Csardi that worked for me: Try with the binary distribution of R. I had built R from source, and that version didn't work with installing igraph from either source or binary.

ben
  • 467
  • 3
  • 11