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
b4aad27e
Commit
b4aad27e
authored
9 years ago
by
Mick Jordan
Browse files
Options
Downloads
Patches
Plain Diff
support --J @vmargs for R/Rscript
parent
aa66a385
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mx.fastr/mx_fastr.py
+20
-10
20 additions, 10 deletions
mx.fastr/mx_fastr.py
with
20 additions
and
10 deletions
mx.fastr/mx_fastr.py
+
20
−
10
View file @
b4aad27e
...
...
@@ -20,9 +20,9 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
import
tempfile
,
platform
,
subprocess
import
tempfile
,
platform
,
subprocess
,
shlex
from
os.path
import
join
,
sep
from
argparse
import
ArgumentParser
from
argparse
import
ArgumentParser
,
REMAINDER
import
mx
import
mx_gate
import
mx_graal
...
...
@@ -31,6 +31,12 @@ import os
_fastr_suite
=
mx
.
suite
(
'
fastr
'
)
def
RcommandClass
():
return
"
com.oracle.truffle.r.shell.RCommand
"
def
RscriptCommandClass
():
return
"
com.oracle.truffle.r.shell.RscriptCommand
"
def
runR
(
args
,
className
,
nonZeroIsFatal
=
True
,
extraVmArgs
=
None
,
runBench
=
False
,
graal_vm
=
'
server
'
):
# extraVmArgs is not normally necessary as the global --J option can be used running R/RScript
# However, the bench command invokes other Java VMs along the way, so it must use extraVmArgs
...
...
@@ -46,7 +52,6 @@ def runR(args, className, nonZeroIsFatal=True, extraVmArgs=None, runBench=False,
if
extraVmArgs
:
vmArgs
+=
extraVmArgs
vmArgs
+=
_add_truffle_jar
()
vmArgs
+=
[
'
-XX:-UseJVMCIClassLoader
'
]
return
mx_graal
.
vm
(
vmArgs
+
[
className
]
+
args
,
vm
=
graal_vm
,
nonZeroIsFatal
=
nonZeroIsFatal
)
def
_add_truffle_jar
():
...
...
@@ -54,7 +59,7 @@ def _add_truffle_jar():
# This used to be done by the VM itself but was removed to
# separate the VM from Truffle.
truffle_jar
=
mx
.
distribution
(
'
truffle:TRUFFLE_API
'
).
path
return
[
'
-Xbootclasspath/p:
'
+
truffle_jar
]
return
[
'
-XX:-UseJVMCIClassLoader
'
,
'
-Xbootclasspath/p:
'
+
truffle_jar
]
def
setREnvironment
(
graal_vm
):
osname
=
platform
.
system
()
...
...
@@ -75,16 +80,21 @@ def _get_graal_vm():
'''
return
"
server
"
if
mx_jvmci
.
_vm
is
None
else
mx_jvmci
.
_vm
def
rshell
(
args
,
nonZeroIsFatal
=
True
,
extraVmArgs
=
None
,
runBench
=
False
):
'''
run R shell
'''
# Optional args for external use by benchmarks
def
rcommon
(
args
,
command
,
klass
):
parser
=
ArgumentParser
(
prog
=
'
mx
'
+
command
)
parser
.
add_argument
(
'
--J
'
,
dest
=
'
extraVmArgs
'
,
help
=
'
extra Java VM arguments
'
,
metavar
=
'
@<args>
'
)
ns
,
rargs
=
parser
.
parse_known_args
(
args
)
extraVmArgs
=
shlex
.
split
(
ns
.
extraVmArgs
.
lstrip
(
'
@
'
))
if
ns
.
extraVmArgs
else
[]
graal_vm
=
_get_graal_vm
()
return
runR
(
args
,
"
com.oracle.truffle.r.shell.RCommand
"
,
nonZeroIsFatal
=
nonZeroIsFatal
,
extraVmArgs
=
extraVmArgs
,
runBench
=
runBench
,
graal_vm
=
graal_vm
)
return
runR
(
rargs
,
klass
,
extraVmArgs
=
extraVmArgs
,
graal_vm
=
graal_vm
)
def
rshell
(
args
):
'''
run R shell
'''
return
rcommon
(
args
,
'
R
'
,
RcommandClass
())
def
rscript
(
args
):
'''
run Rscript
'''
graal_vm
=
_get_graal_vm
()
return
runR
(
args
,
"
com.oracle.truffle.r.shell.RscriptCommand
"
,
graal_vm
=
graal_vm
)
return
rcommon
(
args
,
'
Rscript
'
,
RscriptCommandClass
())
def
build
(
args
):
'''
FastR build
'''
...
...
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