beltrand
2012-Mar-14 06:02 UTC
[R] cannot load shared object /usr/lib/R/library/grDevices/libs//cairo.so
Hi, I am trying to test out the scripts here as a proof of concept http://www.r-bloggers.com/integrating-php-and-r/ However, I am not able to reproduce the output graph in the browser. Rscripts is working fine as I run the command "Rscript /home/username/R/testscript.R 1000" for example, and a png graph is output as expected, and I can output it to any folder where I have permission by changing testscript.R. However I am not able to get the output on the browser.I checked the web root on my test server (xampp for Linux) and found that a pdf file is created instead (Rplots.pdf) I checked xampp's error log and found these, I think it is the reason why a png graph is not created by using php's exec() command. "unable to load shared object '/usr/lib/R/library/grDevices/libs//cairo.so': /usr/lib/i386-linux-gnu/libfontconfig.so.1: undefined symbol: FT_Select_Size" I notice that there are two forward slashes in "..grDevices/libs//cairo.so" whereas it should be just "..grDevices/libs/cairo.so" I am wondering if this is a problem. Also it seemed to be working before. It somehow stops today. I am using Ubuntu 11.04 and R 2.14.2 (from this ppa https://launchpad.net/~marutter/+archive/rrutter) and my test server is xampp for Linux, I would appreciate any help. Thank you. -- View this message in context: http://r.789695.n4.nabble.com/cannot-load-shared-object-usr-lib-R-library-grDevices-libs-cairo-so-tp4471075p4471075.html Sent from the R help mailing list archive at Nabble.com.
beltrand
2012-Mar-15 20:53 UTC
[R] cannot load shared object /usr/lib/R/library/grDevices/libs//cairo.so
I have figured it out. It turns out that it is not a R problem. libfontconfig.so.1 links to libfreetype, it happens that there are two sets of libfreetype files in my system, one from Ubuntu and another from xampp. When the php script is run to invoke R it uses the libfreetype files in /opt/lampp/lib which are out of date, so R/cairo.so could not load. Copying the updated version of libfreetype* from /usr/lib/i386-linux-gnu/ into /opt/lampp/lib overwritting the outdated version solved the problem. I suppose I could also change some environmental variables with something like export LD_LIBRARY_PATH/usr/lib/i386-linux-gnu/ -- View this message in context: http://r.789695.n4.nabble.com/cannot-load-shared-object-usr-lib-R-library-grDevices-libs-cairo-so-tp4471075p4476382.html Sent from the R help mailing list archive at Nabble.com.