[R-SIG-Mac] unable to load shared library grDevices.so

Jack Zhu zhujack at mail.nih.gov
Tue Feb 20 00:22:53 CET 2007


Hi all,

I tired to run R shell command in an web PHP application.  I always get an
error. I can run the same R command in terminal with no problem:

$ R --vanilla -q < R.cmd 1>R.output 2>R.log &

My system: Intel Dual-core Xeon wit Mac OS X 10.4.8
My R: 2.4.1
XAMPP is used.

This is  the error in R.log file:

**********************
Error in dyn.load(x, as.logical(local), as.logical(now)) :
    unable to load shared library
'/Library/Frameworks/R.framework/Resources/library/grDevices/libs/i386/grDev
ices.so':
  
dlopen(/Library/Frameworks/R.framework/Resources/library/grDevices/libs/i386
/grDevices.so, 6): Symbol not found: __cg_jpeg_save_markers
  Referenced from: 
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Framewor
ks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /Applications/xampp/xamppfiles/lib/libJPEG.dylib
Loading required package: grDevices
Error in dyn.load(x, as.logical(local), as.logical(now)) :
    unable to load shared library
'/Library/Frameworks/R.framework/Resources/library/grDevices/libs/i386/grDev
ices.so':
  
dlopen(/Library/Frameworks/R.framework/Resources/library/grDevices/libs/i386
/grDevices.so, 6): Symbol not found: __cg_jpeg_save_markers
  Referenced from: 
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Framewor
ks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /Applications/xampp/xamppfiles/lib/libJPEG.dylib
In addition: Warning message:
package grDevices in options("defaultPackages") was not found
Error: package 'grDevices' could not be loaded
Execution halted
*********************

This is the PHP code:

***********************

<?php
    
    

     $rpath = '/Applications/xampp/htdocs/test/';


    $R_output = intval(shell_exec("R --vanilla -q < {$rpath}R.cmd
1>{$rpath}R.output 2>{$rpath}R.log & echo $!"));


    echo "<pre>$R_output</pre>";



?>  

*************************

Your help will be greatly appreciated.

Jack Zhu

E-mail: zhujack at mail.nih.gov



More information about the R-SIG-Mac mailing list