-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rewrite CPLEX using Clang * Fix off-by-1 error in addmipstarts * Fix TerminationStatus * Add column function * Remove JuMP from Project.toml * Fix handling of env finalizer * Add test for manual finalizing * Update list of private functions and symbols * Deprecate all existing functions * Deprecate .inner field access * Improve error message on failed install * Update README * Check user's version correctly * Install 12100 on Travis * Update scripts
- Loading branch information
Showing
56 changed files
with
6,261 additions
and
10,152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
*.log | ||
*.cov | ||
Manifest.toml | ||
|
||
scripts/*.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,7 @@ os: | |
- linux | ||
julia: | ||
- 1.0 | ||
- 1.1 | ||
- 1.3 | ||
- 1 | ||
notifications: | ||
email: false | ||
branches: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
name = "CPLEX" | ||
uuid = "a076750e-1247-5638-91d2-ce28b192dca0" | ||
repo = "https://github.com/jump-dev/CPLEX.jl" | ||
version = "0.6.6" | ||
version = "0.7.0" | ||
|
||
[deps] | ||
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" | ||
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" | ||
MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73" | ||
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" | ||
|
||
[compat] | ||
Compat = "2, 3" | ||
CEnum = "0.3, 0.4" | ||
MathOptInterface = "0.9.14" | ||
MathProgBase = "~0.5.0, ~0.6, ~0.7" | ||
julia = "1" | ||
|
||
[extras] | ||
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" | ||
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" | ||
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Compat", "Pkg", "Random", "Test"] | ||
test = ["Random", "Test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[deps] | ||
Clang = "40e3b903-d033-50b4-a0cc-940c62c95e31" | ||
|
||
[compat] | ||
Clang = "0.12" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# TODO(odow): | ||
# | ||
# This script can be used to build the C interface to CPLEX. However, it | ||
# requires you to manually do the following steps first: | ||
# | ||
# 1) Copy cplex.h from CPLEX into this /scripts directory | ||
# 2) Copy cpxconst.h from CPLEX into this /scripts directory | ||
# | ||
# You should also check for an updated version of Clang.jl, and update if one is | ||
# available. | ||
|
||
import Clang | ||
|
||
const LIBCPX_HEADERS = [ | ||
joinpath(@__DIR__, "cplex.h"), | ||
joinpath(@__DIR__, "cpxconst.h"), | ||
] | ||
|
||
const GEN_DIR = joinpath(dirname(@__DIR__), "src", "gen") | ||
|
||
wc = Clang.init( | ||
headers = LIBCPX_HEADERS, | ||
output_file = joinpath(GEN_DIR, "libcpx_api.jl"), | ||
common_file = joinpath(GEN_DIR, "libcpx_common.jl"), | ||
clang_args = String[ | ||
"-I" * header for header in Clang.find_std_headers() | ||
], | ||
header_wrapped = (root, current) -> root == current, | ||
header_library = x -> "libcplex", | ||
clang_diagnostics = true, | ||
) | ||
|
||
run(wc) | ||
|
||
function manual_corrections_common() | ||
filename = joinpath(GEN_DIR, "libcpx_common.jl") | ||
lines = readlines(filename; keep = true) | ||
for (i, line) in enumerate(lines) | ||
if occursin("CPXINT_MAX", line) | ||
lines[i] = replace(line, "= INT_MAX" => "= $(typemax(Cint))") | ||
elseif occursin("CPXINT_MIN", line) | ||
lines[i] = replace(line, "= INT_MIN" => "= $(typemin(Cint))") | ||
elseif occursin("= version", line) | ||
lines[i] = replace(line, "= version" => "= nothing") | ||
elseif occursin("= NAN", line) | ||
lines[i] = replace(line, "= NAN" => "= NaN") | ||
elseif occursin("# Skipping Typedef: CXType_FunctionProto ", line) | ||
lines[i] = replace( | ||
replace( | ||
line, | ||
"# Skipping Typedef: CXType_FunctionProto " => "const " | ||
), | ||
'\n' => " = Ptr{Cvoid}\n" | ||
) | ||
end | ||
end | ||
open(filename, "w") do io | ||
print.(Ref(io), lines) | ||
end | ||
end | ||
manual_corrections_common() | ||
|
||
function manual_corrections_api() | ||
filename = joinpath(GEN_DIR, "libcpx_api.jl") | ||
lines = readlines(filename; keep = true) | ||
for (i, line) in enumerate(lines) | ||
if occursin("Cstring", line) | ||
lines[i] = replace(line, "Cstring" => "Ptr{Cchar}") | ||
end | ||
end | ||
open(filename, "w") do io | ||
print.(Ref(io), lines) | ||
end | ||
end | ||
manual_corrections_api() | ||
|
||
rm(joinpath(GEN_DIR, "LibTemplate.jl")) |
Oops, something went wrong.