2022年4月21日 星期四

Mac上Rstudio安裝套件時出現gfortran相關的ld warning, library not found for -lxxx

在Mac上的Rstudio安裝套件的時候出現類似下列錯誤:

gfortran-4.8   -fPIC  -g -O2  -c mclust.f -o mclust.o
gfortran-4.8   -fPIC  -g -O2  -c mclustaddson.f -o mclustaddson.o

ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lquadmath

clang: error: linker command failed with exit code 1 (use -v to see invocation) 

上述問題在macOS Big Sur (11.6.5)上面的做法是去更新 ~/.R/Makevars

VER=-8
CC=gcc$(VER)
CXX=g++$(VER)
CXX11=g++$(VER)
CXX14=g++$(VER)
CXX17=g++$(VER)
CFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
CXXFLAGS=-mtune=native -g -O2 -Wall -pedantic -Wconversion
FLIBS=-L/usr/local/Cellar/gcc/8.2.0/lib/gcc/8


參考資料

_EOF_

Concept art for a post-apocalyptic world with ruins, overgrown vegetation, and a lone survivor.

Steps: 41, Sampler: Euler, CFG scale: 7, Seed: 1037562638, Size: 512x512, Model hash: 5c7d38880d, Model: playground-v2, Version: v1.6.0-2-g4afaaf8a

Time taken: 38.2 sec.

沒有留言:

張貼留言