From 92607c1c03a01e6043a9049b926ebf5747fcd3e8 Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Wed, 29 Nov 2023 15:11:20 -0600 Subject: [PATCH] Update src/NLPModelsKnitro.jl --- src/NLPModelsKnitro.jl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/NLPModelsKnitro.jl b/src/NLPModelsKnitro.jl index d6957c8..e2cc718 100644 --- a/src/NLPModelsKnitro.jl +++ b/src/NLPModelsKnitro.jl @@ -14,7 +14,17 @@ else end function __init__() - KNITRO.__init__() + libiomp5 = replace(libknitro, "libknitro" => "libiomp5") + isfile(libiomp5) && Libdl.dlopen(libiomp5) + version = KNITRO.has_knitro() ? KNITRO.knitro_version() : v"0.0.0" + if version != v"0.0.0" && version < v"11.0" + error( + "You have installed version $version of Artelys " * + "Knitro, which is not supported by KNITRO.jl. We require a " * + "Knitro version greater than 11.0.", + ) + end + return end """