[R-SIG-Mac] .... Matrix broken on Mac...

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Dec 3 13:47:16 CET 2008


On Wed, 3 Dec 2008, Simon Urbanek wrote:

>
> On Dec 3, 2008, at 6:26 PM, Prof Brian Ripley wrote:
>
>> On Wed, 3 Dec 2008, Martin Maechler wrote:
>> 
>>> This was on the wrong mailing list (R-SIG-mixed-models),
>>> but I strongly believe belongs here.
>>> 
>>> As one of the two maintainers of Matrix,
>>> I'm very interested to here if really there are still/again
>>> problems with the *R-forge* (or CRAN) version of Matrix on the Mac.
>> 
>> We need to be careful here about what R version (source vs binary, CRAN 
>> build vs others, which sub-architectures?).
>> 
>> That Simon is building R-devel means that the CRAN version of Matrix works 
>> on the CRAN build of R with all the sub-architectures.
>> 
>>> We have made several efforts, partially prompted and aided by
>>> Simon Urbanek, to get the issues (mostly related to building a
>>> "fat binary", IIRC) resolved.

>>> Dave, did you install the R-forge version
>>> with
>>> 	install.packages("Matrix",repos="http://R-Forge.R-project.org")
>>> 
>>> {as it is recommended}?
>> 
>> which with a CRAN build gets a binary.  That binary works for me (Leopard 
>> i386, 10.5.5), but it only has i386 and ppc binaries.
>
> The Tiger build Matrix binary has only 32-bit (i386/ppc) because that's the 
> only archs that the Tiger R build contains. The Leopard build Matrix binary 
> has all four archs (incl. x86_64 and ppc64).

Yes, my point being that the R-forge Matrix binary (which is what that 
command gets) has only two of the archs. whereas the CRAN Leopard R binary 
has four.

>> So I think you should be recommending type="source" to Mac users (or at 
>> least warn 64-bit Mac users about this).
>> 
>> Now the i386 Matrix.so is linked against gfortran:
>> 
>> tystie% otool -L Matrix.so
>> Matrix.so:
>> 	Matrix.so (compatibility version 0.0.0, current version 0.0.0)
>> 
>> /Library/Frameworks/R.framework/Versions/2.8/Resources/lib/libRlapack.dylib 
>> (compatibility version 2.8.0, current version 2.8.0)
>> 
>> /Library/Frameworks/R.framework/Versions/2.8/Resources/lib/libRblas.dylib 
>> (compatibility version 0.0.0, current version 0.0.0)
>> 	/usr/local/lib/libgfortran.2.dylib (compatibility version 3.0.0, 
>> current version 3.0.0)
>> ...
>> 
>> and the error message is about not finding libgfortran.  That suggests a 
>> problem with the R installation in question, since AFAIK this is normally 
>> installed with R.  If /usr/local/lib/libgfortran.2.dylib really is missing, 
>> it can be installed from the tools subdirectory on CRAN (or you could try 
>> re-installing R).
>> 
>> The CRAN build of Matrix is not linked against libgfortran.  I suspect that 
>> reflects a difference in how the BLAS has been set up on R-forge and on 
>> Simon's build machine.  Fortran is needed for the standard R BLAS but not 
>> for the 'vecLib' BLAS that comes with the OS.
>> 
>
> It's not really just BLAS but it depends on whether the installed gfortran 
> uses static or dynamic libgfortran. It's a long story but essentially the 
> current rationale is that if you compile from sources, you'll have the 
> dynamic libgfortran (if used), so it is not really necessary inside R. Binary 
> providers, however, have to be conscious about this and I recommend using 
> static libgfortran so you don't get into such problems (but it has other 
> issues...). Originally I had planned to keep the old dynamic library in the R 
> distribution, but it got omitted inadvertently. Since it is not crucial to R 
> itself and CRAN binaries, I didn't think it's import enough to warrant 
> another re-packaging.

Thanks for the clarification.  I didn't expect static libgfortran to work 
(and e.g. it does not on x86_64 Linux).

> There are more problems with the R-Forge OS X builds (they don't perform 
> clean checkouts so strange files can get caught up etc.), so currently I'd 
> strongly recommend using type='source' for R-Forge packages.

And that will require you to install the gfortran from CRAN as well as 
Xcode.

