notes_compil_r

Ceci est une ancienne révision du document !


Version 2.4.1

Version 2.6.1

Le script pour compiler

> cat do_work32.sh 
#!/bin/sh
PATH=/usr/local/wrapper/bin:/opt/studio12/SUNWspro/bin:/opt/SUNWhpc/bin:/usr/ccs/bin:$PATH:/opt/csw/bin; export PATH

./configure --prefix=$HOME/lib \
 --enable-threads=solaris \
--with-blas \
--with-lapack \
--with-system-zlib \
--with-libpth-prefix=/opt/csw/ \
BLAS_LIBS=-xlic_lib=sunperf \
LAPACK_LIBS=-xlic_lib=sunperf \
LDFLAGS='-R/opt/csw/lib -L/opt/csw/lib' \
CPPFLAGS=-I/opt/csw/include

# make uninstall; make distclean; echo "make clean"; make clean

echo "make"; make
if [ $? -ne 0 ];then echo "make failed"; exit; fi

echo "make check"; make check
if [ $? -ne 0 ];then echo "make check failed"; exit; fi

echo "make install"; make install
if [ $? -ne 0 ];then echo "make install failed"; exit; fi

Le check échoue!? Pour lancer, voir le script /bin/R26

> library(JGR)
Loading required package: rJava
Loading required package: JavaGD
Loading required package: iplots
Java Accessibility Bridge for GNOME loaded.


Please use the corresponding JGR launcher to start JGR.
Run JGR() for details. You can also use JGR(update=TRUE) to update JGR.

> JGR()
Starting JGR ...
(You can use /local/apps/lib/lib/R/library/JGR/scripts/run to start JGR directly)
> Exception in thread "main" java.lang.NoClassDefFoundError: org/rosuda/JRI/RMainLoopCallbacks
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at RJavaClassLoader.findClass(RJavaClassLoader.java:137)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2395)
        at java.lang.Class.getMethod0(Class.java:2642)
        at java.lang.Class.getMethod(Class.java:1579)
        at RJavaClassLoader.bootClass(RJavaClassLoader.java:289)
        at RJavaClassLoader.main(RJavaClassLoader.java:326)

pourtant, il est installé:

> find  /local/apps/lib/ -name "JRI*"
/local/apps/lib/lib/R/library/rJava/jri/JRI.jar

Après avoir hacké le script de lancement (voir hacks), il y a un problème au lancement:

> bash /local/apps/lib/lib/R/library/JGR/scripts/run
Java Accessibility Bridge for GNOME loaded.

Cannot find JRI native library!

java.lang.UnsatisfiedLinkError: /local/apps/lib/lib/R/library/rJava/jri/libjri.so: Can't load IA 32-bit .so on a IA 32-bit platform
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1660)
        at java.lang.Runtime.loadLibrary0(Runtime.java:822)
        at java.lang.System.loadLibrary(System.java:993)
        at org.rosuda.JGR.JGR.<init>(JGR.java:173)
        at org.rosuda.JGR.JGR.main(JGR.java:514)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at RJavaClassLoader.bootClass(RJavaClassLoader.java:290)
        at RJavaClassLoader.main(RJavaClassLoader.java:326)
> 
et pourtant, la lib est bien présente!

voir Can't load IA 32-bit .so on a IA 32-bit platform

/local/apps/lib/lib/R/library
* Installing *source* package 'rJava' ...
checking for gcc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for grep that handles long lines and -e... /usr/xpg4/bin/grep
checking for egrep... /usr/xpg4/bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether cc supports static inline...
yes
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver    : '/usr/bin/jar'
compiler    : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags   : '-I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris'
java libs   : '-L/usr/jdk/instances/jdk1.5.0/jre/lib/i386/server -L/usr/jdk/instances/jdk1.5.0/jre/lib/i386 -L/usr/jdk/instances/jdk1.5.0/jre/../lib/i386 -L/opt/csw/lib -L/usr/lib -ljvm'
checking whether JNI programs can be compiled... yes
checking JNI data types... ok
checking whether JRI should be compiled (autodetect)... yes
checking whether debugging output should be enabled... no
checking whether memory profiling is desired... no
checking whether threads support is requested... no
checking whether callbacks support is requested... no
checking whether JNI cache support is requested... no
checking whether JRI is requested... yes
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/zzz.R
config.status: creating src/config.h
=== configuring in jri (/tmp/R.INSTALL.q3ayQx/rJava/jri)
configure: running /bin/bash ./configure '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
checking build system type... i386-pc-solaris2.10
checking host system type... i386-pc-solaris2.10
checking for gcc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... no
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for grep that handles long lines and -e... /usr/xpg4/bin/grep
checking for egrep... /usr/xpg4/bin/grep -E
checking for ANSI C header files... yes
checking whether Java interpreter works... checking whether JNI programs can be compiled... yes
checking whether JNI programs can be run... yes
checking JNI data types... ok
checking whether Rinterface.h exports R_CStackXXX variables... yes
checking whether Rinterface.h exports R_SignalHandlers... yes
configure: creating ./config.status
config.status: creating src/Makefile
config.status: creating Makefile
config.status: creating run
config.status: creating src/config.h
** libs
cc -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include  -I/opt/csw/include   -I. -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -KPIC  -g -c Rglue.c -o Rglue.o
cc -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include  -I/opt/csw/include   -I. -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -KPIC  -g -c arrayc.c -o arrayc.o
cc -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include  -I/opt/csw/include   -I. -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -KPIC  -g -c callJNI.c -o callJNI.o
cc -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include  -I/opt/csw/include   -I. -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -KPIC  -g -c callback.c -o callback.o
cc -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include  -I/opt/csw/include   -I. -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -KPIC  -g -c fields.c -o fields.o
cc -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include  -I/opt/csw/include   -I. -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -KPIC  -g -c init.c -o init.o
"init.c", line 106: warning: assignment type mismatch:
        pointer to void "=" pointer to function(pointer to struct __FILE {int _cnt, pointer to unsigned char _ptr, pointer to unsigned char _base, unsigned char _flag, unsigned char _file, unsigned int __orientation :2, unsigned int __ionolock :1, unsigned int __seekable :1, unsigned int __extendedfd :1, unsigned int __xf_nocheck :1, unsigned int __filler :10}, pointer to const char, pointer to void) returning int
