.mod not running in Julia

Good morning,

Using Dynare in Julia I tried to run a .mod file:


var C Y K I Z;
varexo e;

parameters alpha delta s rho beta Kss Yss Css Iss; 

alpha = 0.35;  % Parameter values
delta = 0.025;
rho = 0.75; 
beta = 0.99;
Kss=(alpha/((1/beta)+delta-1))^(1/(1-alpha));
Yss=Kss^(alpha);
Iss=delta*Kss;
Css=Yss-Iss;

model(linear);
  (1/beta)*(C(+1)-C)=(alpha*(Kss)^(alpha-1))*(Z(+1)+(alpha-1)*K);
  Yss*Y=Css*C+Iss*I;
  Y=Z+K(-1)*alpha;
  K= (1 - delta)*K(-1) + delta*I;
  Z = rho*Z(-1)+e;
end;

shocks;
  var e; stderr 1;
end;

steady;


stoch_simul(order=1);

I am getting the following error:

2024-04-30T18:58:04.458: End of preprocessing

2024-04-30T18:58:04.462: Start parse_statements!

Steady state

───┬─────

C │ 0.0

Y │ 0.0

K │ 0.0

I │ 0.0

Z │ 0.0

───┴─────

ErrorException(“cfunction: closures are not supported on this platform”)

2024-04-30T18:58:04.479: End parser

Does anyone know what may be happening? May be this is due to the last version of Julia that was just released,I would really appreciate any indication.

Thank you very much.

Hello Santiago,

thanks for reporting the issue. I can’t reproduce the problem on my x86_64 Linux computer, but the error message mentions that the problem is platform specific.

  • Which version of Dynare.jl are you running?
  • What is the output of versioninfo()
  • please run context = @dynare <MODFILE> "stoponerror"; and send me the entire output

Best

Michel

Thank you for your timely reply:

  • I am using a Mac with M1 chip, with macOS Sonoma 14.4.1, the version of Julia is 1.10.3 and of Dynare is 0.9.11.

  • julia> versioninfo()

Julia Version 1.10.3

Commit 0b4590a5507 (2024-04-30 10:59 UTC)

Build Info:

Official https://julialang.org/ release

Platform Info:

OS: macOS (arm64-apple-darwin22.4.0)

CPU: 8 × Apple M1

WORD_SIZE: 64

LIBM: libopenlibm

LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)

Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

ERROR: LoadError: cfunction: closures are not supported on this platform

Stacktrace:

[1] gges!(ws::FastLapackInterface.GeneralizedSchurWs{…}, jobvsl::Char, jobvsr::Char, A::Matrix{…}, B::Matrix{…}; select::PolynomialMatrixEquations.var"#1#2"{…}, resize::Bool)

@ FastLapackInterface ~/.julia/packages/FastLapackInterface/twXNG/src/schur.jl:334

[2] gges!

@ ~/.julia/packages/FastLapackInterface/twXNG/src/schur.jl:309 [inlined]

[3] gs_solver!(ws::PolynomialMatrixEquations.GsSolverWs, d::Matrix{…}, e::Matrix{…}, n1::Int64, qz_criterium::Float64)

@ PolynomialMatrixEquations ~/.julia/packages/PolynomialMatrixEquations/5luE3/src/GeneralizedSchurDecompositionSolver.jl:38

[4] solve!

@ ~/.julia/packages/LinearRationalExpectations/08GHW/src/linear_rational_expectations.jl:148 [inlined]

[5]

@ LinearRationalExpectations ~/.julia/packages/LinearRationalExpectations/08GHW/src/linear_rational_expectations.jl:157

[6] first_order_solver!(results::LinearRationalExpectations.LinearRationalExpectationsResults, jacobian::Matrix{…}, options::LinearRationalExpectations.LinearRationalExpectationsOptions, ws::LinearRationalExpectations.LinearRationalExpectationsWs)

@ LinearRationalExpectations ~/.julia/packages/LinearRationalExpectations/08GHW/src/linear_rational_expectations.jl:478

[7] compute_first_order_solution!(context::Context, endogenous::Vector{…}, exogenous::Vector{…}, steadystate::Vector{…}, params::Vector{…}, model::Model, ws::Dynare.DynamicWs, css_ws::Dynare.ComputeStochSimulWs, options::Dynare.StochSimulOptions; variance_decomposition::Bool)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:652

[8] compute_first_order_solution!

@ ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:626 [inlined]

