[R-SIG-Mac] Installing source package/altering fortran location

Simon Urbanek simon.urbanek at r-project.org
Wed Mar 16 21:25:42 CET 2016


Mick,

you're using Homebrew's gfortran, so you're pretty much on your own, because that's not what CRAN R was compiled with so it won't work. Since Homebrew messes with /usr/local (unless you tell it not to and install is elsewhere - which is a actually a good idea) it may be easier to just completely move it aside and just install the CRAN complier from
http://r.research.att.com/libs/gfortran-4.8.2-darwin13.tar.bz2

The other alternative is to use Homebrew entirely, including R, but then you have to install all packages from sources and/or through Homebrew. You can't mix CRAN and Homebrew because CRAN uses native libraries while Homebrew uses its own (incompatible) world.

Cheers,
Simon



> On Mar 16, 2016, at 3:44 PM, Mick Jordan <mick.jordan at oracle.com> wrote:
> 
> I'm trying to install a source package (therefore needing compilation) under the R-3.2.4 Mac binary release. I happen to be using fortran 4.9.2 on this machine and /Library/Frameworks/R.framework/Resources/etc/Makeconf is bound to 4.8. I followed the instructions in R Installation and Administration to change this with no success so far. FWIW it's the actuar package I am trying to install.
> 
> First the .R/Makevars-R_PLATFORM file had no effect as seen from the package install log. Neither did setting R_MAKEVARS_USER. So I edited /Library/Frameworks/R.framework/Resources/etc/Makeconf. It now looks right but clang still cannot find lgfortran:
> 
> clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o actuar.so beta.o burr.o chisq.o dpq.o dpqphtype.o exp.o gamma.o genbeta.o genpareto.o hierarc.o init.o invburr.o invexp.o invgamma.o invgauss.o invparalogis.o invpareto.o invtrgamma.o invweibull.o lgamma.o llogis.o lnorm.o names.o normal.o panjer.o paralogis.o pareto.o pareto1.o phtype.o random.o randomphtype.o trbeta.o trgamma.o unif.o util.o weibull.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/gcc/x86_64-apple-darwin14.0.0/4.9.2 /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9 -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
> ld: library not found for -lgfortran
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make: *** [actuar.so] Error 1
> ERROR: compilation failed for package ‘actuar’
> 
> bash-3.2$ sudo find /usr -name 'libgfortran*'
> /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/gcc/x86_64-apple-darwin14.0.0/4.9.2/i386/libgfortranbegin.a
> /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/gcc/x86_64-apple-darwin14.0.0/4.9.2/libgfortranbegin.a
> /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/i386/libgfortran.3.dylib
> /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/i386/libgfortran.a
> /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/i386/libgfortran.dylib
> /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/i386/libgfortran.spec
> /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/libgfortran.3.dylib
> /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/libgfortran.a
> /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/libgfortran.dylib
> /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/libgfortran.spec
> /usr/local/gfortran/lib/gcc/x86_64-apple-darwin13/4.8.2/i386/libgfortranbegin.a
> /usr/local/gfortran/lib/gcc/x86_64-apple-darwin13/4.8.2/i386/libgfortranbegin.la
> /usr/local/gfortran/lib/gcc/x86_64-apple-darwin13/4.8.2/libgfortranbegin.a
> /usr/local/gfortran/lib/gcc/x86_64-apple-darwin13/4.8.2/libgfortranbegin.la
> /usr/local/gfortran/lib/i386/libgfortran.3.dylib
> /usr/local/gfortran/lib/i386/libgfortran.a
> /usr/local/gfortran/lib/i386/libgfortran.dylib
> /usr/local/gfortran/lib/i386/libgfortran.la
> /usr/local/gfortran/lib/i386/libgfortran.spec
> /usr/local/gfortran/lib/libgfortran.3.dylib
> /usr/local/gfortran/lib/libgfortran.a
> /usr/local/gfortran/lib/libgfortran.dylib
> /usr/local/gfortran/lib/libgfortran.la
> /usr/local/gfortran/lib/libgfortran.spec
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list