Skip to content
Snippets Groups Projects
Commit 50a76e65 authored by Gilles Duboscq's avatar Gilles Duboscq
Browse files

Fix dynamic dependencies on graal and sulong

- Make sure there is no suite loading ordering issues by avoiding the
capture of suites at module-loading time.
- Make sure the SULONG build-time dependency is only added to
`r.native.recommended` if the project is available (i.e., fastr is not a
binary suite)
parent f8c0ba1e
No related branches found
No related tags found
No related merge requests found
......@@ -44,11 +44,6 @@ was passed as an mx global option.
'''
_fastr_suite = mx.suite('fastr')
'''
If this is None, then we run under the standard VM in interpreted mode only.
'''
_mx_graal = mx.suite("compiler", fatalIfMissing=False)
_mx_sulong = mx.suite("sulong", fatalIfMissing=False)
_command_class_dict = {'r': "com.oracle.truffle.r.launcher.RCommand",
'rscript': "com.oracle.truffle.r.launcher.RscriptCommand",
......@@ -64,7 +59,7 @@ def r_version():
return 'R-3.4.0'
def get_default_jdk():
if _mx_graal:
if mx.suite("compiler", fatalIfMissing=False):
tag = 'jvmci'
else:
tag = None
......@@ -92,7 +87,7 @@ def do_run_r(args, command, extraVmArgs=None, jdk=None, **kwargs):
jdk = get_default_jdk()
dists = ['FASTR']
if _mx_sulong:
if mx.suite("sulong", fatalIfMissing=False):
dists.append('SULONG')
vmArgs = mx.get_runtime_jvm_args(dists, jdk=jdk)
......@@ -141,15 +136,16 @@ def set_graal_options():
'''
If Graal is enabled, set some options specific to FastR
'''
if _mx_graal:
if mx.suite("compiler", fatalIfMissing=False):
result = ['-Dgraal.InliningDepthError=500', '-Dgraal.EscapeAnalysisIterations=3', '-XX:JVMCINMethodSizeLimit=1000000']
return result
else:
return []
def _sulong_options():
if _mx_sulong:
return ['-Dpolyglot.llvm.libraryPath=' + _mx_sulong.dir + '/mxbuild/sulong-libs']
mx_sulong = mx.suite("sulong", fatalIfMissing=False)
if mx_sulong:
return ['-Dpolyglot.llvm.libraryPath=' + mx_sulong.dir + '/mxbuild/sulong-libs']
else:
return []
......@@ -552,11 +548,14 @@ def nativebuild(args):
def mx_post_parse_cmd_line(opts):
mx_fastr_dists.mx_post_parse_cmd_line(opts)
if _mx_sulong:
if mx.suite("sulong", fatalIfMissing=False):
# native.recommended runs FastR, it already has a build dependency to the FASTR distribution
# if we are running with sulong we also need the SULONG distribution
rec = mx.project('com.oracle.truffle.r.native.recommended')
rec.buildDependencies += [mx.distribution('SULONG')]
rec = mx.project('com.oracle.truffle.r.native.recommended', fatalIfMissing=False)
if rec:
rec.buildDependencies += [mx.distribution('SULONG')]
else:
assert _fastr_suite.isBinarySuite()
mx_unittest.add_config_participant(_unittest_config_participant)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment