# A question about write\_to\_file in JuMP

**URL:** <https://discourse.julialang.org/t/a-question-about-write-to-file-in-jump/80643>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [May 7, 2022, 2:13am UTC](https://discourse.julialang.org/t/a-question-about-write-to-file-in-jump/80643 "2022-05-07T02:13:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahon](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@mahon](https://discourse.julialang.org/u/mahon)\
**Post date:** [May 7, 2022, 2:13am UTC](https://discourse.julialang.org/t/a-question-about-write-to-file-in-jump/80643/1 "2022-05-07T02:13:01Z")

</div>

My model is a MISOCP model with Gurobi, if i want to solve it directly with Gurobi, how to code it?

```julia
julia> write_to_file(model, "model.lp")
ERROR: MathOptInterface.UnsupportedConstraint{MathOptInterface.VectorAffineFunction{Float64}, MathOptInterface.SecondOrderCone}: `MathOptInterface.VectorAffineFunction{Float64}`-in-`MathOptInterface.SecondOrderCone` constraint is not supported by the model.   
Stacktrace:

```

---

<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:** [May 7, 2022, 3:25am UTC](https://discourse.julialang.org/t/a-question-about-write-to-file-in-jump/80643/2 "2022-05-07T03:25:12Z")

</div>

JuMP doesn’t have a way to write MISOCP to a file format that Gurobi understands. But you can write out an MPS file using Gurobi’s extension to the MPS format:

```julia
using JuMP, Gurobi
model = direct_model(Gurobi.Optimizer())
# ... build model
GRBwrite(backend(model), "model.mps")

```

You could then pass that MPS file to `gurobi_cl`.

Edit: the error message occurred because the LP file format doesn’t support SOCP. But we should improve the error message: [Improve error message for write\_to\_file when unsupported · Issue #2974 · jump-dev/JuMP.jl · GitHub](https://github.com/jump-dev/JuMP.jl/issues/2974)
