# writeLP in JuMP 0.19?

**URL:** <https://discourse.julialang.org/t/writelp-in-jump-0-19/22955>\
**Category:** Optimization (Mathematical)\
**Created:** [April 9, 2019, 1:19pm UTC](https://discourse.julialang.org/t/writelp-in-jump-0-19/22955 "2019-04-09T13:19:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mposs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mposs/32/21087_2.png) [@mposs](https://discourse.julialang.org/u/mposs)\
**Post date:** [April 9, 2019, 1:19pm UTC](https://discourse.julialang.org/t/writelp-in-jump-0-19/22955/1 "2019-04-09T13:19:24Z")

</div>

Hello

Is there an equivalent to writeLP in the new version of JuMP? I need to print a MILP in proper format (e.g., lp or mps)

Best,

Michael.

---

<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:** [April 9, 2019, 1:49pm UTC](https://discourse.julialang.org/t/writelp-in-jump-0-19/22955/2 "2019-04-09T13:49:16Z")

</div>

See [writeMPS() - #4 by odow](https://discourse.julialang.org/t/writemps/21669/4)  
Github: [https://github.com/odow/MathOptFormat.jl](https://github.com/odow/MathOptFormat.jl)

To install, run

```julia
] add https://github.com/odow/MathOptFormat.jl

```

Then you can write the model as follows

```julia
using JuMP, MathOptFormat
model = Model()
# ... model definition

lp_file = MathOptFormat.LP.Model()
MOI.copy_to(lp_file, backend(model))
MOI.write_to_file(lp_file, "my_model.lp")

```
