[R-SIG-Mac] value of FLIBS and installation of packages from source

Chris Paciorek paciorek at stat.berkeley.edu
Mon Nov 2 20:03:29 CET 2015


I'm having trouble installing a number of R packages from source on
Mac OS X (Yosemite) when the packages reference FLIBS in their
src/Makevars.

I have what I think is a fairly standard R install on Yosemite -
installed from R-3.2.2.pkg.

Here's where an example install fails (in this case the 'actuar' package):
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/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2 -lgfortran
-lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R
-Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option
'-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Some likely relevant facts:

1)
/Library/Frameworks/R.framework/Resources/etc/Makeconf has
FLIBS = -L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2
-lgfortran -lquadmath -lm
but /usr/local/lib/gcc does not exist on my machine.

2) libquadmath.0.dylib and libgfortran.3.dylib exist in
/Library/Framework/R.framework/Resources/lib
The following kludge allows the 'actuar' package to be installed from source:
cd /Library/Framework/R.framework/Resources/lib
ln -s libgfortran.3.dylib libgfortran.dylib
ln -s libquadmath.0.dylib libquadmath.dylib

albeit of course still with the warning about the nonexistent
/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2

3) Alternatively I can install the gfortran Mac package provided by
CRAN and manually set FLIBS in Makeconf to point to
/usr/local/gfortran/lib

So, any ideas why R is being installed such that FLIBS points to a
non-existent directory? And for packages that don't need the fortran
compiler, but merely libgfortran, is there a way to install packages
that have FLIBS in their Makevars without installing the gfortran
package and monkeying with FLIBS in Makeconf?

I'll note that this is occurring on a few machines I have access to,
including a new Macbook Air purchased in June 2015, with R and Xcode
installed thereafter. So it doesn't seem that it is a result of having
versions of OS X and command line tools from before Yosemite.

I have command line tools installed:

paciorek:/tmp> gcc --version
Configured with:
--prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix


Here's sessionInfo():

> sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.3 (Yosemite)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base


thanks,
Chris

----------------------------------------------------------------------------------------------
Chris Paciorek

Associate Research Statistician, Lecturer, Statistical Computing Consultant

Office: 495 Evans Hall                      Email: paciorek at stat.berkeley.edu
Mailing Address:                            Voice: 510-842-6670
Department of Statistics                    Fax:   510-642-7892
367 Evans Hall                              Skype: cjpaciorek
University of California, Berkeley          WWW:
www.stat.berkeley.edu/~paciorek
Berkeley, CA 94720 USA                      Permanent forward:
paciorek at alumni.cmu.edu



More information about the R-SIG-Mac mailing list