I just recently setup a Centos7 VM to play around with GraalVM. I downloaded graalvm-1.0.0-rc1, installed Netbeans8.2, and downloaded the FastR extension (via gu). I then wrote a simple java program to test some of the various supported languages. Below is the code I wrote:
package javatest;
import org.graalvm.polyglot.*;
import java.io.PrintStream;
import java.util.Set;
public class JavaTest {
public static void main(String[] args) {
PrintStream output = System.out;
Context context = Context.create();
Set<String> languages = context.getEngine().getLanguages().keySet();
output.println("Current Languages available in GraalVM: " + languages);
// TODO code application logic here
System.out.println("Java: Hello World");
context.eval("js","print('JavaScript: Hello World')");
context.eval("R", "print('R: Hello World');");
}
}
Output is as follows:
run:
Current Languages available in GraalVM: [R, js, llvm]
Java: Hello World
JavaScript: Hello World
FastR unexpected failure: error loading libR from: /usr/local/graalvm-1.0.0-
rc1/jre/languages/R/lib/libR.so.
If running on NFI backend, did you provide location of libtrufflenfi.so as
value of system property 'truffle.nfi.library'?
The current value is '/usr/local/graalvm-1.0.0-
rc1/jre/lib/amd64/libtrufflenfi.so'.
Details: Access to native code is not allowed by the host environment.
Exception in thread "main" org.graalvm.polyglot.PolyglotException
at org.graalvm.polyglot.Context.eval(Context.java:336)
at javatest.JavaTest.main(JavaTest.java:32)
As you can see by the initial call to view the supported languages it recognizes that R is installed but once I call the eval on the language it kicks out. The trufflenfi.so file is there and available. I have defined it as a run parameter (even though I shouldn't need to).
I can find nothing on why the "access to native code is not allowed by the host environment" is being displayed and am at a loss. Any ideas on what I'm doing wrong? Note: I also tried the same test with python and ruby and got the same result but removed for the simplest of test cases.