Skip to content
Prev 6222 / 15075 Next

Building R-devel from Source on Snow Leopard

Simon,

 	Thanks for your comments; responses below.
On Fri, 4 Sep 2009, Simon Urbanek wrote:

            
LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>

...the gfortran library lives in a nonstandard directory, which is why I put
the -L there... so I then moved -lgfortran to LIBS='-lgfortran' and things
broke in the same way, as did moving the -L...-lgfortran there.  Both of
these need to be passed to the linker when mixing C/Fortran code.

It also throws the error "Maybe check LDFLAGS for paths to Fortran
libraries?" which is what tipped me off to the fact that I should provide a
link to the Fortran libraries in LDFLAGS.  If this is incorrect, please let
me know where to put them instead (and consider updating the configure
script).
I had, and there was no libiconv there.

I eventually solved this problem by upgrading fink to the 64bit version and
installing libiconv and adding CPPFLAGS="-I/sw/include" and adding -L/sw/lib
to LDFLAGS, forcing it to link against the new library. It seems like the
Apple libraries should serve the purpose, but for whatever reason they did
not.

My current problem is that, during make, R complains about the lapack.so
file it has compiled from my lapack libraries (I configured with
--with-lapack="-L/usr/local -llapack -lptf77blas -lcblas -lpthread -latlas"
and a similar --with-blas):

Warning in solve.default(rgb) :
   unable to load shared library '/Volumes/Tubby2/nobackup/R-2.9.2/modules//lapack.so':
   dlopen(/Volumes/Tubby2/nobackup/R-2.9.2/modules//lapack.so, 6): Symbol not found: _cblas_cdotc_sub
   Referenced from: /Volumes/Tubby2/nobackup/R-2.9.2/modules//lapack.so
   Expected in: flat namespace
  in /Volumes/Tubby2/nobackup/R-2.9.2/modules//lapack.so
Error in solve.default(rgb) : lapack routines cannot be loaded
Error: unable to load R code in package 'grDevices'
Execution halted

...that said, I understand that --with-lapack is "not recommended" in the
admin manual, so I'm pretty much on my own here, but I'd be interested if
you have an idea or two about what might be going on. _cblas_cdotc_sub is
indeed in my lapack.a file (but not the lapack.so file R refers to), and I
can use _cblas_cdotc if I write some simple c code and link it against
lapack using the same flags as noted above.

My interest, really, is in whether ATLAS's LAPACK-tuning system (which is
pretty new) actually leads to speed improvements in R.  So, I don't
desperately need to use it, but am still concerned that a compile that used
to run smoothly no longer does.

--Adam