"init.c", line 110: warning: assignment type mismatch:
        pointer to void "=" pointer to function(int) returning void
cc -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include  -I/opt/csw/include   -I. -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -KPIC  -g -c jri_glue.c -o jri_glue.o
cc -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include  -I/opt/csw/include   -I. -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -KPIC  -g -c loader.c -o loader.o
cc -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include  -I/opt/csw/include   -I. -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -KPIC  -g -c rJava.c -o rJava.o
cc -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include  -I/opt/csw/include   -I. -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -KPIC  -g -c tools.c -o tools.o
cc -G -R/opt/csw/lib -L/opt/csw/lib -o rJava.so Rglue.o arrayc.o callJNI.o callback.o fields.o init.o jri_glue.o loader.o rJava.o tools.o -L/usr/jdk/instances/jdk1.5.0/jre/lib/i386/server -L/usr/jdk/instances/jdk1.5.0/jre/lib/i386 -L/usr/jdk/instances/jdk1.5.0/jre/../lib/i386 -L/opt/csw/lib -L/usr/lib -ljvm  -L/local/apps/lib/lib/R/lib -lR
make -C ../jri/
make[1]: Entering directory `/tmp/R.INSTALL.q3ayQx/rJava/jri'
make -C src JRI.jar
make[2]: Entering directory `/tmp/R.INSTALL.q3ayQx/rJava/jri/src'
/usr/bin/javac -target 1.4 -source 1.4 -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java
/usr/bin/javah -d . -classpath . org.rosuda.JRI.Rengine
cc -c -o Rengine.o Rengine.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g  -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris  -KPIC -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include
cc -c -o jri.o jri.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g  -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris  -KPIC -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include
cc -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g  -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris  -KPIC -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include
cc -c -o Rinit.o Rinit.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g  -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris  -KPIC -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include -I/local/apps/lib/lib/R/include
cc -c -o globals.o globals.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g  -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris  -KPIC -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris
cc -c -o rjava.o rjava.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -g  -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris  -KPIC -I/usr/jdk/instances/jdk1.5.0/jre/../include -I/usr/jdk/instances/jdk1.5.0/jre/../include/solaris
cc -o libjri.so Rengine.o jri.o Rcallbacks.o Rinit.o globals.o rjava.o  -G -L/usr/jdk/instances/jdk1.5.0/jre/lib/i386/server -L/usr/jdk/instances/jdk1.5.0/jre/lib/i386 -L/usr/jdk/instances/jdk1.5.0/jre/../lib/i386 -L/opt/csw/lib -L/usr/lib -ljvm -L/local/apps/lib/lib/R/lib -lR
/usr/bin/javac -target 1.4 -source 1.4 -d . ../Mutex.java ../RBool.java ../RConsoleOutputStream.java ../REXP.java ../RFactor.java ../RList.java ../RMainLoopCallbacks.java ../RVector.java ../Rengine.java
/usr/bin/jar fc JRI.jar org libjri.so
make[2]: Leaving directory `/tmp/R.INSTALL.q3ayQx/rJava/jri/src'
rm -f libjri.so
cp src/libjri.so libjri.so
/usr/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest.java
Note: examples/rtest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/usr/bin/javac -target 1.4 -source 1.4 -classpath src/JRI.jar -d examples examples/rtest2.java
Note: examples/rtest2.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
make[1]: Leaving directory `/tmp/R.INSTALL.q3ayQx/rJava/jri'
** R
** inst
** preparing package for lazy loading
** help
 >>> Building/Updating help pages for package 'rJava'
     Formats: text html latex example 
  accessOp                          text    html    latex   example
  jarray                            text    html    latex   example
  jarrayRef-class                   text    html    latex
  jcall                             text    html    latex   example
  jcast                             text    html    latex   example
  jcastToArray                      text    html    latex   example
  jcheck                            text    html    latex   example
  jengine                           text    html    latex   example
  jequals                           text    html    latex   example
  jfield                            text    html    latex   example
  jfloat-class                      text    html    latex
  jfloat                            text    html    latex
  jinit                             text    html    latex   example
  jmemprof                          text    html    latex   example
  jnew                              text    html    latex   example
  jnull                             text    html    latex   example
  jobjRef-class                     text    html    latex
  jpackage                          text    html    latex   example
  jreflection                       text    html    latex   example
  jsimplify                         text    html    latex   example
  loader                            text    html    latex   example
  show                              text    html    latex
** building package indices ...
* DONE (rJava)

The downloaded packages are in
        /tmp/Rtmp2l3U0E/downloaded_packages
Updating HTML index of packages in '.Library'

dans /local/apps/lib/lib/R/bin/javareconf, on remplace /bin/sh par /bin/bash
dans /local/apps/lib/bin/R, on remplace /bin/sh par /bin/bash (est ce nécessaire?)

  • notes_compil_r.1200827000.txt.gz
  • Dernière modification : 2017/08/25 09:55
  • (modification externe)