[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: JGR with free java (was: GUI for R)



On Sunday 22 October 2006 11:51, Andrew Haley wrote:
>  > But it fails because of this call:
>  >
>  > /usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0/bin/javac -target 1.4 -source
>  > 1.4 -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples
>  > examples/rtest.java
>  >
>  > Note the duplicate '-target 1.4 -source 1.4', which is OK for the Sun
>  > javac, but breaks compiling with gcj 4.1 javac.
>
> What is javac here? 

See code above:

/usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0/bin/javac

with:

$ ls -la /usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0/bin/javac
lrwxrwxrwx 1 root root 12 2006-10-20 
17:04 /usr/lib/jvm/java-1.4.2-gcj-4.1-1.4.2.0/bin/javac -> /usr/bin/ecj

<snip>

> If it's a link to ecj, which it should be, this will work.

How?

$ /usr/bin/ecj -target 1.4 -source 1.4 -target 1.4 -source 1.4 -classpath 
src/JRI.jar -d examples examples/rtest.java

Gives:

duplicate target compliance setting specification: 1.4

where:

$ /usr/bin/ecj -version
Eclipse Java Compiler v_677_R32x, 3.2.1 release, Copyright IBM Corp 2000, 
2006. All rights reserved.

Actually, instead of commenting out that line in Makefile.all, you can also 
just remove the $(JFLAGS) to get:

examples/%.class: examples/%.java src/JRI.jar
        $(JAVAC) -classpath src/JRI.jar -d examples $<

The first "-target 1.4 -source 1.4" is part of the $(JAVAC) var.

>  > which fails with:
>  >
>  > Error in dyn.load(x, as.logical(local), as.logical(now)) :
>  >         unable to load shared
>  > library '/usr/local/lib/R/site-library/rJava/libs/rJava.so':
>  >   libjvm.so: cannot open shared object file: No such file or directory
>  > Error in library(rJava) : .First.lib failed for 'rJava'
>  >
>  > Not sure what else I can/should try now. Ideas?
>
> Did you install rJava.so? 

Yes, using the R CMD INSTALL call in my first email.

> If so, where is it? 

See the above error message:

/usr/local/lib/R/site-library/rJava/libs/rJava.so

$ ls -al /usr/local/lib/R/site-library/rJava/libs/rJava.so
-rwxr-xr-x 1 egonw staff 128075 2006-10-22 
12:37 /usr/local/lib/R/site-library/rJava/libs/rJava.so


> Did it even get built?  

Yes.

The patch to apply to the source to get it compiled and installed now looks 
like:

=============================================================================
diff -ru rJava-orig/jri/Makefile.all rJava/jri/Makefile.all
--- rJava-orig/jri/Makefile.all 2006-10-11 01:52:35.000000000 +0200
+++ rJava/jri/Makefile.all      2006-10-22 12:39:47.000000000 +0200
@@ -28,7 +28,7 @@
        cp $< $@

 examples/%.class: examples/%.java src/JRI.jar
-       $(JAVAC) $(JFLAGS) -classpath src/JRI.jar -d examples $<
+       $(JAVAC) -classpath src/JRI.jar -d examples $<

 clean:
        $(MAKE) -C src clean
diff -ru rJava-orig/src/Makevars.in rJava/src/Makevars.in
--- rJava-orig/src/Makevars.in  2006-10-11 01:52:30.000000000 +0200
+++ rJava/src/Makevars.in       2006-10-22 12:39:36.000000000 +0200
@@ -14,5 +14,5 @@
 jri:
        $(MAKE) -C ../jri/
        -@mkdir -p ../inst/jri
-       
@(cp -r ../jri/src/JRI.jar ../jri/*jri.* ../jri/run ../jri/examples ../inst/jri/)
+       
@(cp -r ../jri/src/JRI.jar ../jri/*jri.* ../jri/examples ../jri/run ../inst/jri/)

=============================================================================

Egon

-- 
e.willighagen@science.ru.nl
Cologne University Bioinformatics Center (CUBIC)
Blog: http://chem-bla-ics.blogspot.com/
GPG: 1024D/D6336BA6



Reply to: