mirror of
https://github.com/ANL-CEEESA/MIPLearn.jl.git
synced 2025-12-06 08:28:52 -06:00
Conditionally import Gurobi
This commit is contained in:
@@ -3,12 +3,16 @@
|
|||||||
# Released under the modified BSD license. See COPYING.md for more details.
|
# Released under the modified BSD license. See COPYING.md for more details.
|
||||||
|
|
||||||
using Cbc
|
using Cbc
|
||||||
using Gurobi
|
|
||||||
using JuMP
|
using JuMP
|
||||||
using MIPLearn
|
using MIPLearn
|
||||||
using PyCall
|
using PyCall
|
||||||
using Test
|
using Test
|
||||||
|
|
||||||
|
const is_gurobi_available = ("GUROBI_HOME" in keys(ENV))
|
||||||
|
if is_gurobi_available
|
||||||
|
using Gurobi
|
||||||
|
end
|
||||||
|
|
||||||
miplearn_tests = pyimport("miplearn.solvers.tests")
|
miplearn_tests = pyimport("miplearn.solvers.tests")
|
||||||
traceback = pyimport("traceback")
|
traceback = pyimport("traceback")
|
||||||
|
|
||||||
@@ -22,7 +26,7 @@ end
|
|||||||
@testset "Cbc" begin
|
@testset "Cbc" begin
|
||||||
_test_solver(Cbc.Optimizer)
|
_test_solver(Cbc.Optimizer)
|
||||||
end
|
end
|
||||||
if "GUROBI_HOME" in keys(ENV)
|
if is_gurobi_available
|
||||||
@testset "Gurobi" begin
|
@testset "Gurobi" begin
|
||||||
_test_solver(Gurobi.Optimizer)
|
_test_solver(Gurobi.Optimizer)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user