R and Partial Evaluation with Graal

Juan Fumero juan.fumero at ed.ac.uk
Mon May 16 08:57:16 UTC 2016


Hi Jaroslav,
   Thanks a lot for the suggestion.  
   
I get the same error unless I use the suggested flag in the VM. I
understand this is the same that setting the JAVA_HOME to GraalVM. 

-juan


On Mon, 2016-05-16 at 09:06 +0200, Jaroslav Tulach wrote:
> Hello Juan,
> I think you can choose your JDK with:
> 
> fastr$ mx --java-home /path/to/graalvm R
> 
> -jt
> 
> 
> ### Sunday 15 of May 2016, 13:04:29 @ Juan Fumero ###
> > 
> > Hi all, 
> >   I am using the R version [1] in github. I saw there is no
> > dependency
> > now with Graal-core. Just Truffle instead. My question is how to
> > use
> > now the Graal JVMCI compiler. 
> > 
> > I compile with the graal-core [2] compiler separately. But when I
> > execute R I get this error:
> > 
> > <error>
> > $ mx R 
> > ..... 
> > Exception in thread "main" java.lang.InternalError
> > 	at com.oracle.truffle.api.Truffle$1.run(Truffle.java:103)
> > 	at com.oracle.truffle.api.Truffle$1.run(Truffle.java:58)
> > 	at java.security.AccessController.doPrivileged(Native Method)
> > 	at com.oracle.truffle.api.Truffle.initRuntime(Truffle.java:58)
> > 	at com.oracle.truffle.api.Truffle.<clinit>(Truffle.java:46)
> > 	at
> > com.oracle.truffle.api.impl.Accessor.<clinit>(Accessor.java:321)
> > 	at
> > com.oracle.truffle.api.vm.PolyglotEngine.<clinit>(PolyglotEngine.ja
> > va:1
> > 07)
> > 	at
> > com.oracle.truffle.r.engine.shell.RCommand.readEvalPrint(RCommand.j
> > ava:
> > 191)
> > 	at
> > com.oracle.truffle.r.engine.shell.RCommand.main(RCommand.java:85)
> > Caused by: java.lang.reflect.InvocationTargetException
> > 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > 	at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
> > l.ja
> > va:62)
> > 	at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
> > esso
> > rImpl.java:43)
> > 	at java.lang.reflect.Method.invoke(Method.java:498)
> > 	at com.oracle.truffle.api.Truffle$1.run(Truffle.java:100)
> > 	... 8 more
> > Caused by: java.lang.NoClassDefFoundError:
> > com/oracle/truffle/api/TruffleRuntimeAccess  (suppress with
> > -Djvmci.service.suppressNoClassDefFoundError=true)
> > 	at jdk.vm.ci.services.Services$1.computeValue(Services.java:59)
> > 
> > 	at jdk.vm.ci.services.Services$1.computeValue(Services.java:50)
> > 
> > 	at java.lang.ClassValue.getFromHashMap(ClassValue.java:227)
> > 	at java.lang.ClassValue.getFromBackup(ClassValue.java:209)
> > 	at java.lang.ClassValue.get(ClassValue.java:115)
> > 	at jdk.vm.ci.services.Services.loadSingle(Services.java:120)
> > 	... 13 more
> > Caused by: java.lang.ClassNotFoundException:
> > com.oracle.truffle.api.TruffleRuntimeAccess
> > 	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> > 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> > 	at
> > java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:814)
> > 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> > 	at java.lang.ClassLoader.defineClass1(Native Method)
> > 	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
> > 	at
> > java.security.SecureClassLoader.defineClass(SecureClassLoader.java:
> > 142)
> > 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
> > 
> > 	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
> > 	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
> > 	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
> > 	at java.security.AccessController.doPrivileged(Native Method)
> > 	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
> > 	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> > 	at
> > java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:814)
> > 	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> > 	at jdk.vm.ci.services.Services.getServiceImpls(Native Method)
> > 	at jdk.vm.ci.services.Services.access$000(Services.java:37)
> > 	at jdk.vm.ci.services.Services$1.computeValue(Services.java:54)
> > 
> > 	... 18 more\
> > </error>
> > 
> > So I run with the option suggested in the error:
> > 
> > $ mx -v R --J @'-Djvmci.service.suppressNoClassDefFoundError=true '
> > myScript.R 
> > 
> > I can run FastR but,  is this the use of  the Partial Evaluator in
> > Graal through the OptimizedCallTarget? 
> > 
> > [1] https://github.com/graalvm/fastr 
> > [2] https://github.com/graalvm/graal-core/commit/071173a4a61247df08
> > 26a0
> > 1db20bf7b381f1bbfe 
> > 
> > Thanks
> > -juan
> 

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the graal-dev mailing list