Skip to content

Commit 4bb20fa

Browse files
committed
Re-enable support for KNITRO@13 and KNITRO@14
1 parent 135f37e commit 4bb20fa

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
@@ -248,7 +248,9 @@ end
248248

249249
# MOI.TimeLimitSec
250250

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

253255
MOI.get(model::Optimizer, ::MOI.TimeLimitSec) = model.time_limit_sec
254256

@@ -997,7 +999,9 @@ function MOI.supports_constraint(
997999
::Type{MOI.VectorOfVariables},
9981000
::Type{MOI.Complements},
9991001
)
1000-
return true
1002+
# We don't support complementarity constraints in older versions of KNITRO
1003+
# because we require `KN_add_compcons`.
1004+
return knitro_version() >= v"15"
10011005
end
10021006

10031007
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)