How can I get lintr to install on macOS?

1

I'm trying to install lintr on macOS 10.12.6 (with R 3.4.3 installed via Homebrew), but the installation fails on a sub-package called igraph. Here is the error:

ld: warning: directory not found for option '-L/usr/local/opt/gcc/lib/gcc/7/gcc/x86_64-apple-darwin16.7.0/7.2.0'
ld: warning: directory not found for option '-L/usr/local/opt/gcc/lib/gcc/7/gcc/x86_64-apple-darwin16.7.0/7.2.0'
ld: file not found: /usr/lib/system/libsystem_darwin.dylib 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’
* removing ‘/usr/local/lib/R/3.4/site-library/igraph’

How can I correct this error and get it to work?

futuraprime

Posted 2018-01-31T10:48:14.470

Reputation: 183

Answers

1

I faced one warning and an error installing this library. First of all I had installed on my system a more recent version of gcc (7.3.0), so I did a symlink to the version installed:

ls -la /usr/local/opt/gcc/lib/gcc/7/gcc/x86_64-apple-darwin16.7.0/

I found only version 7.3.0 installed so I did:

ln -s /usr/local/opt/gcc/lib/gcc/7/gcc/x86_64-apple-darwin16.7.0/7.3.0 /usr/local/opt/gcc/lib/gcc/7/gcc/x86_64-apple-darwin16.7.0/7.2.0

Then I had to fix also ld: file not found: /usr/lib/system/libsystem_darwin.dylib for architecture x86_64. For this I executed:

sudo xcode-select -s /Library/Developer/CommandLineTools

Then running again the installation, it should work.

Matteo Alessani

Posted 2018-01-31T10:48:14.470

Reputation: 111