Skip to content

Commit 3428009

Browse files
committed
Update src/LibSCIP using the latest SCIP_jll
1 parent adcbcc1 commit 3428009

File tree

5 files changed

+47059
-45855
lines changed

5 files changed

+47059
-45855
lines changed

gen/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[deps]
22
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31"
3+
SCIP_jll = "e5ac4fe4-a920-5659-9bf8-f9f73e9e79ce"

gen/generate_wrapper.jl

Lines changed: 19 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,24 @@
66
using Clang.Generators
77
using SCIP_jll
88

9-
cd(@__DIR__)
9+
const HEADER_BASE = joinpath(SCIP_jll.artifact_dir, "include")
1010

11-
const (HEADER_BASE, is_default) = if haskey(ENV, "SCIPDIR")
12-
(joinpath(ENV["SCIPDIR"], "src"), false)
13-
else
14-
(joinpath(SCIP_jll.artifact_dir, "include"), true)
15-
end
16-
17-
const SCIP_TYPES_H =
18-
filter(readdir(joinpath(HEADER_BASE, "scip"); join=true)) do f
19-
occursin("type", f) && endswith(f, ".h")
20-
end
21-
push!(SCIP_TYPES_H, joinpath(HEADER_BASE, "scip/def.h"))
22-
push!(SCIP_TYPES_H, joinpath(HEADER_BASE, "scip/nlpi.h"))
23-
push!(SCIP_TYPES_H, joinpath(HEADER_BASE, "scip/scipdefplugins.h"))
24-
25-
# add the generated config.h file, either from JLL or build dir
26-
if is_default
27-
push!(SCIP_TYPES_H, joinpath(HEADER_BASE, "scip/config.h"))
28-
end
29-
30-
const SCIP_PUB_H =
11+
headers = vcat(
3112
filter(readdir(joinpath(HEADER_BASE, "scip"); join=true)) do f
32-
occursin("pub", f) && endswith(f, ".h")
33-
end
34-
35-
const SCIP_MEM_H =
36-
filter(readdir(joinpath(HEADER_BASE, "blockmemshell"); join=true)) do f
37-
endswith(f, ".h")
38-
end
39-
40-
const SCIP_LPI_H = filter(readdir(joinpath(HEADER_BASE, "lpi"); join=true)) do f
41-
endswith(f, ".h")
42-
end
43-
44-
headers = append!(SCIP_TYPES_H, SCIP_PUB_H, SCIP_MEM_H, SCIP_LPI_H)
45-
46-
options = load_options(joinpath(@__DIR__, "generator.toml"))
47-
48-
args = get_default_args()
49-
push!(args, "-I$HEADER_BASE")
50-
if !is_default
51-
push!(args, "-I$SCIP_BUILD_DIR/scip")
52-
end
53-
54-
ctx = create_context(headers, args, options)
55-
56-
build!(ctx)
13+
return occursin("type", f) || occursin("pub", f)
14+
end,
15+
joinpath(HEADER_BASE, "scip/def.h"),
16+
joinpath(HEADER_BASE, "scip/nlpi.h"),
17+
joinpath(HEADER_BASE, "scip/scipdefplugins.h"),
18+
joinpath(HEADER_BASE, "scip/config.h"),
19+
readdir(joinpath(HEADER_BASE, "blockmemshell"); join=true),
20+
readdir(joinpath(HEADER_BASE, "lpi"); join=true),
21+
)
22+
23+
build!(
24+
create_context(
25+
filter!(f -> endswith(f, ".h"), headers),
26+
vcat(get_default_args(), "-I$HEADER_BASE"),
27+
load_options(joinpath(@__DIR__, "generator.toml")),
28+
),
29+
)

gen/generator.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[general]
22
library_name = "libscip"
3-
output_file_path = "../src/LibSCIP.jl"
3+
output_file_path = "src/LibSCIP.jl"
44
module_name = "LibSCIP"
5-
prologue_file_path = "./prologue.jl"
6-
export_symbol_prefixes = ["SCIP_", "SCIP", "BMS_"]
5+
prologue_file_path = "gen/prologue.jl"
6+
export_symbol_prefixes = ["SCIP", "BMS_"]
77

88
use_julia_native_enum_type = true
99
use_deterministic_symbol = true

gen/prologue.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2018 Felipe Serrano, Miles Lubin, Robert Schwarz, and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
using ..SCIP: libscip
27

38
const uint8_t = UInt8

0 commit comments

Comments
 (0)