Skip to content

Commit

Permalink
keep old precompile statements for Julia v1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha committed Dec 2, 2022
1 parent e96537f commit 4e83d0c
Show file tree
Hide file tree
Showing 3 changed files with 484 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/Trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,13 @@ function __init__()
end


include("auxiliary/precompile.jl")
# Use the old precompile statements on Julia v1.7 and only switch to the newer
# ones based on SnoopPrecompile.jl for Julia v1.8 and newer.
@static if VERSION < v"1.8"
include("auxiliary/precompile_old.jl")
else
include("auxiliary/precompile_new.jl")
end


end
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ using SnoopPrecompile: @precompile_all_calls
GC.@preserve u_ode du_ode begin
u = Trixi.wrap_array(u_ode, semi)
du = Trixi.wrap_array(du_ode, semi)
analysis_callback.affect!(devnull, du, u, u_ode, first(tspan), semi)
redirect_stdout(devnull) do
analysis_callback.affect!(devnull, du, u, u_ode, first(tspan), semi)
end
end
end

Expand Down Expand Up @@ -77,7 +79,9 @@ using SnoopPrecompile: @precompile_all_calls
GC.@preserve u_ode du_ode begin
u = Trixi.wrap_array(u_ode, semi)
du = Trixi.wrap_array(du_ode, semi)
analysis_callback.affect!(devnull, du, u, u_ode, first(tspan), semi)
redirect_stdout(devnull) do
analysis_callback.affect!(devnull, du, u, u_ode, first(tspan), semi)
end
end
end

Expand Down
Loading

0 comments on commit 4e83d0c

Please sign in to comment.