title: Problem installing R package "ld: warning: directory not found for option "
body: <p>I'm trying to install the package gradientForest in R by using </p>
  
  <pre><code>install.packages("gradientForest", repos="http://R-Forge.R-project.org")
  </code></pre>
  
  <p>And I'm getting this error </p>
  
  <pre><code>ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
  ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
  ld: library not found for -lgfortran
  </code></pre>
  
  <p>I've already tried the answer from <a href="https://stackoverflow.com/questions/35999874/mac-os-x-r-error-ld-warning-directory-not-found-for-option">this thread</a> , and <a href="https://stackoverflow.com/questions/29992066/rcpp-warning-directory-not-found-for-option-l-usr-local-cellar-gfortran-4-8/29993906#29993906">this thread</a> .</p>
  
  <p>According to these threads, I've installed gcc using </p>
  
  <pre><code>brew install gcc
  </code></pre>
  
  <p>and my Makevars looks like </p>
  
  <pre><code>## With Rcpp 0.11.0 and later, we no longer need to set PKG_LIBS as there is
  ## no user-facing library. The include path to headers is already set by R.
  #PKG_LIBS = 
  
  ## With R 3.1.0 or later, you can uncomment the following line to tell R to 
  ## enable compilation with C++11 (or even C++14) where available
  CXX_STD = CXX17
  
  VER=-9
  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`gfortran -print-file-name=libgfortran.dylib | xargs dirname`
  </code></pre>
  
  <p>but unfortunately it does not change anything on the error I'm having.
  My R version is 3.6.1 and I am on MacOS Catalina.</p>
  
  <p>If somebody is able to help me, I would be very grateful.
  Thanks</p>