[R] RJava lib error

Duncan Temple Lang duncan at research.bell-labs.com
Wed Jun 20 16:10:42 CEST 2001


Usually when I see an error about a missing symbol in ctest.so
it indicates 
  a) that I am running R embedded in another application.
    In this case the example runs Java and then loads R into it.
  b) The ctest package (and the other packages) were not recompiled
     to be linked against libR.so 

The problem is that ctest.so needs to be linked against libR.so to
find the symbols in R.  As Brian points out, MAIN_ is not a symbol it
looks for, so something more fundamental may be wrong.

Usually, ctest.so not being linked against libR.so happens when one
first builds R without the --enable-R-shlib configuration and then
afterwards, you reconfigure and rebuild with that option. The package
libraries do not get rebuilt and hence do not pick up the newly added
instructions to link with libR.so.


Brian's suggestion is the simplest fix - simply avoid loading
the ctest library.

The longer term fix is to recompile all of the packages.
The failsafe and slow way to do this is 
   cd $R_HOME
   make distclean
   ./configure --enable-R-shlib
   make

The quick shortcut is to remove the ctest.so in
both 
  $R_HOME/src/library/ctest/src/
and
  $R_HOME/library/ctest/libs

and then re-build the library.

The commands are

  rm $R_HOME/library/ctest/libs/ctest.so
  rm $R_HOME/library/ctest/libs/ctest.so
  rm src/ctest.so
  cd $R_HOME/src/library/ctest

Hope this helps.
  D.


Prof Brian D Ripley wrote:
> On Tue, 19 Jun 2001, Vahid Pazirandeh wrote:
> 
> > Hello all!
> >
> > I recently install R-1.2.3 and Omegahat SJava pkg
> > (formely Java pkg) 0.62 and tried running the examples
> > by issuing "scripts/RJava --example --gui=none" and I
> > got the following:
> >
> > Error in dyn.load(x, as.logical(local),
> > as.logical(now)) :
> >         unable to load shared library
> > "/usr/lib/R/library/ctest/libs/ctest.so":
> >   ld.so.1:
> > /usr/java1.2/bin/../jre/bin/../bin/sparc/native_threads/java:
> > fatal: relocation error: file
> > /usr/lib/R/library/ctest/libs/ctest.so: symbol MAIN__:
> > referenced symbol not found
> > [omegahat->R]
> > SIGSEGV   11*  segmentation violation
> >
> >
> > I've been trying to figure this problem out for a
> > while, but I haven't had any luck yet.  This occurs
> > for any R-Java program I run.. i install it onto two
> > different machines and they both yielded the same
> > errors:
> >
> > 1) 5.8 Generic sun4u sparc SUNW,Ultra-5_10
> > 2) 5.7 Generic_106541-12 sun4u sparc SUNW,Ultra-2
> 
> Solaris, right?
> 
> > Any assistance would be much appreciated.. I am truely
> > a newbie!
> 
> Something is wrong with your R build, I think, as on my Solaris 2.7
> system MAIN__ is not a symbol in ctest.so.
> 
> As a temporary fix, alter R_HOME/library/base/R/Rprofile to omit
> 
> .First <- function() {
>     require("ctest", quietly=TRUE)
> }
> 
> adn see if this allows you to proceed.
> 
> 
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272860 (secr)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-- 
_______________________________________________________________

Duncan Temple Lang                duncan at research.bell-labs.com
Bell Labs, Lucent Technologies    office: (908)582-3217
700 Mountain Avenue, Room 2C-259  fax:    (908)582-3340
Murray Hill, NJ  07974-2070       
         http://cm.bell-labs.com/stat/duncan
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list