I am trying to install ‘rasclass’ package on R (version 3.2.3) but somehow the installation always fails. The output is too large to be pasted here, but I found something interested in this question, that might be the key to solve this issue.
Shortly: from the terminal I can see I have gcc-4.8 and 4.9, g++-4.8 and 4.9, and gfortran-4.8. I remeber changing the symbolic links between gcc and g++ to use the “4.9” version. Can not having gfortran-4.9 be a problem? If so, how do I change the symbolc links to this version after downloading?
Finally, I just paste the very last part of the (failed) package installation.
/usr/bin/ld: impossibile trovare -lgfortran collect2: error: ld returned 1 exit status make: *** [RcppEigen.so] Errore 1 ERROR: compilation failed for package ‘RcppEigen’ * removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/RcppEigen’ * installing *source* package ‘MatrixModels’ ... ** package ‘MatrixModels’ successfully unpacked and MD5 sums checked ** R ** preparing package for lazy loading Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace ‘Matrix’ 1.1-4 is being loaded, but >= 1.1.5 is required ERROR: lazy loading failed for package ‘MatrixModels’ * removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/MatrixModels’ ERROR: dependencies ‘minqa’, ‘RcppEigen’ are not available for package ‘lme4’ * removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/lme4’ ERROR: dependencies ‘SparseM’, ‘MatrixModels’ are not available for package ‘quantreg’ * removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/quantreg’ ERROR: dependency ‘lme4’ is not available for package ‘pbkrtest’ * removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/pbkrtest’ ERROR: dependencies ‘pbkrtest’, ‘quantreg’ are not available for package ‘car’ * removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/car’ ERROR: dependencies ‘car’, ‘randomForest’ are not available for package ‘rasclass’ * removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.2/rasclass’ The downloaded source packages are in ‘/tmp/RtmphSiL6j/downloaded_packages’ There were 11 warnings (use warnings() to see them)
Advertisement
Answer
Indeed, it was a problem of gfortran.
I installed the version 4.9 through sudo apt-get install gfortran-4.9
, tried to reinstall rasclass
package and all its dependencies, and now it works. As stated in a comment of this question, I did messed up with the symbolic links of g++
and gcc
, to use the 4.9 version, but I did not have the same version of gfortran
. This seemed to be the key to solve the problem.
Finally, to choose gcc
an g++
version, I followed this answer. Hope this can help anybody.