title: How do I resolve "library not found for -lgfortran" when compiling a Rust application on macOS?
body: <p>I am trying to build a Rust app and I get the below when trying to build.  This happened after I installed ndarray-linalg and ndarray.</p>
  
  <p>I installed gcc and openvc.  I am on macOS.</p>
  
  <pre class="lang-none prettyprint-override"><code> = note: ld: library not found for -lgfortran
            clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>How do I resolve this?</p>
  
  <pre class="lang-none prettyprint-override"><code>which gfortran
  /usr/local/bin/gfortran
  </code></pre>
  
  <p>I found the library here:</p>
  
  <pre class="lang-none prettyprint-override"><code>ls /usr/local/Cellar/gcc/8.2.0/lib/gcc/8/libgfortran.*
  /usr/local/Cellar/gcc/8.2.0/lib/gcc/8/libgfortran.5.dylib    
  /usr/local/Cellar/gcc/8.2.0/lib/gcc/8/libgfortran.dylib
  /usr/local/Cellar/gcc/8.2.0/lib/gcc/8/libgfortran.a      
  /usr/local/Cellar/gcc/8.2.0/lib/gcc/8/libgfortran.spec
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code>ldconfig -p | grep fortran
  -bash: ldconfig: command not found
  </code></pre>
  
  <p>And also ran the below:</p>
  
  <pre class="lang-none prettyprint-override"><code>brew reinstall gcc
  </code></pre>
  
  <p>How can I make sure Rust will find it?</p>