@@ -8,24 +8,20 @@ module NLopt
8
8
using CEnum: @cenum
9
9
using NLopt_jll: libnlopt
10
10
11
- # [email protected] removed the LD_LBFGS_NOCEDAL enum.
12
- # See https://github.com/stevengj/nlopt/issues/584 for details.
13
- function _is_version_newer_than_2_9 ()
14
- major, minor, bugfix = Ref {Cint} (), Ref {Cint} (), Ref {Cint} ()
15
- @ccall libnlopt. nlopt_version (
16
- major:: Ptr{Cint} ,
17
- minor:: Ptr{Cint} ,
18
- bugfix:: Ptr{Cint} ,
19
- ):: Cvoid
20
- return (major[] > 2 ) || (major[] == 2 && minor[] >= 9 )
11
+ # ###########################################################################
12
+
13
+ function version ()
14
+ major, minor, patch = Ref {Cint} (), Ref {Cint} (), Ref {Cint} ()
15
+ nlopt_version (major, minor, patch)
16
+ return VersionNumber (major[], minor[], patch[])
21
17
end
22
18
23
19
include (" libnlopt.jl" )
24
20
25
21
# ###########################################################################
26
22
# Mirrors of NLopt's C enum constants:
27
23
28
- @static if _is_version_newer_than_2_9 ()
24
+ @static if v " 2.9 " ≤ version () < v " 2.10 "
29
25
@enum Algorithm:: Cint begin
30
26
GN_DIRECT = 0
31
27
GN_DIRECT_L
@@ -37,7 +33,7 @@ include("libnlopt.jl")
37
33
GN_ORIG_DIRECT_L
38
34
GD_STOGO
39
35
GD_STOGO_RAND
40
- # LD_LBFGS_NOCEDAL
36
+ # LD_LBFGS_NOCEDAL: temporarily removed in nlopt 2.9 (nlopt#584)
41
37
LD_LBFGS
42
38
LN_PRAXIS
43
39
LD_VAR1
@@ -446,12 +442,6 @@ numevals(o::Opt) = nlopt_get_numevals(o)
446
442
447
443
# ###########################################################################
448
444
449
- function version ()
450
- major, minor, patch = Ref {Cint} (), Ref {Cint} (), Ref {Cint} ()
451
- nlopt_version (major, minor, patch)
452
- return VersionNumber (major[], minor[], patch[])
453
- end
454
-
455
445
const NLOPT_VERSION = version ()
456
446
457
447
# ###########################################################################
0 commit comments