Skip to content

Commit cae76c0

Browse files
authored
Update to HiGHS v1.2.1 (#92)
1 parent b10a04a commit cae76c0

File tree

8 files changed

+1625
-369
lines changed

8 files changed

+1625
-369
lines changed

Project.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
name = "HiGHS"
22
uuid = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
3-
version = "1.0.1"
3+
version = "1.1.0"
44

55
[deps]
66
HiGHS_jll = "8fd58aa0-07eb-5a78-9b36-339c94fd15ea"
77
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
88
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
99

1010
[compat]
11-
HiGHS_jll = "=1.2.0"
11+
HiGHS_jll = "=1.2.0, =1.2.1"
1212
MathOptInterface = "1"
1313
julia = "1.6"
1414

gen/Project.toml

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ HiGHS_jll = "8fd58aa0-07eb-5a78-9b36-339c94fd15ea"
44

55
[compat]
66
Clang = "0.14"
7+
HiGHS_jll = "1.2.1"

gen/gen.jl

+13-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@ using Clang.Generators
22
import HiGHS_jll
33

44
highs = joinpath(HiGHS_jll.artifact_dir, "include")
5+
c_api = joinpath(highs, "interfaces", "highs_c_api.h")
6+
57
build!(
68
create_context(
7-
[
8-
joinpath(highs, "interfaces", "highs_c_api.h"),
9-
joinpath(highs, "util", "HighsInt.h"),
10-
],
9+
[c_api, joinpath(highs, "util", "HighsInt.h")],
1110
vcat(get_default_args(), "-I$highs"),
1211
load_options(joinpath(@__DIR__, "generate.toml")),
1312
),
1413
)
14+
15+
open(joinpath(@__DIR__, "..", "src", "gen", "libhighs.jl"), "a") do io
16+
for line in readlines(c_api)
17+
m = match(r"const HighsInt kHighs([a-zA-Z]+) = (-?[0-9]+);", line)
18+
if m === nothing
19+
continue
20+
end
21+
println(io, "const kHighs$(m[1]) = HighsInt($(m[2]))")
22+
end
23+
end

gen/generate.toml

-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
[general]
22
library_name = "libhighs"
33
output_file_path = "src/gen/libhighs.jl"
4-
use_julia_native_enum_type = false
54
print_using_CEnum = false
6-
use_deterministic_symbol = true
7-
is_local_header_only = true
8-
smart_de_anonymize = true
9-
printer_blacklist = []
105
extract_c_comment_style = "doxygen"
11-
12-
[codegen]
13-
use_julia_bool = true
14-
always_NUL_terminated_string = true
15-
is_function_strictly_typed = false
16-
opaque_func_arg_as_PtrCvoid = false
17-
opaque_as_mutable_struct = true

src/HiGHS.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module HiGHS
22

33
import HiGHS_jll
4+
import MathOptInterface
5+
import SparseArrays
46

57
function __init__()
68
global libhighs = HiGHS_jll.libhighs
@@ -14,7 +16,7 @@ include("MOI_wrapper.jl")
1416
# in your environment, then use `import HiGHS` instead of `using HiGHS`.
1517

1618
for sym in names(@__MODULE__, all = true)
17-
if startswith(string(sym), "Highs_")
19+
if startswith("$sym", "Highs_") || startswith("$sym", "kHighs")
1820
@eval export $sym
1921
end
2022
end

0 commit comments

Comments
 (0)