[R] Cairo package error: "unable to load..."

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Jul 24 08:52:10 CEST 2014


I presume this about the CRAN binary packages for R and Cairo (from 
CRAN, not BioC), in which case you should have asked on R-sig-mac.

But the likely answer is that you forgot to install X11 via XQuartz. 
See the 'R Installation and Administration Manual', and if you need more 
help, use R-sig-mac.

On 24/07/2014 02:25, Leonardo Gama wrote:
> Hi!
>
> I've just installed R on my OS X 10.9 and was trying to make
> arrayQualityMetrics package work. I've installed it via the biocLite
> Bioconductor script, and everything was apparently fine. But when I tried
> to load the package, I've got an issue with the Cairo package...
>
> Then I tried to load only Cairo:
>
>> library("Cairo")
>
> Error : .onLoad failed in loadNamespace() for 'Cairo', details:
>    call: dyn.load(file, DLLpath = DLLpath, ...)
>    error: unable to load shared object
> '/Library/Frameworks/R.framework/Versions/3.1/Resources/library/Cairo/libs/Cairo.so':
>
> dlopen(/Library/Frameworks/R.framework/Versions/3.1/Resources/library/Cairo/libs/Cairo.so,
> 6): Library not loaded: /opt/X11/lib/libXrender.1.dylib
>    Referenced from:
> /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Cairo/libs/Cairo.so
>    Reason: image not found
> Error: package or namespace load failed for 'Cairo'
>
>> traceback()
>
> 2: stop(gettextf("package or namespace load failed for %s",
> sQuote(package)),
>         call. = FALSE, domain = NA)
> 1: library(Cairo)
>
>
> Verified it version and dependencies:
>
>> packageDescription("Cairo")
>
> Package: Cairo
> Version: 1.5-6
> Title: [...]
> Author: Simon Urbanek <Simon.Urbanek at r-project.org>, Jeffrey Horner <
> jeff.horner at vanderbilt.edu>
> Maintainer: Simon Urbanek <Simon.Urbanek at r-project.org>
> Depends: R (>= 2.4.0)
> Suggests: png
> Enhances: FastRWeb
> Description: [...]
> SystemRequirements: cairo (>= 1.2 http://www.cairographics.org/)
> URL: http://www.rforge.net/Cairo/
> Packaged: 2014-06-26 14:50:25 UTC; svnuser
> NeedsCompilation: yes
> Repository: CRAN
> Date/Publication: 2014-06-26 17:15:22
> Built: R 3.1.0; x86_64-apple-darwin13.1.0; 2014-06-27 05:04:27 UTC;
>          unix
> -- File:
> /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Cairo/Meta/package.rds
>
>
> Tried to update it and got another error/warning:
>
>> upgrade.packages("Cairo")
>
> Warning message:
> In doTryCatch(return(expr), name, parentenv, handler) :
>    unable to load shared object
> '/Library/Frameworks/R.framework/Resources/modules//R_X11.so':
>    dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 6):
> Library not loaded: /opt/X11/lib/libSM.6.dylib
>    Referenced from:
> /Library/Frameworks/R.framework/Resources/modules//R_X11.so
>    Reason: image not found
>
>> traceback()
>
> No traceback available
>
>
> And finally:
>
>> sessionInfo()
>
> R version 3.1.1 (2014-07-10)
> Platform: x86_64-apple-darwin13.1.0 (64-bit)
>
> locale:
> [1] C/UTF-8/C/C/C/C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] tools_3.1.1
>> pack
> packBits               packageEvent           packageSlot
>   packageStatus
> package.skeleton       packageHasNamespace    packageSlot<-
>   packageVersion
> packageDescription     packageName            packageStartupMessage
>   package_version
>
>
> I've also verified the cairo.os file cited in the first error message, and
> it was there:
>
> $ file
> /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Cairo/libs/Cairo.so
>
> /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Cairo/libs/Cairo.so:
> Mach-O 64-bit dynamically linked shared library x86_64
>
> $ ls -lh
> /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Cairo/libs/Cairo.so
>
> -rwxrwxr-x  1 root  admin   3.2M Jun 27 02:04
> /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Cairo/libs/Cairo.so
>
>
> I have no idea of what's going wrong. Somebody could help me?
> Thank you, and sorry for the bad English.
>
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
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-help mailing list