Skip to content
Prev 11800 / 398502 Next

RJava lib error

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:

  
    
Message-ID: <20010620101042.A21693@jessie.research.bell-labs.com>
In-Reply-To: <Pine.GSO.4.31.0106200719160.29276-100000@auk.stats>; from ripley@stats.ox.ac.uk on Wed, Jun 20, 2001 at 07:23:21AM +0100