From c2d95cc9e5f096419e427643c05c1d020d5e5ce9 Mon Sep 17 00:00:00 2001 From: Mick Jordan <mick.jordan@oracle.com> Date: Mon, 26 Oct 2015 17:22:57 -0700 Subject: [PATCH] more FFI function stubs --- .../fficall/jni/src/alloc.c | 4 ++++ .../fficall/jni/src/arithmetic.c | 6 ++++++ .../fficall/jni/src/misc.c | 19 +++++++++++++++++++ .../fficall/jni/src/rf_functions.c | 17 +++++++++++++++++ .../fficall/jni/src/rmathc.c | 12 ++++++++++++ .../initial.package.blacklist | 12 ++++++++++++ .../r/install.cran.packages.R | 3 ++- 7 files changed, 72 insertions(+), 1 deletion(-) rename initial.package.blacklist => com.oracle.truffle.r.test.cran/initial.package.blacklist (94%) diff --git a/com.oracle.truffle.r.native/fficall/jni/src/alloc.c b/com.oracle.truffle.r.native/fficall/jni/src/alloc.c index d8aeadae4b..33f20cc626 100644 --- a/com.oracle.truffle.r.native/fficall/jni/src/alloc.c +++ b/com.oracle.truffle.r.native/fficall/jni/src/alloc.c @@ -51,6 +51,10 @@ char* S_alloc(long n, int size) { return p; } +char* S_realloc(char *p, long a, long b, int size) { + return unimplemented("S_realloc"); +} + void allocExit() { int i; for (i = 0; i < tMemTableIndex; i++) { diff --git a/com.oracle.truffle.r.native/fficall/jni/src/arithmetic.c b/com.oracle.truffle.r.native/fficall/jni/src/arithmetic.c index 908b4c5ee4..c387fdea7e 100644 --- a/com.oracle.truffle.r.native/fficall/jni/src/arithmetic.c +++ b/com.oracle.truffle.r.native/fficall/jni/src/arithmetic.c @@ -163,3 +163,9 @@ double R_pow_di(double x, int n) return xn; } +double R_pow(double x, double y) { + unimplemented("R_pow"); + return 0; +} + + diff --git a/com.oracle.truffle.r.native/fficall/jni/src/misc.c b/com.oracle.truffle.r.native/fficall/jni/src/misc.c index 4133f06d6e..27452f47f7 100644 --- a/com.oracle.truffle.r.native/fficall/jni/src/misc.c +++ b/com.oracle.truffle.r.native/fficall/jni/src/misc.c @@ -125,6 +125,18 @@ void * Riconv_open (const char* tocode, const char* fromcode) { return unimplemented("Riconv_open"); } +double R_atof(const char *str) { + unimplemented("R_atof"); + return 0; +} + +double R_strtod(const char *c, char **end) { + unimplemented("R_strtod"); + return 0; +} + + + const char *reEnc(const char *x, cetype_t ce_in, cetype_t ce_out, int subst) { // TODO: proper implementation of reEnc return x; @@ -137,3 +149,10 @@ SEXP R_PromiseExpr(SEXP x) { SEXP R_ClosureExpr(SEXP x) { return unimplemented("R_ClosureExpr"); } + +#include <R_ext/Parse.h> + +SEXP R_ParseVector(SEXP x, int y, ParseStatus *z, SEXP w) { + return unimplemented("R_ParseVector"); +} + diff --git a/com.oracle.truffle.r.native/fficall/jni/src/rf_functions.c b/com.oracle.truffle.r.native/fficall/jni/src/rf_functions.c index c2427ab808..4346dfbf06 100644 --- a/com.oracle.truffle.r.native/fficall/jni/src/rf_functions.c +++ b/com.oracle.truffle.r.native/fficall/jni/src/rf_functions.c @@ -280,6 +280,10 @@ SEXP Rf_mkCharCE(const char *x, cetype_t y) { return NULL; } +SEXP Rf_mkCharLen(const char *x, int y) { + return unimplemented("Rf_mkCharLen"); +} + SEXP Rf_mkCharLenCE(const char *x, int len, cetype_t enc) { JNIEnv *thisenv = getEnv(); char buf[len + 1]; @@ -465,6 +469,18 @@ SEXP R_FindNamespace(SEXP info) { return checkRef(thisenv, result); } +SEXP Rf_lengthgets(SEXP x, R_len_t y) { + return unimplemented("Rf_lengthgets"); +} + +SEXP Rf_xlengthgets(SEXP x, R_xlen_t y) { + return unimplemented("Rf_xlengthgets"); + +} + +SEXP Rf_namesgets(SEXP x, SEXP y) { + return unimplemented("Rf_namesgets"); +} SEXP GetOption1(SEXP tag) { @@ -528,3 +544,4 @@ void Rf_gsetVar(SEXP symbol, SEXP value, SEXP rho) (*thisenv)->CallStaticObjectMethod(thisenv, CallRFFIHelperClass, Rf_gsetVarMethodID, symbol, value, rho); } + diff --git a/com.oracle.truffle.r.native/fficall/jni/src/rmathc.c b/com.oracle.truffle.r.native/fficall/jni/src/rmathc.c index a5265943a0..c847d6e6a3 100644 --- a/com.oracle.truffle.r.native/fficall/jni/src/rmathc.c +++ b/com.oracle.truffle.r.native/fficall/jni/src/rmathc.c @@ -31,16 +31,28 @@ double Rf_dnorm(double a, double b, double c, int d) { return 0; } +double Rf_dnorm4(double a, double b, double c, int d) { + return Rf_dnorm(a, b, c, d); +} + double Rf_pnorm(double a, double b, double c, int d, int e) { unimplemented("Rf_pnorm"); return 0; } +double Rf_pnorm5(double a, double b, double c, int d, int e) { + return Rf_pnorm(a, b, c, d, e); +} + double Rf_qnorm(double a, double b, double c, int d, int e) { unimplemented("Rf_qnorm"); return 0; } +double Rf_qnorm5(double a, double b, double c, int d, int e) { + return Rf_qnorm(a, b, c, d, e); +} + double Rf_rnorm(double a, double b) { unimplemented("Rf_rnorm"); return 0; diff --git a/initial.package.blacklist b/com.oracle.truffle.r.test.cran/initial.package.blacklist similarity index 94% rename from initial.package.blacklist rename to com.oracle.truffle.r.test.cran/initial.package.blacklist index 8fa909e393..55641c8d2a 100644 --- a/initial.package.blacklist +++ b/com.oracle.truffle.r.test.cran/initial.package.blacklist @@ -118,6 +118,9 @@ Reason: native Package: deSolve Reason: native +Package: wle +Reason: native + Package: matrixStats Reason: S4 @@ -178,6 +181,12 @@ Reason: serialize Package: cubfits Reason: serialize +Package: NLP +Reason: serialize + +Package: proxy +Reason: serialize + Package: appell Reason: fortran @@ -199,5 +208,8 @@ Reason: fortran Package: cvplogistic Reason: fortran +Package: sparseLDA +Reason: fortran + Package: rJava Reason: java diff --git a/com.oracle.truffle.r.test.cran/r/install.cran.packages.R b/com.oracle.truffle.r.test.cran/r/install.cran.packages.R index 9a190f7675..702d1b9e4f 100644 --- a/com.oracle.truffle.r.test.cran/r/install.cran.packages.R +++ b/com.oracle.truffle.r.test.cran/r/install.cran.packages.R @@ -169,7 +169,8 @@ set.package.blacklist <- function() { set.initial.package.blacklist <- function() { if (is.na(initial.blacklist.file)) { # not set on command line - initial.blacklist.file <<- Sys.getenv("INITIAL_PACKAGE_BLACKLIST", unset="initial.package.blacklist") + this_package <- "com.oracle.truffle.r.test.cran" + initial.blacklist.file <<- Sys.getenv("INITIAL_PACKAGE_BLACKLIST", unset=file.path(this_package, "initial.package.blacklist")) } } -- GitLab