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
c5aaee90
Commit
c5aaee90
authored
9 years ago
by
Mick Jordan
Browse files
Options
Downloads
Patches
Plain Diff
backout mx --graal-vm option, use existing --vm global option instead
parent
a0358a39
Branches
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
+17
-29
17 additions, 29 deletions
mx.fastr/mx_fastr.py
with
17 additions
and
29 deletions
mx.fastr/mx_fastr.py
+
17
−
29
View file @
c5aaee90
...
...
@@ -29,10 +29,10 @@ import os
_fastr_suite
=
None
def
runR
(
args
,
className
,
nonZeroIsFatal
=
True
,
extraVmArgs
=
None
,
runBench
=
False
,
graal
VM
=
'
server
'
):
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
setREnvironment
(
graal
VM
)
setREnvironment
(
graal
_vm
)
project
=
className
.
rpartition
(
"
.
"
)[
0
]
vmArgs
=
[
'
-cp
'
,
mx
.
classpath
(
project
)]
vmArgs
=
vmArgs
+
[
"
-Drhome.path=
"
+
_fastr_suite
.
dir
]
...
...
@@ -41,9 +41,9 @@ def runR(args, className, nonZeroIsFatal=True, extraVmArgs=None, runBench=False,
vmArgs
=
vmArgs
+
[
'
-ea
'
,
'
-esa
'
]
if
extraVmArgs
:
vmArgs
=
vmArgs
+
extraVmArgs
return
mx_graal
.
vm
(
vmArgs
+
[
className
]
+
args
,
vm
=
graal
VM
,
nonZeroIsFatal
=
nonZeroIsFatal
)
return
mx_graal
.
vm
(
vmArgs
+
[
className
]
+
args
,
vm
=
graal
_vm
,
nonZeroIsFatal
=
nonZeroIsFatal
)
def
setREnvironment
(
graal
VM
):
def
setREnvironment
(
graal
_vm
):
osname
=
platform
.
system
()
lib_base
=
join
(
_fastr_suite
.
dir
,
'
com.oracle.truffle.r.native
'
,
'
builtinlibs
'
,
'
lib
'
)
lib_value
=
lib_base
...
...
@@ -54,40 +54,28 @@ def setREnvironment(graalVM):
lib_env
=
'
LD_LIBRARY_PATH
'
os
.
environ
[
lib_env
]
=
lib_value
# For R sub-processes we need to set the DEFAULT_VM environment variable
os
.
environ
[
'
DEFAULT_VM
'
]
=
graal
VM
os
.
environ
[
'
DEFAULT_VM
'
]
=
graal
_vm
def
_add_vm_arg
(
parser
):
parser
.
add_argument
(
'
--graal-vm
'
,
action
=
'
store
'
,
dest
=
'
graalVM
'
,
metavar
=
'
<arg>
'
,
help
=
'
Graal VM
'
,
default
=
'
server
'
)
def
_process_graalVM_arg
(
args
):
def
_get_graal_vm
():
'''
Check for the --graal-vm argument and if it exists return it as fiust result else None.
Unfortunately we can
'
t use ArgumentParser as that doesn
'
t like other args with a leading
'
-
'
unless
a
'
--
'
separator is provide and we can
'
t do that.
Check for the --vm global mx argument by checking mx.graal._vm.
'''
graalVM
=
"
server
"
try
:
vmIndex
=
args
.
index
(
'
--graal-vm
'
)
graalVM
=
args
[
vmIndex
+
1
]
del
args
[
vmIndex
:
vmIndex
+
2
]
except
ValueError
:
pass
return
graalVM
,
args
return
"
server
"
if
mx_graal
.
_vm
is
None
else
mx_graal
.
_vm
def
rshell
(
args
,
nonZeroIsFatal
=
True
,
extraVmArgs
=
None
,
runBench
=
False
):
'''
run R shell
'''
# Optional args for external use by benchmarks
graal
VM
,
args
=
_process_graalVM_arg
(
args
)
runR
(
args
,
"
com.oracle.truffle.r.shell.RCommand
"
,
nonZeroIsFatal
=
nonZeroIsFatal
,
extraVmArgs
=
extraVmArgs
,
runBench
=
False
,
graal
VM
=
graal
VM
)
graal
_vm
=
_get_graal_vm
(
)
runR
(
args
,
"
com.oracle.truffle.r.shell.RCommand
"
,
nonZeroIsFatal
=
nonZeroIsFatal
,
extraVmArgs
=
extraVmArgs
,
runBench
=
False
,
graal
_vm
=
graal
_vm
)
def
rscript
(
args
):
'''
run Rscript
'''
graal
VM
,
args
=
_process_graalVM_arg
(
args
)
runR
(
args
,
"
com.oracle.truffle.r.shell.RscriptCommand
"
,
graal
VM
=
graal
VM
)
graal
_vm
=
_get_graal_vm
(
)
runR
(
args
,
"
com.oracle.truffle.r.shell.RscriptCommand
"
,
graal
_vm
=
graal
_vm
)
def
build
(
args
):
'''
FastR build
'''
graal
VM
,
args
=
_process_graalVM_arg
(
args
)
graal
_vm
=
_get_graal_vm
(
)
# Overridden in case we ever want to do anything non-standard
# workaround for Hotspot Mac OS X build problem
osname
=
platform
.
system
()
...
...
@@ -95,7 +83,7 @@ def build(args):
os
.
environ
[
'
COMPILER_WARNINGS_FATAL
'
]
=
'
false
'
os
.
environ
[
'
USE_CLANG
'
]
=
'
true
'
os
.
environ
[
'
LFLAGS
'
]
=
'
-Xlinker -lstdc++
'
mx_graal
.
build
(
args
,
vm
=
graal
VM
)
# this calls mx.build
mx_graal
.
build
(
args
,
vm
=
graal
_vm
)
# this calls mx.build
def
findbugs
(
args
):
'''
run FindBugs against non-test Java projects
'''
...
...
@@ -236,14 +224,14 @@ def _junit_r_harness(args, vmArgs, junitArgs):
# suppress Truffle compilation by using a high threshold
vmArgs
+=
[
'
-G:TruffleCompilationThreshold=100000
'
]
setREnvironment
(
args
.
graalVM
)
graal_vm
=
_get_graal_vm
()
setREnvironment
(
graal_vm
)
return
mx_graal
.
vm
(
vmArgs
+
junitArgs
,
vm
=
args
.
graal
VM
,
nonZeroIsFatal
=
False
)
return
mx_graal
.
vm
(
vmArgs
+
junitArgs
,
vm
=
graal
_vm
,
nonZeroIsFatal
=
False
)
def
junit
(
args
):
'''
run R Junit tests
'''
parser
=
ArgumentParser
(
prog
=
'
r junit
'
)
_add_vm_arg
(
parser
)
parser
.
add_argument
(
'
--gen-expected-output
'
,
action
=
'
store_true
'
,
help
=
'
generate/update expected test output file
'
)
parser
.
add_argument
(
'
--gen-expected-quiet
'
,
action
=
'
store_true
'
,
help
=
'
suppress output on new tests being added
'
)
parser
.
add_argument
(
'
--keep-trailing-whitespace
'
,
action
=
'
store_true
'
,
help
=
'
keep trailing whitespace in expected test output file
'
)
...
...
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