diff --git a/src/julia/core.py b/src/julia/core.py index 183298c4..1a67873e 100644 --- a/src/julia/core.py +++ b/src/julia/core.py @@ -482,11 +482,19 @@ def __init__(self, init_julia=True, jl_init_path=None, runtime=None, logger.debug("use_custom_sysimage = %r", use_custom_sysimage) logger.debug("compiled_modules = %r", options.compiled_modules) if not ( - options.compiled_modules == "no" - or is_compatible_python + is_compatible_python or use_custom_sysimage ): - raise UnsupportedPythonError(jlinfo) + if options.compiled_modules in (True, "yes"): + raise UnsupportedPythonError(jlinfo) + elif options.compiled_modules in (False, "no"): + pass + else: + warnings.warn( + "Statically linked Python interpreter detected, setting `compiled_modules=False` automatically." + ) + options.compiled_modules = "no" + self.api.init_julia(options) diff --git a/src/julia/options.py b/src/julia/options.py index 00ba9801..ae033150 100644 --- a/src/julia/options.py +++ b/src/julia/options.py @@ -119,7 +119,7 @@ def yes_no_etc(*etc): compile: {True, False, 'yes', 'no', 'all', 'min'} Enable or disable JIT compiler, or request exhaustive compilation. -compiled_modules: {True, False, 'yes', 'no'} +compiled_modules: {True, False, 'yes', 'no', 'auto'} Enable or disable incremental precompilation of modules. depwarn: {True, False, 'yes', 'no', 'error'} @@ -165,7 +165,7 @@ class JuliaOptions(object): sysimage = String("sysimage") bindir = String("bindir") - compiled_modules = Choices("compiled_modules", yes_no_etc()) + compiled_modules = Choices("compiled_modules", yes_no_etc("auto")) compile = Choices("compile", yes_no_etc("all", "min")) depwarn = Choices("depwarn", yes_no_etc("error")) warn_overwrite = Choices("warn_overwrite", yes_no_etc())