EDIT: My OS is 10.15.4 and R is 4.0.0 and Xcode 11.4.1
I tried to install an archived package "OC" (Optimal Classification). I downloaded the file from here (oc_1.01.tar.gz) first and store it on my desktop. I have tried to install this through install.packages("oc_1.01.tar.gz", repo=NULL, type="source")
or install_version("oc", version = "1.01", repos = "https://cran.r-project.org/")
and it always failed with warnings as:
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [oc.so] Error 1
ERROR: compilation failed for package ‘oc’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/oc’
Error: Failed to install 'unknown package' from URL:
(converted from warning) installation of package ‘/var/folders/yv/gzy_ljk971d4jnlntnfvht_40000gn/T//Rtmpr8pJmf/remotes1e1745dfa9dc/oc’ had non-zero exit status
I have tried several solutions similar to this to download gcc or gcc@8 through Homebrew and made changes on the file Makeconf
. However, as long as I made changes (even I restored the original codes), installation still fails and returns warnings as:
R clang: error: no such file or directory: 'SHLIB_LIBADD'
R clang: error: no such file or directory: '='
If I changed CC
, CXX
(including all CXX
related such as CXX17
), and FLIBS
to gcc-8
or gcc-9
, the returned warnings become:
R gcc-8: error: no such file or directory: 'SHLIB_LIBADD'
R gcc-8: error: no such file or directory: '='
I appreciate any help.