# CBC solver

**URL:** <https://discourse.julialang.org/t/cbc-solver/77548>\
**Category:** Optimization (Mathematical)\
**Tags:** package, jump\
**Created:** [March 8, 2022, 1:57am UTC](https://discourse.julialang.org/t/cbc-solver/77548 "2022-03-08T01:57:58Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_Javier\_Mar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/francisco_javier_mar/32/24679_2.png) [@Francisco\_Javier\_Mar](https://discourse.julialang.org/u/Francisco_Javier_Mar)\
**Post date:** [March 8, 2022, 1:57am UTC](https://discourse.julialang.org/t/cbc-solver/77548/1 "2022-03-08T01:57:58Z")

</div>

I got this error while trying to test Alpine: `Failed to precompile Cbc`.  
What can I do to fix this ? Any suggestion ?  
My Julia version: JuliaPro\_v1.5.3-1

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [March 8, 2022, 2:20am UTC](https://discourse.julialang.org/t/cbc-solver/77548/2 "2022-03-08T02:20:11Z")

</div>

Same answer as [Neos Server - #2 by odow](https://discourse.julialang.org/t/neos-server/77549/2). Please update to Julia v1.6. If it still errors after that, then please post the output of `import Pkg; Pkg.status()`, and the result of `using Cbc`.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 8, 2022, 5:54am UTC](https://discourse.julialang.org/t/cbc-solver/77548/3 "2022-03-08T05:54:03Z")

</div>

I would even say update to 1.7.2, which is the current stable release. Also make sure that you’re using the regular General registry rather than the JuliaPro one (I can’t remember whether registries are persistent across version updates)

---

<div class="post-metadata">

**Author:** ![Francisco\_Javier\_Mar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/francisco_javier_mar/32/24679_2.png) [@Francisco\_Javier\_Mar](https://discourse.julialang.org/u/Francisco_Javier_Mar)\
**Post date:** [March 8, 2022, 10:37am UTC](https://discourse.julialang.org/t/cbc-solver/77548/4 "2022-03-08T10:37:59Z")

</div>

Julia was updated to the most recent version but it still errors. I get the following message :

```julia
LoadError: MethodError: no method matching Model(::var"#19#20")

Closest candidates are:

Model(::Any, !Matched::Symbol, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Int64, !Matched::Vector{String}, !Matched::Vector{String}, !Matched::Vector{Float64}, !Matched::Vector{Float64}, !Matched::Vector{Symbol}, !Matched::Vector, !Matched::Vector{Tuple{Symbol, Any}}, !Matched::Any, !Matched::Any, !Matched::Vector{Float64}, !Matched::Vector{Float64}, !Matched::Vector{Float64}, !Matched::Vector{Float64}, !Matched::Vector{Vector{Int64}}, !Matched::Vector{Vector{Tuple{Int64, Int64}}}, !Matched::Any, !Matched::MathProgBase.SolverInterface.AbstractMathProgSolver, !Matched::Bool, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Vector, !Matched::JuMP.IndexedVector{Float64}, !Matched::Any, !Matched::Bool, !Matched::Dict{Symbol, Any}, !Matched::IdDict, !Matched::Int64, !Matched::Int64, !Matched::Dict{Symbol, Any}) at C:\Users\DELL\.julia\packages\JuMP\I7whV\src\JuMP.jl:87

Model(::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any) at C:\Users\DELL\.julia\packages\JuMP\I7whV\src\JuMP.jl:87

Model(; solver, simplify_nonlinear_expressions) at C:\Users\DELL\.julia\packages\JuMP\I7whV\src\JuMP.jl:167

in expression starting at C:\Users\DELL\Dropbox\Fran_posg\tese\artigos Secundino\sist5.jl:88
top-level scope at sist5.jl:88
eval at boot.jl:373 [inlined]
include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String) at loading.jl:1196

```

```julia
using JuMP, AmplNLWriter, Bonmin_jll
us = ["Jacui","Ita","Xingo","Salto Santiago","Lajeado"]
d = [4827 3976 3861 3803 3746 3919 4345 4829 5187 5551 5792 5314 6028 6754 6662 6512 5429 4726 4495 4726 4956 4610 4265 3976]
metas=[108 870 1581 760 543]
pmin = [
    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
    140 140 140 140 140 140 140 140 140 140 140 140 140 140 140 140 140 140 140 140 140 140 140 140
    250 250 250 250 250 250 250 250 250 250 250 250 250 250 250 250 250 250 250 250 250 250 250 250
    170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170 170
    89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
    ]
pmax = [
    30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30
    290 290 290 290 290 290 290 290 290 290 290 290 290 290 290 290 290 290 290 290 290 290 290 290
    527 527 527 527 527 527 527 527 527 527 527 527 527 527 527 527 527 527 527 527 527 527 527 527
    317 317 317 317 317 317 317 317 317 317 317 317 317 317 317 317 317 317 317 317 317 317 317 317
    181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181 181
    ]
nmin = [
    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
    ]
nmax = [
    6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
    5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
    5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
    4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
    5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
    ]
cpp = [15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30 15*30
15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290 15*290
15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527 15*527
15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317 15*317
15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181 15*181]
valor_agua = [
0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304 0.0036*304;
0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517 0.0036*517;
0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351 0.0036*351;
0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887 0.0036*887;
0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434 0.0036*434;
]
c_00 = [-0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608 -0.003608
-0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193 -0.6193
 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188 -5.188
 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225 0.225
 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823 -3.823]#TI
c_10 = [0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889 0.6889
0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071 0.8071
0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499 0.6499
1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121 1.121
1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051 1.051]#POR P
c_01 = [10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88 10.88
71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07 71.07
126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4 126.4
17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23 17.23
288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8 288.8]#POR N
c_20 = [0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814 0.00814
0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046 0.00046
0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992 0.0003992
0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682 0.001682
0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462 0.003462]#POR P2
c_11 = [-0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519 -0.2519
-0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907 -0.1907
-0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817 -0.2817
-0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779 -0.779
-0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643 -0.6643]# POR PN
c_02 = [1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386 1.386
20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15 20.15
47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53 47.53
89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36 89.36
36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65 36.65]#POR N2
μ = 0.02

model = Model(() -> AmplNLWriter.Optimizer(Bonmin_jll.amplexe))

nus = length(us)
nd = length(d)

@variables(model, begin
    p[i=1:nus, t=1:nd] >= 0
    n[i=1:nus, t=0:nd], Int
    y[i=1:nus, t=1:nd] >= 0,Int
    z[t=1:nd] >= 0
end)

    fix.(n[1, 0], 6;force=true)
    fix.(n[2, 0], 3;force=true)
    fix.(n[3, 0], 3;force=true)
    fix.(n[4, 0], 3;force=true)
    fix.(n[5, 0], 3;force=true)

for i in 1:nus
    for t in 1:nd
        set_lower_bound(n[i, t], nmin[i, t])
        set_upper_bound(n[i, t], nmax[i, t])
    end
end
@NLobjective(
    model,
    Min,
    sum(
        sum(
            valor_agua[i,t] * (
                c_00[i,t] +
                c_10[i,t] * p[i, t] +
                c_01[i,t] * n[i, t] +
                c_20[i,t] * p[i, t]^2 +
                c_11[i,t] * p[i, t] * n[i, t] +
                c_02[i,t] * n[i, t]^2
            ) +
            cpp[i,t] * y[i, t]
            for i = 1:nus
        ) + μ * z[t]^2
        for t = 1:nd
    )
)
@constraints(model, begin
    [i=1:nus, t=1:nd], y[i, t] >= n[i, t] - n[i, t-1]
    [i=1:nus, t=1:nd], y[i,t] >= n[i, t-1] -n[i, t]
    [i=1:nus, t=1:nd], pmin[i, t] * n[i, t] <= p[i, t]
    [i=1:nus, t=1:nd], p[i, t] <= pmax[i, t] * n[i, t]
    [t=1:nd], sum(p[:, t]) + z[t] == d[t]
    [i=1:nus], sum(p[i, :]) == 24 * metas[i]
end)

print(model)
optimize!(model)
@show objective_value(model)
@show value.(p)
@show value.(n)
@show value.(z)
@show value.(y)

```

I tried to install Alpine and it didnt work, the same problem.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 8, 2022, 10:45am UTC](https://discourse.julialang.org/t/cbc-solver/77548/5 "2022-03-08T10:45:43Z")

</div>

What do you mean by “same problem”? Looks like everything installed fine, and you just have errors in your code now?

Not a JuMP expert, but the error says you shouldn’t pass an anonymous function to `Model()`

Indeed the first example in the JuMP docs shows this syntax for constructing a model:

```julia
model = Model(HiGHS.Optimizer)

```

so yours should probably be

```julia
model = Model(AmplNLWriter.Optimizer(Bonmin_jll.amplexe))

```

---

<div class="post-metadata">

**Author:** ![Francisco\_Javier\_Mar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/francisco_javier_mar/32/24679_2.png) [@Francisco\_Javier\_Mar](https://discourse.julialang.org/u/Francisco_Javier_Mar)\
**Post date:** [March 8, 2022, 10:51am UTC](https://discourse.julialang.org/t/cbc-solver/77548/6 "2022-03-08T10:51:28Z")

</div>

How can I solve that error, it keeps showing the same message. In my code I put just like you suggest.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 8, 2022, 11:18am UTC](https://discourse.julialang.org/t/cbc-solver/77548/7 "2022-03-08T11:18:21Z")

</div>

Sorry, I did look at the solver specific docs now and indeed they suggest passing an anonymous function. The documented usage works fine for me:

```julia
julia> using JuMP, AmplNLWriter, Bonmin_jll

julia> model = Model(() -> AmplNLWriter.Optimizer(Bonmin_jll.amplexe))
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: AmplNLWriter

```

and I can also run all of your code, although it fails with the following:

```julia
julia> optimize!(model)
Bonmin 1.8.8 using Cbc 2.10.5 and Ipopt 3.14.4
bonmin:

******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
 Ipopt is released as open source code under the Eclipse Public License (EPL).
         For more information visit https://github.com/coin-or/Ipopt
******************************************************************************

NLP0012I 
              Num Status Obj It time Location
NLP0014I 1 OPT 797109.8 28 0.1
Assertion failed: isNlpFeasible(minlp, primalTolerance), file BonHeuristicDiveMIP.cpp, line 133

```

which sounds more like a specific issue with your problem definition than a programming issue.

---

<div class="post-metadata">

**Author:** ![Francisco\_Javier\_Mar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/francisco_javier_mar/32/24679_2.png) [@Francisco\_Javier\_Mar](https://discourse.julialang.org/u/Francisco_Javier_Mar)\
**Post date:** [March 8, 2022, 11:32am UTC](https://discourse.julialang.org/t/cbc-solver/77548/8 "2022-03-08T11:32:16Z")

</div>

It seems very strange to me, it does not run any simple code, absolutely nothing is working.  
With the previous version of julia, the bonmin solver solved my problem

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 8, 2022, 11:34am UTC](https://discourse.julialang.org/t/cbc-solver/77548/9 "2022-03-08T11:34:13Z")

</div>

What do you mean by “it does not run any simple code”? Are you saying that in a fresh Julia session the following code errors for you?

```julia
julia> using JuMP, AmplNLWriter, Bonmin_jll

julia> model = Model(() -> AmplNLWriter.Optimizer(Bonmin_jll.amplexe))

```

---

<div class="post-metadata">

**Author:** ![Francisco\_Javier\_Mar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/francisco_javier_mar/32/24679_2.png) [@Francisco\_Javier\_Mar](https://discourse.julialang.org/u/Francisco_Javier_Mar)\
**Post date:** [March 8, 2022, 11:39am UTC](https://discourse.julialang.org/t/cbc-solver/77548/10 "2022-03-08T11:39:17Z")

</div>

Yes, it errors. I updated Julia also Atom and it didnt work.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 8, 2022, 11:40am UTC](https://discourse.julialang.org/t/cbc-solver/77548/11 "2022-03-08T11:40:55Z")

</div>

What is the error? What is the output of `]st`?

---

<div class="post-metadata">

**Author:** ![Francisco\_Javier\_Mar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/francisco_javier_mar/32/24679_2.png) [@Francisco\_Javier\_Mar](https://discourse.julialang.org/u/Francisco_Javier_Mar)\
**Post date:** [March 8, 2022, 11:47am UTC](https://discourse.julialang.org/t/cbc-solver/77548/12 "2022-03-08T11:47:32Z")

</div>

[07493b3f] Alpine v0.1.15  
[7c4d4715] AmplNLWriter v0.8.1  
[c52e3926] Atom v0.12.36  
[9961bab8] Cbc v1.0.0  
[42e2da0e] Grisu v1.0.2  
[b6b21f68] Ipopt v1.0.2  
[4076af6c] JuMP v0.18.6  
[e5e0dc1b] Juno v0.8.4  
[f10290a3] NEOSServer v0.4.2  
[2f354839] Pajarito v0.7.0  
[fdbf4ff8] XLSX v0.7.9  
[29cba6d7] Bonmin\_jll v100.800.801+0  
[9cc047cb] Ipopt\_jll v300.1400.400+0  
[c1ab834c] SHOT\_jll v100.100.0+0

Precompiling project…  
✗ JuMP  
✗ Alpine  
✗ Pajarito  
3 dependencies errored.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 8, 2022, 11:51am UTC](https://discourse.julialang.org/t/cbc-solver/77548/13 "2022-03-08T11:51:08Z")

</div>

Your `JuMP` version is outdated:

```julia
(jl_cP0V7O) pkg> st
      Status `C:\Users\ngudat\AppData\Local\Temp\jl_cP0V7O\Project.toml`
  [7c4d4715] AmplNLWriter v0.8.1
  [4076af6c] JuMP v0.23.1
  [29cba6d7] Bonmin_jll v100.800.801+0

```

Also the fact that you have Atom and Juno in the same environment as JuMP etc. suggests to me that you are dumping all your packages into the default environment - don’t do this. Work in project-specific environments to minimize dependency conflicts.

Do:

```julia
] activate --temp
] add AmplNLWriter JuMP Bonmin_jll

```

and then run the code I posted again.

---

<div class="post-metadata">

**Author:** ![Francisco\_Javier\_Mar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/francisco_javier_mar/32/24679_2.png) [@Francisco\_Javier\_Mar](https://discourse.julialang.org/u/Francisco_Javier_Mar)\
**Post date:** [March 8, 2022, 12:04pm UTC](https://discourse.julialang.org/t/cbc-solver/77548/14 "2022-03-08T12:04:18Z")

</div>

Work in project-specific environments to minimize dependency conflicts. How can I do this?  
I run this

> ] activate --temp  
> ] add AmplNLWriter JuMP Bonmin\_jll

and my ouput

> [7c4d4715] AmplNLWriter v0.8.1  
> [4076af6c] JuMP v0.23.1  
> [29cba6d7] Bonmin\_jll v100.800.801+0

What i need to do now?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 8, 2022, 12:09pm UTC](https://discourse.julialang.org/t/cbc-solver/77548/15 "2022-03-08T12:09:04Z")

</div>

Now you run the code again (first my example, and if that works your full code). Make sure you are doing this in a fresh Julia session (i.e. you are doing `using AmplNLWriter, JuMP, Bonmin_jll` after you’ve activated a new environment and added the packages).

Read this to learn more: [4. Working with Environments · Pkg.jl](https://pkgdocs.julialang.org/v1/environments/)

---

<div class="post-metadata">

**Author:** ![Francisco\_Javier\_Mar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/francisco_javier_mar/32/24679_2.png) [@Francisco\_Javier\_Mar](https://discourse.julialang.org/u/Francisco_Javier_Mar)\
**Post date:** [March 8, 2022, 12:46pm UTC](https://discourse.julialang.org/t/cbc-solver/77548/16 "2022-03-08T12:46:44Z")

</div>

```julia
> ┌ Warning: `range(start, stop)` (with neither `length` nor `step` given) is deprecated, use `range(start, stop=stop)` instead.
> │ caller = broadcasted at broadcast.jl:1093 [inlined]
> └ @ Core .\broadcast.jl:1093

```

I got this error. So sorry, I am new using Julia

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 8, 2022, 1:00pm UTC](https://discourse.julialang.org/t/cbc-solver/77548/17 "2022-03-08T13:00:18Z")

</div>

That’s a warning, not an error, and seems unrelated to your previous issues (and I don’t get this warning when running the code you posted above).

---

<div class="post-metadata">

**Author:** ![Francisco\_Javier\_Mar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/francisco_javier_mar/32/24679_2.png) [@Francisco\_Javier\_Mar](https://discourse.julialang.org/u/Francisco_Javier_Mar)\
**Post date:** [March 8, 2022, 1:03pm UTC](https://discourse.julialang.org/t/cbc-solver/77548/18 "2022-03-08T13:03:11Z")

</div>

but how can i solve this warning?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 8, 2022, 1:08pm UTC](https://discourse.julialang.org/t/cbc-solver/77548/19 "2022-03-08T13:08:01Z")

</div>

I don’t know, as I said I don’t think this warning is related to the code you posted above. Please read

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

and make an MWE which produces this warning.
