[Quantian-general] Quantian and Java

Dirk Eddelbuettel edd at debian.org
Sun Mar 19 03:46:23 UTC 2006


Hi Ben,

On 18 March 2006 at 22:13, Ben Goodrich wrote:
| Hi all,
| 
| First, great job on the latest couple versions of Quantian. I can't wait 
| for the Quantian based on Knoppix 5.0.

Yes, what I read about Knoppix 5.0 is very intriguing. I hope I'll have time
and energy to build Quantian on top of it once 5.0 comes out officially ...
 
| But I am having a problem with the rJava library for R (needed for JGR) 
| in Quantian_0.7.9.2. It seems to be a Java problem. I do library(JGR) or 
| library(rJava) and get:
| 
| Error in dyn.load ...
| unable to load ... rJava.so
| libjvm.so: cannot open shared object file: No such file or directory

I noticed that too post-release.  However, the good news is that this seems
to happen only when you start R directly, or via ESS, and can be circumvented
(see below).  I suspect that because nobody tells R (at run-time) where the
Java libraries are, libjvw.so is not found.

Two or three fixes:

a) start JGR directly, then load rJava, ie in a shell window / terminal

	$ JGR				# and then inside JGR
	> library(rJava)

   and all is well as far as I can tell.

b) [ untested ] add one of the directory that contains libjvw.so to 
   the entries in /etc/ld.so.conf
	/usr/lib/j2se5.0-sun/jre/lib/i386/server/libjvm.so
	/usr/lib/j2se5.0-sun/jre/lib/i386/client/libjvm.so
   and run ldconfig

c) [ untested ] set the LD_LIBRARY_PATH variable before starting R

With b) or c) you should be able to work from ESS / R directly. You can
probably also set a JAVA_HOME or similar variable. Is that documented
somewhere for JGR or rJava?  I'll CC Simon just in case ...

| I haven't looked into this all that much. Does rJava presume the 
| non-free Sun version or is it merely a configuration issue with gcj?

rJava and JGR use Sun's Java, and find it during buildtime. The info they
need sits outside R, in JGR's case in the JGR shell script.

| More generally, can any think of a script to test that all the R 
| packages actually load correctly?
| 
| In R, you could do something like
| 
| ip <- installed.packages()
| for(i in 1:nrow(ip)) require(ip[i,1], character.only = TRUE)
| 
| But the loop fails when it encounters a faulty package (one of them 
| causes a segmentation fault). You can start the loop over where it 

Which one? 

| breaks, but eventually you run into the maximum number of dynamically 
| loaded libraries. There must be a better approach.

Well I am _building_ them all in the chroot so at least they build which
typically entails running the examples in the documentation. R is pretty
clever that way.

That said, contributed unit or regression tests can only improve Quantian so
please do consider writing and contributing some :)

Thanks for the feedback. It is good to know that someone appreciates all the
new Java goodies in Quantian ;-)

Regards, Dirk

-- 
Hell, there are no rules here - we're trying to accomplish something. 
                                                  -- Thomas A. Edison



More information about the Quantian-general mailing list