2012-02-27 124 views
0

我搜索了並且無法真正找到答案。我有一個CentOS服務器,沒有和RHN連接。我需要安裝cairo和libcairo2才能使rapache工作。我找到了cairo tar文件,併成功安裝了它。當我試圖安裝R開羅包,它失敗與此錯誤:在CentOS上安裝cairo和libcairo2

 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. 

有人建議我失蹤libcairo2包。我搜遍了整個地方,無法找到這個包的centos。有任何想法嗎?附:我試圖在R中安裝R cairo軟件包,這個錯誤也是一樣的。

定位libcairo輸出:

/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 

我看到這些類型的config.log文件中的錯誤:

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 >&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' 
+0

'locate libcairo'說什麼? – 2012-02-27 17:24:47

+0

我把上面的輸出放在 – 2012-02-27 17:34:34

回答

1

locate可以找到庫中的事實表明,它成功地安裝。一個問題可能是,儘管它已安裝,但R無法找到它。檢查libcairo.so的位置是否在您的LD_LIBRARY_PATH

並且看看出了什麼問題,文件config.log說什麼?

+0

我試圖安裝r png包,那也不管用。 – 2012-02-27 20:19:18

+0

你安裝了哪個開羅版本? – 2012-02-27 23:29:27