# Adding CPLEX callbacks with JuMP v0.19

**URL:** <https://discourse.julialang.org/t/adding-cplex-callbacks-with-jump-v0-19/21449>\
**Category:** Optimization (Mathematical)\
**Created:** [March 4, 2019, 11:34am UTC](https://discourse.julialang.org/t/adding-cplex-callbacks-with-jump-v0-19/21449 "2019-03-04T11:34:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike\_k](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike_k/32/211864_2.png) [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Post date:** [March 4, 2019, 11:34am UTC](https://discourse.julialang.org/t/adding-cplex-callbacks-with-jump-v0-19/21449/1 "2019-03-04T11:34:39Z")

</div>

Dear community,  
I use CPLEX 12.8 and made an update from JuMP v18.5 to v0.19. Due to major changes in the new version I have to adapt my code, and I do not succeed to add callbacks. The [release notes](https://github.com/JuliaOpt/JuMP.jl/blob/master/NEWS.md) say that callbacks are now solver-specific, however, I cannot find something about that in the [documentation](https://github.com/JuliaOpt/CPLEX.jl) of CPLEX.jl nor the documentation of MathOptInterface.

Previously I could add a callback, for instance, with

```julia
function infocallback( cb )
  println("Hello, info callback")
end

addinfocallback( model, infocallback, when = :Intermediate )

```

However, this does not work anymore. Do you have any suggestions?  
Thank you in advance

---

<div class="post-metadata">

**Author:** ![leethargo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leethargo/32/6004_2.png) [@leethargo](https://discourse.julialang.org/u/leethargo)\
**Post date:** [March 4, 2019, 11:36am UTC](https://discourse.julialang.org/t/adding-cplex-callbacks-with-jump-v0-19/21449/2 "2019-03-04T11:36:43Z")

</div>

I have not used them myself, but there is a lot of discussion in this current PR: [https://github.com/JuliaOpt/CPLEX.jl/pull/207](https://github.com/JuliaOpt/CPLEX.jl/pull/207)

---

<div class="post-metadata">

**Author:** ![g001234](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/g001234/32/2956_2.png) [@g001234](https://discourse.julialang.org/u/g001234)\
**Post date:** [March 4, 2019, 1:16pm UTC](https://discourse.julialang.org/t/adding-cplex-callbacks-with-jump-v0-19/21449/3 "2019-03-04T13:16:11Z")

</div>

@leethargo is right. However, we have not committed that PR yet, and we still lack the connection for callbacks between CPLEX.jl and JuMP.jl. There are some discussions about whether callbacks should be solver specific or not. I am not aware of the conclusion.

---

<div class="post-metadata">

**Author:** ![mike\_k](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike_k/32/211864_2.png) [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Post date:** [March 4, 2019, 1:19pm UTC](https://discourse.julialang.org/t/adding-cplex-callbacks-with-jump-v0-19/21449/4 "2019-03-04T13:19:18Z")

</div>

So that means that callbacks are currently not working at all with JuMP v0.19?

---

<div class="post-metadata">

**Author:** ![g001234](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/g001234/32/2956_2.png) [@g001234](https://discourse.julialang.org/u/g001234)\
**Post date:** [March 4, 2019, 1:40pm UTC](https://discourse.julialang.org/t/adding-cplex-callbacks-with-jump-v0-19/21449/5 "2019-03-04T13:40:41Z")

</div>

Actually I am not sure. I think it works with Gurobi but I haven’t tried. For CPLEX the implementation should be similar. @odow would be a better person to answer your question. He usually replies quickly so let’s wait for his reply:)

---

<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:** [March 4, 2019, 1:44pm UTC](https://discourse.julialang.org/t/adding-cplex-callbacks-with-jump-v0-19/21449/6 "2019-03-04T13:44:03Z")

</div>

> [@mike\_k](#):
>
> However, this does not work anymore. Do you have any suggestions?

I suggest to continue using JuMP 0.18 until the callbacks you need are available and documented. Making this happen is a high priority issue.

---

<div class="post-metadata">

**Author:** ![mike\_k](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike_k/32/211864_2.png) [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Post date:** [March 4, 2019, 1:58pm UTC](https://discourse.julialang.org/t/adding-cplex-callbacks-with-jump-v0-19/21449/7 "2019-03-04T13:58:51Z")

</div>

@g001234 : thank you, hopefully @odow will do 🙂

@miles.lubin: Probably you are right, however, I wanted to avoid this option since I already did many changes in my code.

---

<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 4, 2019, 3:28pm UTC](https://discourse.julialang.org/t/adding-cplex-callbacks-with-jump-v0-19/21449/8 "2019-03-04T15:28:14Z")

</div>

There is unlikely to be any movement on this until after [JuMP-dev](http://www.juliaopt.org/meetings/santiago2019/). We’ll be discussing ways forward on the Thursday afternoon.
