Skip to content

Commit d7f1459

Browse files
authored
Add C API for v12 (#582)
1 parent 522bf70 commit d7f1459

File tree

6 files changed

+4692
-25
lines changed

6 files changed

+4692
-25
lines changed

.codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ ignore:
44
- 'src/gen95'
55
- 'src/gen100'
66
- 'src/gen110'
7+
- 'src/gen120'

deps/build.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,8 @@ function write_depsfile(path)
2626
return
2727
end
2828

29-
const ALIASES = [
30-
"gurobi110",
31-
"gurobi100",
32-
"gurobi95",
33-
"gurobi91",
34-
"gurobi90"
35-
]
29+
const ALIASES =
30+
["gurobi120", "gurobi110", "gurobi100", "gurobi95", "gurobi91", "gurobi90"]
3631

3732
function _try_local_install()
3833
paths_to_try = copy(ALIASES)

scripts/gen.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
using Clang.Generators
1717

18-
const gurobi_c = "/Library/gurobi1100/macos_universal2/include/gurobi_c.h"
19-
const output_folder = "gen110"
18+
const gurobi_c = "/Library/gurobi1200/macos_universal2/include/gurobi_c.h"
19+
const output_folder = "gen120"
2020

2121
options = load_options(joinpath(@__DIR__, "generate.toml"))
2222
options["general"]["output_file_path"] =

scripts/generate.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ output_ignorelist = [
2727
opaque_as_mutable_struct = false
2828

2929
[codegen.macro]
30+
macro_mode = "aggressive"
3031
ignore_header_guards_with_suffixes = ["__stdcall"]

src/Gurobi.jl

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ else
3434
(:GRBversion, libgurobi),
3535
Cvoid,
3636
(Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
37-
majorP, minorP, technicalP,
37+
majorP,
38+
minorP,
39+
technicalP,
3840
)
3941
VersionNumber(majorP[], minorP[], technicalP[])
4042
end
@@ -57,26 +59,30 @@ elseif _is_patch(_GUROBI_VERSION, v"10.0")
5759
include("gen100/libgrb_api.jl")
5860
elseif _is_patch(_GUROBI_VERSION, v"11.0")
5961
include("gen110/libgrb_api.jl")
62+
elseif _is_patch(_GUROBI_VERSION, v"12.0")
63+
include("gen120/libgrb_api.jl")
6064
else
61-
error("""
62-
You have installed version $_GUROBI_VERSION of Gurobi, which is not
63-
supported by Gurobi.jl. We require Gurobi version 9.0 or 9.1 or 9.5
64-
or 10.0 or 11.0.
65+
error(
66+
"""
67+
You have installed version $_GUROBI_VERSION of Gurobi, which is not
68+
supported by Gurobi.jl. We require Gurobi version 9.0 or 9.1 or 9.5
69+
or 10.0 or 11.0 or 12.0.
6570
66-
After installing a supported version of Gurobi, run:
71+
After installing a supported version of Gurobi, run:
6772
68-
import Pkg
69-
Pkg.rm("Gurobi")
70-
Pkg.add("Gurobi")
73+
import Pkg
74+
Pkg.rm("Gurobi")
75+
Pkg.add("Gurobi")
7176
72-
Make sure you set the environment variable `GUROBI_HOME` following
73-
the instructions in the Gurobi.jl README, which is available at
74-
https://github.com/jump-dev/Gurobi.jl.
77+
Make sure you set the environment variable `GUROBI_HOME` following
78+
the instructions in the Gurobi.jl README, which is available at
79+
https://github.com/jump-dev/Gurobi.jl.
7580
76-
If you have a newer version of Gurobi installed, changes may need to be made
77-
to the Julia code. Please open an issue at
78-
https://github.com/jump-dev/Gurobi.jl.
79-
""")
81+
If you have a newer version of Gurobi installed, changes may need to be made
82+
to the Julia code. Please open an issue at
83+
https://github.com/jump-dev/Gurobi.jl.
84+
""",
85+
)
8086
end
8187

8288
include("MOI_wrapper/MOI_wrapper.jl")

0 commit comments

Comments
 (0)