Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
QueryR
Commits
346cefbe
Commit
346cefbe
authored
7 years ago
by
Lukas Stadler
Browse files
Options
Downloads
Patches
Plain Diff
more debug info for embedding
parent
46a82407
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
com.oracle.truffle.r.native/fficall/src/truffle_nfi/Rembedded.c
+9
-6
9 additions, 6 deletions
...acle.truffle.r.native/fficall/src/truffle_nfi/Rembedded.c
com.oracle.truffle.r.test.native/embedded/test.sh
+5
-0
5 additions, 0 deletions
com.oracle.truffle.r.test.native/embedded/test.sh
with
14 additions
and
6 deletions
com.oracle.truffle.r.native/fficall/src/truffle_nfi/Rembedded.c
+
9
−
6
View file @
346cefbe
...
...
@@ -60,7 +60,7 @@ static void setupOverrides(void);
static
void
*
dlopen_jvmlib
(
char
*
libpath
);
static
JNIEnv
*
getEnv
();
static
jmethodID
checkGetMethodID
(
JNIEnv
*
env
,
jclass
klass
,
const
char
*
name
,
const
char
*
sig
,
int
isStatic
);
static
jclass
checkFindClass
(
JNIEnv
*
env
,
const
char
*
name
);
static
jclass
checkFindClass
(
JNIEnv
*
env
,
const
char
*
name
,
const
char
*
vm_cp
);
static
int
process_vmargs
(
int
argc
,
char
*
argv
[],
char
*
vmargv
[],
char
*
uargv
[]);
static
char
**
update_environ_with_java_home
(
void
);
static
void
print_environ
(
char
**
env
);
...
...
@@ -224,9 +224,9 @@ static int initializeFastR(int argc, char *argv[], int setupRmainloop) {
return
1
;
}
rInterfaceCallbacksClass
=
checkFindClass
(
jniEnv
,
"com/oracle/truffle/r/runtime/RInterfaceCallbacks"
);
rembeddedClass
=
checkFindClass
(
jniEnv
,
"com/oracle/truffle/r/engine/shell/REmbedded"
);
jclass
stringClass
=
checkFindClass
(
jniEnv
,
"java/lang/String"
);
rInterfaceCallbacksClass
=
checkFindClass
(
jniEnv
,
"com/oracle/truffle/r/runtime/RInterfaceCallbacks"
,
vm_cp
);
rembeddedClass
=
checkFindClass
(
jniEnv
,
"com/oracle/truffle/r/engine/shell/REmbedded"
,
vm_cp
);
jclass
stringClass
=
checkFindClass
(
jniEnv
,
"java/lang/String"
,
vm_cp
);
jmethodID
initializeMethod
=
checkGetMethodID
(
jniEnv
,
rembeddedClass
,
"initializeR"
,
"([Ljava/lang/String;Z)V"
,
1
);
jobjectArray
argsArray
=
(
*
jniEnv
)
->
NewObjectArray
(
jniEnv
,
argc
,
stringClass
,
NULL
);
for
(
int
i
=
0
;
i
<
argc
;
i
++
)
{
...
...
@@ -578,13 +578,16 @@ static jmethodID checkGetMethodID(JNIEnv *env, jclass klass, const char *name, c
return
methodID
;
}
static
jclass
checkFindClass
(
JNIEnv
*
env
,
const
char
*
name
)
{
static
jclass
checkFindClass
(
JNIEnv
*
env
,
const
char
*
name
,
const
char
*
vm_cp
)
{
jclass
klass
=
(
*
env
)
->
FindClass
(
env
,
name
);
if
(
klass
==
NULL
)
{
char
buf
[
1
02
4
];
char
buf
[
1
638
4
];
strcpy
(
buf
,
"failed to find class "
);
strcat
(
buf
,
name
);
strcat
(
buf
,
" in classpath "
);
strcat
(
buf
,
vm_cp
);
strcat
(
buf
,
".
\n
Did you set R_HOME to the correct location?"
);
(
*
env
)
->
ExceptionDescribe
(
env
);
(
*
env
)
->
FatalError
(
env
,
buf
);
}
return
(
*
env
)
->
NewGlobalRef
(
env
,
klass
);
...
...
This diff is collapsed.
Click to expand it.
com.oracle.truffle.r.test.native/embedded/test.sh
+
5
−
0
View file @
346cefbe
...
...
@@ -40,6 +40,11 @@ dir="$( cd -P "$( dirname "$source" )" && pwd )"
:
${
R_HOME
?
"R_HOME must point to FastR directory"
}
:
${
NFI_LIB
?
"NFI_LIB must point to libtrufflenfi.so located in mxbuild directory of Truffle"
}
echo
"R_HOME:
$R_HOME
"
echo
"NFI_LIB:
$NFI_LIB
"
echo
"Rclasspath: "
$dir
/../../bin/execRextras/Rclasspath
echo
"Testing 'main' embedding example..."
(
cd
$dir
/bin
;
./main
-Dtruffle
.nfi.library
=
$NFI_LIB
--vanilla
<
$dir
/src/main.input
>
$dir
/main.actual.output 2>&1
)
if
!
diff
-q
$dir
/main.actual.output
$dir
/src/main.expected.output
>
/dev/null 2>&1
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment