I'm running gcc (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204

I can't successfully install some R packages because I'm getting an error with my gfortran. Someone indicated it might be because my g++ isn't matching my gfortran version.

This is my gfortran: GNU Fortran (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5

Can someone help me get these to work together so I can install R packages like lavaan and it's dependencies. Thank you.

  • Can you show us the errors you get while installing the problematic R packages? How do you know that someone's advice is right? – edwinksl Sep 9 '16 at 19:40

Several versions of the gcc,g++, gfortran compilers are availble. For instance, packages g++-5, gcc-5 and gfortran-5, vs the ...-4 versions. You apparently don't have the gfortran-5 padkage. There are meta packages for the compilers, gcc, g++, and gfortran to get the dependencies for the latest versions. Probably one of those was not installed so it's package (gfortran?). Anyway, just:

sudo apt-get install gfortran

to see if you get the expected 5.3 version to match your gcc. If that doesn't work, just use the explicit gfortran-5 package.

  • Thanks! sudo apt-get install gfortran-5 did it!! semPlot, corrplot, lavaan etc all installed. For semPlot, I did have to run sudo apt-get install libxml2-dev in terminal and install.packages("XML") to get the dependencies working, but all is well! – wayneeusa Sep 12 '16 at 0:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.