[9] compute_stoch_simul!(context::Context, ws::Dynare.DynamicWs, css_ws::Dynare.ComputeStochSimulWs, params::Vector{…}, options::Dynare.StochSimulOptions; kwargs::@Kwargs{…})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:540

[10] compute_stoch_simul!

@ ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:522 [inlined]

[11] stoch_simul_core!(context::Context, ws::Dynare.DynamicWs, options::Dynare.StochSimulOptions)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:454

[12] stoch_simul!(context::Context, field::Dict{String, Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:390

[13] parse_statements!(context::Context, statements::Vector{Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:328

[14] parser(modfilename::String, commandlineoptions::Dynare.CommandLineOptions)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:224

[15] dynare(modfile_arg::String, args::String)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:104

[16] var"@dynare"(source::LineNumberNode, module::Module, modfile_arg::String, args::Vararg{Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:67

in expression starting at REPL[4]:1

Some type information was truncated. Use show(err) to see complete types.


The error seems to be related with the stoch_simul function as the steady state is computed.

Thanks Santiago. Very useful. I will see how to fix gees!

Best

Michel

I have updated FastLapackInterface. Santiago, could you please test it?

using Pkg
Pkg.activate(; temp=true)
Pkg.add(name="FastLapackInterface", rev="noclosure")
Pkg.test("FastLapackInterface")

If it works on your M1 machine I will publish the new version and it will work with Dynare.jl

Professor Juillard, I ran the code:

using Pkg
Pkg.activate(; temp=true)
Pkg.add(name="FastLapackInterface", rev="noclosure")
Pkg.test("FastLapackInterface")

The FastLapackInterface tests were passed, but I am getting the same error after running the .mod file:

ERROR: LoadError: cfunction: closures are not supported on this platform

Stacktrace:

[1] gges!(ws::FastLapackInterface.GeneralizedSchurWs{…}, jobvsl::Char, jobvsr::Char, A::Matrix{…}, B::Matrix{…}; select::PolynomialMatrixEquations.var"#1#2"{…}, resize::Bool)

@ FastLapackInterface ~/.julia/packages/FastLapackInterface/twXNG/src/schur.jl:334

[2] gges!

@ ~/.julia/packages/FastLapackInterface/twXNG/src/schur.jl:309 [inlined]

[3] gs_solver!(ws::PolynomialMatrixEquations.GsSolverWs, d::Matrix{…}, e::Matrix{…}, n1::Int64, qz_criterium::Float64)

@ PolynomialMatrixEquations ~/.julia/packages/PolynomialMatrixEquations/5luE3/src/GeneralizedSchurDecompositionSolver.jl:38

[4] solve!

@ ~/.julia/packages/LinearRationalExpectations/08GHW/src/linear_rational_expectations.jl:148 [inlined]

[5]

@ LinearRationalExpectations ~/.julia/packages/LinearRationalExpectations/08GHW/src/linear_rational_expectations.jl:157

[6] first_order_solver!(results::LinearRationalExpectations.LinearRationalExpectationsResults, jacobian::Matrix{…}, options::LinearRationalExpectations.LinearRationalExpectationsOptions, ws::LinearRationalExpectations.LinearRationalExpectationsWs)

@ LinearRationalExpectations ~/.julia/packages/LinearRationalExpectations/08GHW/src/linear_rational_expectations.jl:478

[7] compute_first_order_solution!(context::Context, endogenous::Vector{…}, exogenous::Vector{…}, steadystate::Vector{…}, params::Vector{…}, model::Model, ws::Dynare.DynamicWs, css_ws::Dynare.ComputeStochSimulWs, options::Dynare.StochSimulOptions; variance_decomposition::Bool)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:652

[8] compute_first_order_solution!

@ ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:626 [inlined]

[9] compute_stoch_simul!(context::Context, ws::Dynare.DynamicWs, css_ws::Dynare.ComputeStochSimulWs, params::Vector{…}, options::Dynare.StochSimulOptions; kwargs::@Kwargs{…})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:540

[10] compute_stoch_simul!

@ ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:522 [inlined]

[11] stoch_simul_core!(context::Context, ws::Dynare.DynamicWs, options::Dynare.StochSimulOptions)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:454

[12] stoch_simul!(context::Context, field::Dict{String, Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:390

[13] parse_statements!(context::Context, statements::Vector{Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:328

[14] parser(modfilename::String, commandlineoptions::Dynare.CommandLineOptions)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:224

[15] dynare(modfile_arg::String, args::String)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:104

[16] var"@dynare"(source::LineNumberNode, module::Module, modfile_arg::String, args::Vararg{Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:67

in expression starting at REPL[12]:1

Some type information was truncated. Use show(err) to see complete types.


The model is running adequately in another computer but in the M1 Mac it is producing the error.

Thanks a million. Now that I know that FastLapackInterface correction is working, I will fix Dynare tomorrow

Now, you can update your installation with

Pkg.update()

You can use

Pkg.status("FastLapackInterface", mode=PKGMODE_MANIFEST)

to check that FastLapackInterface is now at version v2.0.3

You may have to restart Julia to make sure that the change is taken into effect.

Best

Michel

Professor Juillard, I ran the code

Pkg.update()
Pkg.status("FastLapackInterface", mode=PKGMODE_MANIFEST)

And everything seems to be working fine:
julia> Pkg.status(“FastLapackInterface”, mode=PKGMODE_MANIFEST)

Status ~/.julia/environments/v1.10/Manifest.toml

[29a986be] FastLapackInterface v2.0.3

Nevertheless I get an error when running the .mod file:

ERROR: LoadError: cfunction: closures are not supported on this platform

Stacktrace:

[1] gges!(ws::FastLapackInterface.GeneralizedSchurWs{…}, jobvsl::Char, jobvsr::Char, A::Matrix{…}, B::Matrix{…}; select::PolynomialMatrixEquations.var"#1#2"{…}, resize::Bool)

@ FastLapackInterface ~/.julia/packages/FastLapackInterface/bStCU/src/schur.jl:348

[2] gges!

@ ~/.julia/packages/FastLapackInterface/bStCU/src/schur.jl:323 [inlined]

[3] gs_solver!(ws::PolynomialMatrixEquations.GsSolverWs, d::Matrix{…}, e::Matrix{…}, n1::Int64, qz_criterium::Float64)

@ PolynomialMatrixEquations ~/.julia/packages/PolynomialMatrixEquations/5luE3/src/GeneralizedSchurDecompositionSolver.jl:38

[4] solve!

@ ~/.julia/packages/LinearRationalExpectations/08GHW/src/linear_rational_expectations.jl:148 [inlined]

[5]

@ LinearRationalExpectations ~/.julia/packages/LinearRationalExpectations/08GHW/src/linear_rational_expectations.jl:157

[6] first_order_solver!(results::LinearRationalExpectations.LinearRationalExpectationsResults, jacobian::Matrix{…}, options::LinearRationalExpectations.LinearRationalExpectationsOptions, ws::LinearRationalExpectations.LinearRationalExpectationsWs)

@ LinearRationalExpectations ~/.julia/packages/LinearRationalExpectations/08GHW/src/linear_rational_expectations.jl:478

[7] compute_first_order_solution!(context::Context, endogenous::Vector{…}, exogenous::Vector{…}, steadystate::Vector{…}, params::Vector{…}, model::Model, ws::Dynare.DynamicWs, css_ws::Dynare.ComputeStochSimulWs, options::Dynare.StochSimulOptions; variance_decomposition::Bool)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:652

[8] compute_first_order_solution!

@ ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:626 [inlined]

[9] compute_stoch_simul!(context::Context, ws::Dynare.DynamicWs, css_ws::Dynare.ComputeStochSimulWs, params::Vector{…}, options::Dynare.StochSimulOptions; kwargs::@Kwargs{…})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:540

[10] compute_stoch_simul!

@ ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:522 [inlined]

[11] stoch_simul_core!(context::Context, ws::Dynare.DynamicWs, options::Dynare.StochSimulOptions)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:454

[12] stoch_simul!(context::Context, field::Dict{String, Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:390

[13] parse_statements!(context::Context, statements::Vector{Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:328

[14] parser(modfilename::String, commandlineoptions::Dynare.CommandLineOptions)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:224

[15] dynare(modfile_arg::String, args::String)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:104

[16] var"@dynare"(source::LineNumberNode, module::Module, modfile_arg::String, args::Vararg{Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:67

in expression starting at REPL[5]:1

Some type information was truncated. Use show(err) to see complete types.

I realize now that the problem is more complex than I thought initially. I let you know when I come up with a solution that doesn’t break the current interface for other paltforms

Dear Santiago,

I have found an other solution. Could you please run the following in a new Julia session?

using Pkg
Pkg.activate(; temp=true)
Pkg.add(name="Dynare")
Pkg.add(name="FastLapackInterface", rev="schurorder")
Pkg.add(name="PolynomialMatrixEquations", rev="SCHURORDER")
Pkg.add(name="LinearRationalExpectations", rev="schurorder")
Pkg.test("FastLapackInterface")
Pkg.test("Dynare")

Please report any error.
If there is no error, you can try to run your own program just after the last test.
Best
Michel

Thank you very much for your reply. When running

using Pkg
Pkg.test("Dynare")

I get the following error:

MethodError(reshape, (nothing, 6, 400), 0x0000000000007c1c)

2024-05-06T11:18:42.654: End parser

Error During Test at /Users/santiago/.julia/packages/Dynare/ZWnXf/test/runtests.jl:59

Test threw exception

Expression: all((Matrix(simulation(“i”)))[10:52] .≈ 0)

BoundsError: attempt to access 0-element Vector{Simulation} at index [0]

Stacktrace:

[1] getindex(A::Vector{Simulation}, i1::Int64)

@ Base ./essentials.jl:13

[2] simulation(varname::String)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/accessors.jl:70

[3] macro expansion

@ ~/.julia/packages/Dynare/ZWnXf/test/runtests.jl:59 [inlined]

[4] macro expansion

@ ~/.julia/juliaup/julia-1.10.3+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Test/src/Test.jl:669 [inlined]

[5] top-level scope

@ ~/.julia/packages/Dynare/ZWnXf/test/runtests.jl:508

ERROR: LoadError: There was an error during testing

in expression starting at /Users/santiago/.julia/packages/Dynare/ZWnXf/test/runtests.jl:59

ERROR: Package Dynare errored during testing

Stacktrace:

[1] pkgerror(msg::String)

@ Pkg.Types ~/.julia/juliaup/julia-1.10.3+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/Types.jl:70

[2] test(ctx::Pkg.Types.Context, pkgs::Vector{…}; coverage::Bool, julia_args::Cmd, test_args::Cmd, test_fn::Nothing, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)

@ Pkg.Operations ~/.julia/juliaup/julia-1.10.3+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:2019

[3] test

@ ~/.julia/juliaup/julia-1.10.3+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/Operations.jl:1900 [inlined]

[4] test(ctx::Pkg.Types.Context, pkgs::Vector{…}; coverage::Bool, test_fn::Nothing, julia_args::Cmd, test_args::Cmd, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool, kwargs::@Kwargs{…})

@ Pkg.API ~/.julia/juliaup/julia-1.10.3+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:444

[5] test(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{})

@ Pkg.API ~/.julia/juliaup/julia-1.10.3+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:159

[6] test(pkgs::Vector{Pkg.Types.PackageSpec})

@ Pkg.API ~/.julia/juliaup/julia-1.10.3+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:148

[7] test

@ ~/.julia/juliaup/julia-1.10.3+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]

[8] test(pkg::String)

@ Pkg.API ~/.julia/juliaup/julia-1.10.3+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Pkg/src/API.jl:146

[9] top-level scope

@ REPL[11]:1

Some type information was truncated. Use show(err) to see complete types.

Thanks Santiago,
it is a different problem occuring during a test of perfect foresight with occasionally binding constraints.
Please ignore that error for now and try to run your own program in the same Julia session.

Concerning the perfect foresight simulation problem, could you please run

Pkg.add("PATHSolver")
context = @dynare "/Users/santiago/.julia/packages/Dynare/ZWnXf/test/models/irreversible/irbc2a" "stoponerror";

Professor Juillard, running the previous code I get:

julia> context = @dynare “/Users/santiago/.julia/packages/Dynare/ZWnXf/test/models/irreversible/irbc2a” “stoponerror”;
Dynare version: 0.9.11
2024-05-06T11:51:54.913: Starting @dynare /Users/santiagodiazespitia/.julia/packages/Dynare/ZWnXf/test/models/irreversible/irbc2a
[“irbc2a.mod”, “language=julia”, “json=compute”]
Dynare preprocessor version: 6.4.0+0
Starting preprocessing of the model file …
Found 6 equation(s).
Evaluating expressions…
Computing static model derivatives (order 1).
Normalizing the static model…
Finding the optimal block decomposition of the static model…
4 block(s) found:
3 recursive block(s) and 1 simultaneous block(s).
the largest simultaneous block has 2 equation(s)
and 2 feedback variable(s).
Computing dynamic model derivatives (order 1).
Normalizing the dynamic model…
Finding the optimal block decomposition of the dynamic model…
3 block(s) found:
2 recursive block(s) and 1 simultaneous block(s).
the largest simultaneous block has 2 equation(s)
and 2 feedback variable(s).
JSON written after Computing step.
Preprocessing completed.

2024-05-06T11:51:54.957: End of preprocessing
2024-05-06T11:51:54.961: Start parse_statements!
Steady state

────┬─────────
lk │ 4.91762
lc │ 1.8577
i │ 2.7335
A │ 1.0
a │ 0.0
mu │ 0.0
────┴─────────

ERROR: LoadError: MethodError: no method matching reshape(::Nothing, ::Int64, ::Int64)

Closest candidates are:
reshape(::ChainRulesCore.AbstractThunk, ::Any…)
@ ChainRulesCore ~/.julia/packages/ChainRulesCore/zgT0R/src/tangent_types/thunks.jl:58
reshape(::OffsetArrays.OffsetArray, ::Union{Colon, Int64}…)
@ OffsetArrays ~/.julia/packages/OffsetArrays/E3eDu/src/OffsetArrays.jl:383
reshape(::FillArrays.AbstractFill, ::Union{Colon, Integer}…)
@ FillArrays ~/.julia/packages/FillArrays/95uRF/src/FillArrays.jl:261

Stacktrace:
[1] make_simulation_results!(context::Context, y::Nothing, x::Vector{…}, terminalvalues::Vector{…}, periods::Int64)
@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perfectforesight/perfectforesight.jl:945
[2] mcp_perfectforesight_core!(::Dynare.PathNLS, perfect_foresight_ws::Dynare.PerfectForesightWs, context::Context, periods::Int64, guess_values::Vector{…}, initialvalues::Vector{…}, terminalvalues::Vector{…}, dynamic_ws::Dynare.DynamicWs; maxit::Int64, tolf::Float64, tolx::Float64)
@ PathSolver ~/.julia/packages/Dynare/ZWnXf/ext/PathSolver.jl:114
[3] mcp_perfectforesight_core!
@ ~/.julia/packages/Dynare/ZWnXf/ext/PathSolver.jl:8 [inlined]
[4] _perfect_foresight!(context::Context, options::Dynare.PerfectForesightOptions)
@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perfectforesight/perfectforesight.jl:362
[5] perfect_foresight_solver!(context::Context, field::Dict{String, Any})
@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perfectforesight/perfectforesight.jl:240
[6] parse_statements!(context::Context, statements::Vector{Any})
@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:300
[7] parser(modfilename::String, commandlineoptions::Dynare.CommandLineOptions)
@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:224
[8] dynare(modfile_arg::String, args::String)
@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:104
[9] var"@dynare"(source::LineNumberNode, module::Module, modfile_arg::String, args::Vararg{Any})
@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:67
in expression starting at REPL[10]:1
Some type information was truncated. Use show(err) to see complete types.

Thanks, Santiago,

could please tell me the result of

show(err)

Concerning the original problem with cfunction close, could you please, run your own program that was failing still in the same Julia session

julia> show(err)

1-element ExceptionStack:

LoadError: MethodError: no method matching reshape(::Nothing, ::Int64, ::Int64)

Closest candidates are:

reshape(::Distributions.Distribution{<:Distributions.ArrayLikeVariate}, ::Int64, ::Int64…)

@ Distributions ~/.julia/packages/Distributions/fgrZq/src/reshaped.jl:121

reshape(::FillArrays.AbstractFill, ::Union{Colon, Integer}…)

@ FillArrays ~/.julia/packages/FillArrays/eOEVm/src/FillArrays.jl:265

reshape(::FillArrays.AbstractFill, ::Union{Colon, Int64}…)

@ FillArrays ~/.julia/packages/FillArrays/eOEVm/src/FillArrays.jl:264

Stacktrace:

[1] make_simulation_results!(context::Context, y::Nothing, x::Vector{Float64}, terminalvalues::Vector{Float64}, periods::Int64)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perfectforesight/perfectforesight.jl:945

[2] mcp_perfectforesight_core!(::Dynare.PathNLS, perfect_foresight_ws::Dynare.PerfectForesightWs, context::Context, periods::Int64, guess_values::Vector{Float64}, initialvalues::Vector{Float64}, terminalvalues::Vector{Float64}, dynamic_ws::Dynare.DynamicWs; maxit::Int64, tolf::Float64, tolx::Float64**)**

@ PathSolver ~/.julia/packages/Dynare/ZWnXf/ext/PathSolver.jl:114

[3] mcp_perfectforesight_core!

@ ~/.julia/packages/Dynare/ZWnXf/ext/PathSolver.jl:8 [inlined]

[4] _perfect_foresight!(context::Context, options::Dynare.PerfectForesightOptions)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perfectforesight/perfectforesight.jl:362

[5] perfect_foresight_solver!(context::Context, field::Dict{String, Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perfectforesight/perfectforesight.jl:240

[6] parse_statements!(context::Context, statements::Vector{Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:300

[7] parser(modfilename::String, commandlineoptions::Dynare.CommandLineOptions)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:224

[8] dynare(modfile_arg::String, args::String)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:104

[9] var"@dynare"(source::LineNumberNode, module::Module, modfile_arg::String, args::Vararg{Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:67

in expression starting at REPL[19]:1

Regarding the original problem with the cfunction close, I get the following error when I run the .mod file:

ERROR: LoadError: MethodError: no method matching gges_select!(::FastLapackInterface.GeneralizedSchurWs{…}, ::Char, ::Char, ::Matrix{…}, ::Matrix{…}; select::Float64)

Stacktrace:

[1] gs_solver!(ws::PolynomialMatrixEquations.GsSolverWs, d::Matrix{…}, e::Matrix{…}, n1::Int64, qz_criterium::Float64)

@ PolynomialMatrixEquations ~/.julia/packages/PolynomialMatrixEquations/WcgeN/src/GeneralizedSchurDecompositionSolver.jl:38

[2] solve!(ws::LinearRationalExpectations.LinearGsSolverWs, crit::Float64)

@ LinearRationalExpectations ~/.julia/packages/LinearRationalExpectations/qz8MB/src/linear_rational_expectations.jl:148

[3]

@ LinearRationalExpectations ~/.julia/packages/LinearRationalExpectations/qz8MB/src/linear_rational_expectations.jl:160

[4] first_order_solver!(results::LinearRationalExpectations.LinearRationalExpectationsResults, jacobian::Matrix{…}, options::LinearRationalExpectations.LinearRationalExpectationsOptions, ws::LinearRationalExpectations.LinearRationalExpectationsWs)

@ LinearRationalExpectations ~/.julia/packages/LinearRationalExpectations/qz8MB/src/linear_rational_expectations.jl:482

[5] compute_first_order_solution!(context::Context, endogenous::Vector{…}, exogenous::Vector{…}, steadystate::Vector{…}, params::Vector{…}, model::Model, ws::Dynare.DynamicWs, css_ws::Dynare.ComputeStochSimulWs, options::Dynare.StochSimulOptions; variance_decomposition::Bool)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:652

[6] compute_first_order_solution!

@ ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:626 [inlined]

[7] compute_stoch_simul!(context::Context, ws::Dynare.DynamicWs, css_ws::Dynare.ComputeStochSimulWs, params::Vector{…}, options::Dynare.StochSimulOptions; kwargs::@Kwargs{…})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:540

[8] compute_stoch_simul!

@ ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:522 [inlined]

[9] stoch_simul_core!(context::Context, ws::Dynare.DynamicWs, options::Dynare.StochSimulOptions)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:454

[10] stoch_simul!(context::Context, field::Dict{String, Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/perturbations.jl:390

[11] parse_statements!(context::Context, statements::Vector{Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:328

[12] parser(modfilename::String, commandlineoptions::Dynare.CommandLineOptions)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/DynareParser.jl:224

[13] dynare(modfile_arg::String, args::String)

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:104

[14] var"@dynare"(source::LineNumberNode, module::Module, modfile_arg::String, args::Vararg{Any})

@ Dynare ~/.julia/packages/Dynare/ZWnXf/src/Dynare.jl:67

in expression starting at REPL[21]:1

Some type information was truncated. Use show(err) to see complete types.

Thanks Santiago,

I made a correction. Could you please run in a new Julia session

using Pkg
Pkg.activate(; temp=true)
Pkg.add(name="Dynare")
Pkg.add(name="FastLapackInterface", rev="schurorder")
Pkg.add(name="PolynomialMatrixEquations", rev="SCHURORDER")
Pkg.add(name="LinearRationalExpectations", rev="schurorder")
Pkg.test("FastLapackInterface")

and then run your own program that is still failing.

Concerning the perfect foresight problem. Could you please do

using Pkg
Pkg.activate(; temp=true)
Pkg.add(name="Dynare")
Pkg.test("Dynare")
show(stdout, "text/plain", err)