title: install cairo and libcairo2 on CentOS
body: <p>I searched and could not really find an answer for this. I have a CentOS server that does not have and RHN connectivity. I need to install cairo and libcairo2 to make rapache work. I did find the cairo tar file, and installed it sucessfully. When I attempted to install R cairo package, it failed with this error:</p>
  
  <pre><code>      R CMD INSTALL -l /usr/local/lib64/R/library  Cairo_1.5-1.tar.gz
        error: checking whether Cairo programs can be compiled... configure: error: Cannot compile a simple Cairo program. See config.log for details.
  </code></pre>
  
  <p>Someone suggested that I'm missing libcairo2 package. I searched all over the place and cannot find this package for centos. Any ideas? P.S. I tried to install the R cairo package within R, the same exact error.</p>
  
  <p>locate libcairo output:</p>
  
  <pre><code>    /usr/lib/libcairo.so.2
       /usr/lib/libcairo.so.2.9.2
       /usr/lib64/libcairo.a
       /usr/lib64/libcairo.so
      /usr/lib64/libcairo.so.2
      /usr/lib64/libcairo.so.2.9.2
      /usr/local/lib/libcairo-script-interpreter.a
     /usr/local/lib/libcairo-script-interpreter.la
     /usr/local/lib/libcairo-script-interpreter.so
      /usr/local/lib/libcairo-script-interpreter.so.2
      /usr/local/lib/libcairo-script-interpreter.so.2.11000.0
      /usr/local/lib/libcairo.a
      /usr/local/lib/libcairo.la
      /usr/local/lib/libcairo.so
      /usr/local/lib/libcairo.so.2
      /usr/local/lib/libcairo.so.2.11000.0
      /usr/local/lib/cairo/libcairo-trace.a
      /usr/local/lib/cairo/libcairo-trace.la
     /usr/local/lib/cairo/libcairo-trace.so
     /usr/local/lib/cairo/libcairo-trace.so.0
     /usr/local/lib/cairo/libcairo-trace.so.0.0.0
  </code></pre>
  
  <p>I see these type of errors in config.log file:</p>
  
  <pre><code>configure:3631: checking whether Cairo programs can be compiled
  configure:3645: gcc -std=gnu99 -o conftest -g -O2  -I/usr/local/include/cairo   conftest.c  -L/usr/local/lib -lcairo &gt;&amp;5
  
  /usr/local/lib/libcairo.so: undefined reference to `png_create_read_struct'
  /usr/local/lib/libcairo.so: undefined reference to `png_set_write_user_transform_fn'
  /usr/local/lib/libcairo.so: undefined reference to `png_set_bKGD'
  /usr/local/lib/libcairo.so: undefined reference to `png_get_valid'
  /usr/local/lib/libcairo.so: undefined reference to `png_set_write_fn'
  /usr/local/lib/libcairo.so: undefined reference to `png_get_error_ptr'
  /usr/local/lib/libcairo.so: undefined reference to `png_set_filler'
  /usr/local/lib/libcairo.so: undefined reference to `png_read_update_info'
  /usr/local/lib/libcairo.so: undefined reference to `png_set_read_fn'
  /usr/local/lib/libcairo.so: undefined reference to `png_create_info_struct'
  /usr/local/lib/libcairo.so: undefined reference to `png_set_packing'
  /usr/local/lib/libcairo.so: undefined reference to `png_set_strip_16'
  /usr/local/lib/libcairo.so: undefined reference to `png_set_tRNS_to_alpha'
  /usr/local/lib/libcairo.so: undefined reference to `png_error'
  /usr/local/lib/libcairo.so: undefined reference to `png_write_image'
  /usr/local/lib/libcairo.so: undefined reference to `png_set_interlace_handling'
  /usr/local/lib/libcairo.so: undefined reference to `png_read_end'
  /usr/local/lib/libcairo.so: undefined reference to `png_set_expand_gray_1_2_4_to_8'
  /usr/local/lib/libcairo.so: undefined reference to `png_set_longjmp_fn'
  /usr/local/lib/libcairo.so: undefined reference to `png_read_image'
  </code></pre>