>
> Cheers,
> Simon
>
>
>> So I think the problem is with one user's R installation, but this was 
>> triggered by a difference in how the CRAN and R-forge builds of R 2.8.0 
>> were configured.
>> 
>>> 
>>> Best regards,
>>> Martin
>>> 
>>> 
>>> 
>>>>>>>> "DA" == Dave Atkins <datkins at fuller.edu>
>>>>>>>>   on Mon, 01 Dec 2008 11:39:18 -0800 writes:
>>>
>>>  DA> Douglas Bates wrote:
>>>  >> Does
>>>  >>
>>>  >> library(Matrix)
>>>  >>
>>>  >> without any reference to lme4 work for you?
>>>
>>>  DA> No, if I start a fresh R session and call Matrix on its
>>>  DA> own, I get:
>>>
>>>  >> library(Matrix)
>>>  DA> Loading required package: lattice Error in
>>>  DA> dyn.load(file, DLLpath = DLLpath, ...) : unable to load
>>>  DA> shared library
>>>  DA> 
>>> '/Library/Frameworks/R.framework/Resources/library/Matrix/libs/i386/Matrix.so':
>>>
>>>  DA> 
>>> dlopen(/Library/Frameworks/R.framework/Resources/library/Matrix/libs/i386/Matrix.so,
>>>  DA> 6): Library not loaded:
>>>  DA> /usr/local/lib/libgfortran.2.dylib Referenced from:
>>>  DA> 
>>> /Library/Frameworks/R.framework/Resources/library/Matrix/libs/i386/Matrix.so
>>>  DA> Reason: image not found Error: package/namespace load
>>>  DA> failed for 'Matrix'
>>>
>>>  >> sessionInfo()
>>>  DA> R version 2.8.0 (2008-10-20) i386-apple-darwin8.11.1
>>>
>>>  DA> locale:
>>>  DA> en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>>>
>>>  DA> attached base packages: [1] stats graphics grDevices
>>>  DA> utils datasets methods base
>>>
>>>  DA> other attached packages: [1] lattice_0.17-17
>>>
>>>  DA> loaded via a namespace (and not attached): [1]
>>>  DA> grid_2.8.0
>>>  >>
>>> 
>>> Any ideas?  Anything else I can pass along?
>>>
>>>  DA> thanks, Dave
>>>
>>>  >>
>>>  >> The other person who was having difficulty loading the
>>>  >> Matrix package on a Mac was able to resolve the problem
>>>  >> although I forget the details of how it was resolved.
>>>  >>
>>>  >> The messages indicate that the problem is more with
>>>  >> Matrix than with lme4.
>>>  >>
>>>  >> On Mon, Dec 1, 2008 at 12:26 PM, Dave Atkins
>>>  >> <datkins at fuller.edu> wrote:
>>>  >>> [whoops, first sent this from my current email, which
>>>  >>> the listserv didn't recognize.  apologies if this comes
>>>  >>> through twice.]
>>>  >>
>>>  >> And it did come through twice.  I read the messages in
>>>  >> the wrong order and authorized the posting from the other
>>>  >> address before reading this message.  Sorry for the extra
>>>  >> noise.
>>>  >>
>>>  >>> Doug--
>>>  >>>
>>>  >>> You had inquired whether anyone else was having problems
>>>  >>> with Matrix on a Mac... yep.  I am.  You'll see below
>>>  >>> that I removed both lme4 and Matrix, re-install from
>>>  >>> r-forge, but get an error msg.  sessionInfo() at bottom.
>>>  >>>
>>>  >>> Could someone point me to an earlier version of Matrix?
>>>  >>> I don't believe I had this problem prior to the most
>>>  >>> recent update.
>>>  >>>
>>>  >>> cheers, Dave
>>>  >>>
>>>  >>> Dave Atkins, PhD Research Associate Professor Center for
>>>  >>> the Study of Health and Risk Behaviors Department of
>>>  >>> Psychiatry and Behavioral Science 1100 NE 45th Street,
>>>  >>> Suite 300 Seattle, WA 98105 206-616-3879
>>>  >>> datkins at u.washington.edu
>>>  >>>
>>>  >>>
>>>  >>>> remove.packages("Matrix")
>>>  >>> Warning in remove.packages("Matrix") : argument 'lib' is
>>>  >>> missing: using
>>>  >>> /Library/Frameworks/R.framework/Resources/library
>>>  >>>> remove.packages("lme4")
>>>  >>> Warning in remove.packages("lme4") : argument 'lib' is
>>>  >>> missing: using
>>>  >>> /Library/Frameworks/R.framework/Resources/library
>>>  >>>> install.packages("Matrix", repos =
>>>  >>>> "http://r-forge.r-project.org")
>>>  >>> trying URL
>>>  >>> 
>>> 'http://r-forge.r-project.org/bin/macosx/universal/contrib/2.8/Matrix_0.999375-17.tgz'
>>>  >>> Content type 'application/x-gzip' length 2740286 bytes
>>>  >>> (2.6 Mb) opened URL
>>>  >>> ==================================================
>>>  >>> downloaded 2.6 Mb
>>>  >>>
>>>  >>>
>>>  >>> The downloaded packages are in
>>>  >>>
>>>  >>> 
>>> /var/folders/eF/eFm91WFiEm8IX1HSzMCn4E+++TI/-Tmp-//RtmpVgGfBC/downloaded_packages
>>>  >>>> install.packages("lme4", repos =
>>>  >>>> "http://r-forge.r-project.org")
>>>  >>> trying URL
>>>  >>> 
>>> 'http://r-forge.r-project.org/bin/macosx/universal/contrib/2.8/lme4_0.999375-27.tgz'
>>>  >>> Content type 'application/x-gzip' length 913761 bytes
>>>  >>> (892 Kb) opened URL
>>>  >>> ==================================================
>>>  >>> downloaded 892 Kb
>>>  >>>
>>>  >>>
>>>  >>> The downloaded packages are in
>>>  >>>
>>>  >>> 
>>> /var/folders/eF/eFm91WFiEm8IX1HSzMCn4E+++TI/-Tmp-//RtmpVgGfBC/downloaded_packages
>>>  >>>> library(lme4)
>>>  >>> Loading required package: Matrix Error in dyn.load(file,
>>>  >>> DLLpath = DLLpath, ...) : unable to load shared library
>>>  >>> 
>>> '/Library/Frameworks/R.framework/Resources/library/Matrix/libs/i386/Matrix.so':
>>>  >>>
>>>  >>> 
>>> dlopen(/Library/Frameworks/R.framework/Resources/library/Matrix/libs/i386/Matrix.so,
>>>  >>> 6): Library not loaded:
>>>  >>> /usr/local/lib/libgfortran.2.dylib Referenced from:
>>>  >>> 
>>> /Library/Frameworks/R.framework/Resources/library/Matrix/libs/i386/Matrix.so
>>>  >>> Reason: image not found Error: package 'Matrix' could
>>>  >>> not be loaded
>>>  >>>> sessionInfo()
>>>  >>> R version 2.8.0 (2008-10-20) i386-apple-darwin8.11.1
>>>  >>>
>>>  >>> locale:
>>>  >>> en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>>>  >>>
>>>  >>> attached base packages: [1] stats graphics grDevices
>>>  >>> utils datasets methods base
>>>  >>>
>>>  >>> other attached packages: [1] lattice_0.17-17
>>>  >>>
>>>  >>> loaded via a namespace (and not attached): [1]
>>>  >>> grid_2.8.0 tools_2.8.0
>>>  >>>
>>>  >>> _______________________________________________
>>>  >>> R-sig-mixed-models at r-project.org mailing list
>>>  >>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>>  >>>
>>>  >>
>>> 
>>> _______________________________________________
>>>  DA> R-sig-mixed-models at r-project.org mailing list
>>>  DA> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>> 
>>> _______________________________________________
>>> R-SIG-Mac mailing list
>>> R-SIG-Mac at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>> 
>> 
>> -- 
>> Brian D. Ripley,                  ripley at stats.ox.ac.uk
>> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
>> University of Oxford,             Tel:  +44 1865 272861 (self)
>> 1 South Parks Road,                     +44 1865 272866 (PA)
>> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>> 
>> _______________________________________________
>> R-SIG-Mac mailing list
>> R-SIG-Mac at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>> 
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-SIG-Mac mailing list