@@ -134,6 +134,8 @@ global CPU_NAME::String
134134
135135A string representing the specific JIT compiler CPU target being utilized in the current runtime.
136136
137+ Set to an empty string if Julia was launched with `--compile=no`.
138+
137139Note: Included in the output of `versioninfo()`.
138140"""
139141global JIT_CPU:: String
@@ -143,6 +145,8 @@ global JIT_CPU::String
143145
144146A string representing the specific JIT compiler target triple being utilized in the current runtime.
145147
148+ Set to an empty string if Julia was launched with `--compile=no`.
149+
146150Note: Included in the output of `versioninfo()`.
147151"""
148152global JIT_TRIPLE:: String
@@ -152,6 +156,8 @@ global JIT_TRIPLE::String
152156
153157A string representing the specific Just-In-Time (JIT) compiler being utilized in the current runtime.
154158
159+ Set to an empty string if Julia was launched with `--compile=no`.
160+
155161# Examples
156162Currently, this equals `"ORCJIT"` for the LLVM "ORC" ("On-Request Compilation") JIT library:
157163```jldoctest
@@ -197,10 +203,18 @@ function __init__()
197203 global EFFECTIVE_CPU_THREADS = min (CPU_THREADS, Int (ccall (:jl_effective_threads , Int32, ())))
198204 global SC_CLK_TCK = ccall (:jl_SC_CLK_TCK , Clong, ())
199205 global CPU_NAME = ccall (:jl_get_cpu_name , Ref{String}, ())
200- global JIT = ccall (:jl_get_JIT , Ref{String}, ())
201- _jit = ccall (:JLJITGetJuliaOJIT , Ptr{Cvoid}, ())
202- global JIT_CPU = unsafe_string (ccall (:JLJITGetCPUString , Cstring, (Ptr{Cvoid},), _jit))
203- global JIT_TRIPLE = unsafe_string (ccall (:JLJITGetTripleString , Cstring, (Ptr{Cvoid},), _jit))
206+ println (Base. JLOptions (). compile_enabled)
207+ if Base. JLOptions (). compile_enabled != 0
208+ global JIT = ccall (:jl_get_JIT , Ref{String}, ())
209+ _jit = ccall (:JLJITGetJuliaOJIT , Ptr{Cvoid}, ())
210+ global JIT_CPU = unsafe_string (ccall (:JLJITGetCPUString , Cstring, (Ptr{Cvoid},), _jit))
211+ global JIT_TRIPLE = unsafe_string (ccall (:JLJITGetTripleString , Cstring, (Ptr{Cvoid},), _jit))
212+ else
213+ global JIT = " "
214+ global JIT_CPU = " "
215+ global JIT_TRIPLE = " "
216+ end
217+
204218 global BASE_SYSIMG_TARGET = sysimage_target ()
205219 global PAGESIZE = Int (Sys. isunix () ? ccall (:jl_getpagesize , Clong, ()) : ccall (:jl_getallocationgranularity , Clong, ()))
206220 __init_build ()
0 commit comments