In some machines I do not have ‘root’ access, therefore when I need a software and I don’t want to bother the sysadmin, I have to install it by myself into my home directory. Today, I needed to install the newest R-project’s version 3.1.0, and for some reason my FreeBSD machine could not find Fortran’s path.
In my home directory I have a special folder, named ‘TOOLS_SRC’ where I leave all source code for compilation. To install R on the user’s home I ran ./configure –prefix=/home/kaiorafael/rbinary , which gave me the following error.
checking for Fortran 77 libraries of fc... checking how to get verbose linking output from gcc -std=gnu99... -v checking for C libraries of gcc -std=gnu99... -L/usr/local/lib -L/usr/lib -lgcc_s checking for dummy main to link with Fortran 77 libraries... none checking for Fortran 77 name-mangling scheme... configure: error: in `/home/kaiorafael/TOOLS_SRC/R-3.1.0': configure: error: cannot compile a simple Fortran program See `config.log' for more details
Looking carefully at the log message, I found this line very interesting.
“loading site script ‘./config.site'”
This file ‘config.site’ has many options to customize R-project’s installation. Since FreeBSD uses ‘gfortran’, I just had to uncomment the ‘## F77=’ line and change it for
Running again ‘./configure –prefix=/home/kaiorafael/rbinary’, and than ‘make && make install’, everything is working like a charm now.
R version 3.1.0 (2014-04-10) -- "Spring Dance" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-unknown-freebsd9.2 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
I am not FreeBSD sysadmin nor FreeBSD heavy user. In case you are a FreeBSD expert, please let me know that there is a better way to solve this issue.