Skip to content

Commit 621f050

Browse files
authored
Re-enable support for KNITRO@13 and KNITRO@14 (#369)
1 parent a09e629 commit 621f050

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ext/KNITROMathOptInterfaceExt.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ end
257257

258258
# MOI.TimeLimitSec
259259

260-
MOI.supports(model::Optimizer, ::MOI.TimeLimitSec) = true
260+
# We support `MOI.TimeLimitSec` only in newer versions of KNITRO because we
261+
# require `KN_PARAM_MAXTIME`.
262+
MOI.supports(::Optimizer, ::MOI.TimeLimitSec) = KNITRO.knitro_version() >= v"15"
261263

262264
MOI.get(model::Optimizer, ::MOI.TimeLimitSec) = model.time_limit_sec
263265

@@ -1006,7 +1008,9 @@ function MOI.supports_constraint(
10061008
::Type{MOI.VectorOfVariables},
10071009
::Type{MOI.Complements},
10081010
)
1009-
return true
1011+
# We don't support complementarity constraints in older versions of KNITRO
1012+
# because we require `KN_add_compcons`.
1013+
return KNITRO.knitro_version() >= v"15"
10101014
end
10111015

10121016
function MOI.add_constraint(

src/KNITRO.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ end
2828
@static if isdefined(@__MODULE__, :libknitro)
2929
# deps.jl must define a local installation.
3030
let version = has_knitro() ? knitro_version() : v"15.0.0"
31-
if v"15" <= version < v"16"
31+
if v"13" <= version < v"16"
3232
error(
3333
"You have installed version $version of Artelys Knitro, " *
3434
"which is not supported by KNITRO.jl. We require a version " *
35-
"in [15, 16)",
35+
"in [13, 16)",
3636
)
3737
end
3838
end

0 commit comments

Comments
 (0)