3

I locally download the package and atempt to install it but I get this error:

    R CMD INSTALL -l /usr/local/lib64/R/library Cairo_1.5-1.tar.gz

I get his error:

   checking for PNG support in Cairo... yes
   checking for ATS font support in Cairo... no
    configure: CAIRO_LIBS=-L/usr/local/lib -lcairo
    checking for library containing deflate... no
     checking whether Cairo programs can be compiled... configure: error: Cannot     
    compile a simple Cairo program. See config.log for details.
    ERROR: configuration failed for package 'Cairo'
   * removing '/usr/local/lib64/R/library/Cairo'

any ideas? thanks

george willy
  • 1,693
  • 8
  • 22
  • 26
  • I assume because you don't have libcairo2 installed? But you could check config.log for details it would seem. Also, you might get more descriptive error messages if you install from within `R` using `install.packages('Cairo')` – Justin Feb 24 '12 at 20:08
  • when I tried to install it withing R, the same error. libcairo2 is not installed. my server does not have any internet connection, do you know where I can get this libcairo2 to locally installed. – george willy Feb 24 '12 at 20:43
  • [here ...](http://bit.ly/xTlYDI) – Justin Feb 24 '12 at 20:45
  • so... why doesn't that work? download it to your machine, scp it to the server and away you go! – Justin Feb 24 '12 at 20:58
  • I do see lots of them for ubuntu and debian but couln't find anything for centos. really frustrating. – george willy Feb 24 '12 at 21:33
  • 1
    Sounds like a good question for a Centos forum! Sorry I can't be of more help, but you're closer to solving the problem! – Justin Feb 24 '12 at 21:49
  • As mentioned in a previous comment, the error tells you to _see config.log for details._ This looks like a good first move to find a more detailed (and probably more useful as well) error message. – Calimo Oct 15 '13 at 06:46

2 Answers2

5

I managed to install Cairo on R for linux (version 3.0.2) by first installing the libcairo2 package from terminal:

    sudo apt-get install libcairo2-dev

Then, open R and install Cairo using

    install.packages("Cairo")
Thomas
  • 51
  • 1
  • 2
  • I know this answer is old, but still relevant; you need to ensure you know what package manager you are using and look up the distribution version of the cairo dev package (ie likely to be something else on non debian based Linux system, Red Hat rpm package is cairo-devel) – thoroc Nov 21 '19 at 09:06
1

I had to install x11 libraries for Linux and was able to compile Cairo.

george willy
  • 1,693
  • 8
  • 22
  • 26
  • can you give a little more detail, what libraries did you need to install? – DVL Mar 28 '19 at 16:15
  • On macOS, I needed to run `brew install libxt` (libXt is X Toolkit Intrinsicts). – nisetama May 05 '21 at 15:39
  • As per [this post](https://stackoverflow.com/questions/41212693/motif-compiling-error-x11-intrinsic-h-missing), `apt-get install libxt-dev` should sort it on Debian/Ubuntu. – Nicholas Jul 28 '23 at 15:13