Hi Peter,

Thanks for the reply. I don't have access to the package manager
unfortunately as I am working on a cluster where I don't have admin. So
everything has to installed into my ~/export CAIRO_LIBS=-L${HOME}/usr/local/
lib
export CAIRO_CFLAGS=-I${HOME}/usr/local/include
/local. I tried looking into homebrew/linuxbrew, but the gcc compiler
(4.1.2) is not suitable for linuxbrew and installing a new gcc compiler
isn't a simply endeavor from source.

I installed cairo from source specifically the
http://cairographics.org/releases/cairo-1.12.16.tar.xz download. What is
this cairo-devel you are referring to? It seems to be something related to
using the package manager?

In any case, your second point about the "-L for library directories, and
-I for
include directories" was actually useful. Rather than remove those lines
(as that didn't help), I modified my ~/.bashrc a bit (I am also limited in
my understanding paths)

export CAIRO_LIBS=-L${HOME}/usr/local/lib
export CAIRO_CFLAGS=-I${HOME}/usr/local/include

This actually got around that issue! But now I've run into another issue:

checking for pkg-config... /home/fong/usr/local/bin/pkg-config
configure: CAIRO_CFLAGS=-I/home/fong/usr/local/include/cairo
checking if R was compiled with the RConn patch... no
checking cairo.h usability... yes
checking cairo.h presence... yes
checking for cairo.h... yes
checking for PNG support in Cairo... yes
checking for ATS font support in Cairo... no
configure: CAIRO_LIBS=-L/home/fong/usr/local/lib
checking for library containing deflate... -lz
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'


On Mon, Apr 28, 2014 at 6:36 PM, Peter Langfelder <
peter.langfelder@gmail.com> wrote:

> Make sure you have cairo-devel installed, and remove the lines
>
> export CAIRO_LIBS=${HOME}/usr/local/lib
> export CAIRO_CFLAGS=${HOME}/usr/local/include
>
> from your .bashrc file. If you have cairo-devel installed normally,
> the headers should be found with default settings of all search paths.
> The settings you have are, to the best of my somewhat limited
> knowledge, wrong - you need to prefix each directory with an
> appropriate compiler flags (-L for library directories, and -I for
> include directories). Anyway, as I said, 1. install cairo-devel using
> your package manager, and 2. remove the two lines from .bashrc.
>
> Peter
>
>
> On Mon, Apr 28, 2014 at 12:26 PM, Fong Chun Chan <fongchunchan@gmail.com>
> wrote:
> > Hi,
> >
> > I am trying to get the R package Cairo installed. I've been successfully
> in
> > building the latest version of Cairo library (1.12.16,
> > http://cairographics.org/) from source and installed into ~/usr/local
> using
> >
> > ./configure --prefix=/home/fong/usr/local
> >
> > I set the my CAIRO_LIBS and CAIRO_CLAGS environment variables in my
> > ~/.bashrc:
> >
> > export CAIRO_LIBS=${HOME}/usr/local/lib
> > export CAIRO_CFLAGS=${HOME}/usr/local/include
> >
> > When I try to install Cairo in R using:
> >
> > install.packages('Cairo')
> >
> > I get the following error:
> >
> > checking for pkg-config... /home/fong/usr/local/bin/pkg-config
> > configure: CAIRO_CFLAGS=/home/fong/usr/local/include/cairo
> > checking if R was compiled with the RConn patch... no
> > checking cairo.h usability... no
> > checking cairo.h presence... no
> > checking for cairo.h... no
> > configure: error: Cannot find cairo.h! Please install cairo (
> > http://www.cairographics.org/) and/or set CAIRO_CFLAGS/LIBS
> correspondingly.
> > ERROR: configuration failed for package 'Cairo'
> >
> > But I can see the cairo.h header in /home/fong/usr/local/include/cairo. I
> > been trying to scouring the internet for answers, but I can't seem to
> find
> > any work for me. If anyone has any suggestions that would be helpful.
> >
> > Thanks
> >
> >> sessionInfo()
> > R version 3.1.0 (2014-04-10)
> > Platform: x86_64-unknown-linux-gnu (64-bit)
> >
> > locale:
> >  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
> > LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
> > LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
> >  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C
> >           LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8
> > LC_IDENTIFICATION=C
> >
> > attached base packages:
> > [1] stats     graphics  grDevices utils     datasets  methods   base
> >
> > other attached packages:
> > [1] vimcom.plus_0.9-93 setwidth_1.0-3     colorout_1.0-2
> >
> > loaded via a namespace (and not attached):
> > [1] tcltk_3.1.0 tools_3.1.0
> >
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help@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.
>

	[[alternative HTML version deleted]]

