[ncl-install] cairo

Mary Haley haley at ucar.edu
Sun Jul 21 09:40:19 MDT 2013


On Jul 21, 2013, at 2:47 AM, fereshteh komijani <fereshtehkomijani at gmail.com> wrote:

> hi
> i was compiling my own program that some errors like : undefined reference to `cairo_xlib_surface_get_display arised. therefore i decide to install cairo and its requires. i use your constructions and add 
> export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
>   export LD_LIBRARY_PATH=/usr/local/cairo/lib
>   export PATH=/usr/local/bin:$PATH
> to .bashrc file
> 1- are the place for adding those paths correct?

You said you are "compiling my own program" but you didn't indicate what kind of program this is.  Do you mean an NCAR Graphics or HLU program? Or are you trying to build NCL and NCAR Graphics from scratch? It would help if you include more details here, along with what your compile line looks like, and the exact errors you get.'

The PKG_CONFIG and PATH paths are correct if you installed pkg-config to /usr/local. That is, if you used "/usr/local" as the value to the "--prefix" option.

The LD_LIBRARY_PATH shouldn't normally need to be set, unless you have cairo installed to /usr/local and your program can't find the "libcairo.so.x" file. This is a run-time environment variable, however, and should only be set if when you are trying to run a program, and it complains that it can't find certain "libxxxx.so" files.

If you are getting undefined references to cairo routines during the compile phase, then you likely need to include a "-L/usr/local/lib -lcairo" at the end of your compile line to help the compiler find the location of the cairo libraries. This will likely not be enough, however, because cairo has several dependencies on other libraries, like pixman-1, fontconfig, freetype, etc.


> 2-in last section for installing cairo, you write that i should add bin to search path like:
> 
> export PATH=/usr/local/bin:$PATH
>   which pkg-config
> you mean that i should add which pkg-config as well as 
> export PATH=/usr/local/bin:$PATH to .bashrc?

You only need the export command. The "which pkg-config" command is simply to help you determine if the PATH has been set correctly. 
When you type:

   which xxxx

where "xxxx" is some UNIX command or program like "ls" or "pkg-config", then you will either get an error that 
says something like:

   pkg-config: Command not found

or the path to the command will be echoed, like:

/usr/local/bin/pkg-config


--Mary
> thanks
> 
> 
> 
> 
> -- 
> **Angel**
>  
>  
> _______________________________________________
> ncl-install mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-install

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-install/attachments/20130721/d12587f9/attachment.html 


More information about the ncl-install mailing list