# JuMP for Gurobi 9.0

**URL:** https://discourse.julialang.org/t/jump-for-gurobi-9-0/33983
**Category:** General Usage
**Created:** [January 30, 2020, 3:18pm UTC](https://discourse.julialang.org/t/jump-for-gurobi-9-0/33983 "2020-01-30T15:18:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Arega\_Getaneh](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@Arega\_Getaneh](https://discourse.julialang.org/u/Arega_Getaneh)
#### Post date: [January 30, 2020, 3:18pm UTC](https://discourse.julialang.org/t/jump-for-gurobi-9-0/33983/1 "2020-01-30T15:18:22Z")

</div>

I want to use the latest version of Gurobi Solver (Gurobi 9.0) since it uses to solve convex and non convex problems unlike the previous versions. On the other hand, JuMP is working for versions up to Gurobi 8.1. Any suggestions how to handle this problem?  
It says “The solver does not support nonlinear problems (i.e., NLobjective and NLconstraint).”  
Below I leave the error messages of my JuMP code:

````nohighlight
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] #optimize!#78(::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(optimize!), ::Model, ::Nothing) at C:\Users\Utente\.julia\packages\JuMP\MsUSY\src\optimizer_interface.jl:147
 [3] macro expansion at C:\Users\Utente\.julia\packages\JuMP\MsUSY\src\optimizer_interface.jl:111 [inlined]
 [4] general_equi_NLP(::Int64, ::Int64, ::Int64, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,1}, ::Int64, ::Array{Float64,1}, ::Float64, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Int64, ::Float64, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}) at .\In[123]:110
 [5] top-level scope at In[125]:1 ```
````

---

<div class="post-metadata">

### Author: ![evanfields](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evanfields/32/1744_2.png) [@evanfields](https://discourse.julialang.org/u/evanfields)
#### Post date: [January 30, 2020, 4:07pm UTC](https://discourse.julialang.org/t/jump-for-gurobi-9-0/33983/2 "2020-01-30T16:07:56Z")

</div>

Does Gurobi.jl build at all? From just that stacktrace it’s unclear what your error is. What does your `Project.toml` look like, and what do you see if you enter package mode in the REPL (`]`) and get the environment status (`st`)?

I ask because it looks like the most recent version of Gurobi.jl does support Gurobi 9.0, and doing `]add JuMP Gurobi` in a fresh environment will attempt to install this recent version.

---

<div class="post-metadata">

### Author: ![Arega\_Getaneh](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@Arega\_Getaneh](https://discourse.julialang.org/u/Arega_Getaneh)
#### Post date: [January 30, 2020, 4:26pm UTC](https://discourse.julialang.org/t/jump-for-gurobi-9-0/33983/3 "2020-01-30T16:26:44Z")

</div>

I think the error message “The solver does not support nonlinear problems (i.e., `NLobjective` and `NLconstraint`).” is important. Because I am using Gurobi as a solver. My be there might be other way of stating nonlinear problems in Gurobi. But the problem is related to the expressions `@NLconstraint` and `@NLobjective`. In JuMP this is the way to use for nonlinear programming as far as I know. The environment has no problem and it is updated as well.

````nohighlight
  Updating `C:\Users\Utente\.julia\environments\v1.3\Project.toml`
 [no changes]
  Updating `C:\Users\Utente\.julia\environments\v1.3\Manifest.toml`
 [no changes]```
````

---

<div class="post-metadata">

### Author: ![miles.lubin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miles.lubin/32/279_2.png) [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)
#### Post date: [January 30, 2020, 4:40pm UTC](https://discourse.julialang.org/t/jump-for-gurobi-9-0/33983/4 "2020-01-30T16:40:49Z")

</div>

If you’re referring to Gurobi’s support for nonconvex quadratic expressions, use `@constraint` and `@objective` instead of `@NLconstraint` and `@NLobjective`.

---

<div class="post-metadata">

### Author: ![Arega\_Getaneh](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@Arega\_Getaneh](https://discourse.julialang.org/u/Arega_Getaneh)
#### Post date: [January 30, 2020, 4:55pm UTC](https://discourse.julialang.org/t/jump-for-gurobi-9-0/33983/5 "2020-01-30T16:55:41Z")

</div>

Thanks! This way it seems working. But I have another error which was not there while I was using Ipopt solver. It says “Gurobi.GurobiError(10020, “Q matrix is not positive semi-definite (PSD)”)”. FYI. I have a parameter Q which I generated randomly.

```julia
 [1] optimize at C:\Users\Utente\.julia\packages\Gurobi\CI8ht\src\grb_solve.jl:7 [inlined]
 [2] optimize!(::Gurobi.Optimizer) at C:\Users\Utente\.julia\packages\Gurobi\CI8ht\src\MOI_wrapper.jl:1803
 [3] optimize!(::MathOptInterface.Bridges.LazyBridgeOptimizer{Gurobi.Optimizer}) at C:\Users\Utente\.julia\packages\MathOptInterface\C1XBe\src\Bridges\bridge_optimizer.jl:239
 [4] optimize!(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}) at C:\Users\Utente\.julia\packages\MathOptInterface\C1XBe\src\Utilities\cachingoptimizer.jl:189
 [5] #optimize!#78(::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(optimize!), ::Model, ::Nothing) at C:\Users\Utente\.julia\packages\JuMP\MsUSY\src\optimizer_interface.jl:141
 [6] macro expansion at C:\Users\Utente\.julia\packages\JuMP\MsUSY\src\optimizer_interface.jl:111 [inlined]
 [7] general_equi_NLP(::Int64, ::Int64, ::Int64, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,1}, ::Int64, ::Array{Float64,1}, ::Float64, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Int64, ::Float64, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}) at .\In[10]:111
 [8] top-level scope at In[11]:1
```
