I have a Julia package in development which has Gurobi.jl in environment as an available solver. Somehow, the github CI integration is against the Gurobi.jl pre-compilation since no license could be found on github action machine. However, the CI process will not use Gurobi for testing, instead HiGHS will be used. Is there a way to keep the Gurobi.jl in environment, while I could skip the license validation?
I have a Julia package in development which has Gurobi.jl in environment as an available solver.
Don’t do this.
Let the user choose which solver to use. There is no need to add it to the Project.toml. Adding solvers to the Project.toml means that every user installs all of the solvers, even if they never end up using them, and it runs into license issues like the one you are experiencing.
Thank you for your helpful insight. I might made this mistake, I added PkgJuMPExt = ["GLPK", "HiGHS", "JuMP"] in project.toml but everything works fine and okay I have dependency issues when adding SCIP.jl though.
So, we really don’t need to add any solver at all? Currently, I have opt = solver.Optimizer with default solver = HIGHS, and then I call model = Model(opt; add_bridges = false). So, the user can decide which solver to pass as solver.Optimizer? I hope I understood your comment correctly. Thank you for your time and consideration!
See this tutorial, but especially the linked section:
There is rarely a good reason to hard-code the choice of solver for the user. Even if you include a “default” solver like HiGHS, if the user chooses to use a different solver like SCIP or Gurobi, then installing your package will make them download and install HiGHS. Just let them choose, and document how to install some suggested packages.
My apologies for the oversight! The paper, page 20 that applied the mixed-integer problem formulation used GLPK. Based on your insightful comment here, I now understand that we should use HIGHS instead Thank you for your help!
In my experience, only Gurobi.jl will have the issue problem. I also have Cbc, Clp, Ipopt, GLPK, COPT, and CPLEX solvers configured internally but the solver.Optimizer does not lead to the license issue.
But the moral of the story is don’t preselect a fixed set of solvers that you distribute to users. Let them choose. That’s one of the nice things about JuMP.
I think I need to weigh the tradeoffs between the flexibility of users choosing solvers and convenience of specifying the solver with settings["Solver"]='Gurobi'. I have implemented the solver choice outside of the package and the CI passed. Much thanks!