
lintr
macOS 10.12.6(Homebrew를 통해 R 3.4.3 설치)에 설치하려고 하는데 igraph
. 오류는 다음과 같습니다.
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’
이 오류를 수정하고 작동시키려면 어떻게 해야 합니까?
답변1
이 라이브러리를 설치하는 동안 한 가지 경고와 오류가 발생했습니다. 우선 내 시스템에 최신 버전의 gcc(7.3.0)를 설치했기 때문에 설치된 버전에 대한 심볼릭 링크를 만들었습니다.
ls -la /usr/local/opt/gcc/lib/gcc/7/gcc/x86_64-apple-darwin16.7.0/
버전 7.3.0만 설치되어 있는 것을 발견하여 다음과 같이 했습니다.
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
그럼 나도 고쳐야 했어요 ld: file not found: /usr/lib/system/libsystem_darwin.dylib for architecture x86_64
. 이를 위해 나는 다음을 실행했습니다.
sudo xcode-select -s /Library/Developer/CommandLineTools
그런 다음 설치를 다시 실행하면 제대로 작동합니다.