From ddb77270aa2ad6bd87fe73f2ff864e12beee3e20 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 19 Aug 2024 16:44:12 +1200 Subject: [PATCH] Update --- src/NLopt.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/NLopt.jl b/src/NLopt.jl index 710059e..bc699c5 100644 --- a/src/NLopt.jl +++ b/src/NLopt.jl @@ -800,16 +800,6 @@ function optimize(o::Opt, x::AbstractVector{<:Real}) return optimize!(o, copyto!(Array{Cdouble}(undef, length(x)), x)) end -@static if !isdefined(Base, :get_extension) - include("../ext/NLoptMathOptInterfaceExt.jl") - using .NLoptMathOptInterfaceExt - const Optimizer = NLoptMathOptInterfaceExt.Optimizer -else - # declare this upfront so that the MathOptInterface extension can assign it - # without creating a new global - global Optimizer -end - export Opt, NLOPT_VERSION, algorithm, @@ -853,4 +843,14 @@ export Opt, Algorithm, Result +@static if !isdefined(Base, :get_extension) + include("../ext/NLoptMathOptInterfaceExt.jl") + using .NLoptMathOptInterfaceExt + const Optimizer = NLoptMathOptInterfaceExt.Optimizer +else + # declare this upfront so that the MathOptInterface extension can assign it + # without creating a new global + global Optimizer +end + end # module