<p>I found a similar question on <a href="https://stackoverflow.com/questions/6302209/building-r-package-getting-error-ld-cannot-find-lgfortran">stackoverflow</a> and the solution was to create a symlink as described by <code>kevin</code> there:</p>

<pre><code>sudo ln -s /usr/lib/x86_64-linux-gnu/libgfortran.so.3 /usr/lib/libgfortran.so
</code></pre>

CC BY-SA 3.0
2017-12-07T11:59:03.850Z
This feels like a dirty hack — better fix your GCC installation.
Konrad Rudolph
CC BY-SA 3.0
2017-11-28T03:14:17.077Z
2017-12-06T09:03:23.027Z
2017-12-06T09:03:23.027Z
Nikita Vlasenko
<p>When I am trying to install the RcppArmadillo Bioconductor library in R, it is giving me the following error:</p>

<pre><code>/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [RcppArmadillo.so] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/home/nikita/R/x86_64-pc-linux-gnu-library/3.2/RcppArmadillo’
</code></pre>

<p>I am using Ubuntu 12.04, R 3.2.5 and <code>g++-5.4</code>. Any help would be greatly appreciated.</p>

<r><software-installation>
RcppArmadillo installation error
# RcppArmadillo installation error

(Asked by: username_0 on 2017-11-28)

When I am trying to install the RcppArmadillo Bioconductor library in R, it is giving me the following error:
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status
make: *** [RcppArmadillo.so] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/home/nikita/R/x86_64-pc-linux-gnu-library/3.2/RcppArmadillo’

I am using Ubuntu 12.04, R 3.2.5 and g++-5.4. Any help would be greatly appreciated.

**Tags:** r, software-installation

---

## 1 answers

### Answer by username_0 on 2017-11-28. Score: 1 | Accepted answer

I found a similar question on stackoverflow and the solution was to create a symlink as described by kevin there:
sudo ln -s /usr/lib/x86_64-linux-gnu/libgfortran.so.3 /usr/lib/libgfortran.so

> **Comments:**
> **username_1**: This feels like a dirty hack — better fix your GCC installation.  

---

