Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Cbc_jll on Julia 1.3 and up #133

Merged
merged 2 commits into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version = "0.6.7"

[deps]
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
Cbc_jll = "38041ee0-ae04-5750-a4d2-bb4d0d83d27d"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73"
Expand All @@ -13,6 +14,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
BinaryProvider = "0.5.3"
Cbc_jll = "=2.10.3"
MathOptInterface = "0.9.7"
MathProgBase = "~0.5.5, ~0.6, ~0.7"
julia = "1"
Expand Down
10 changes: 7 additions & 3 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if VERSION >= v"1.3" && !haskey(ENV, "JULIA_CBC_LIBRARY_PATH")
exit() # Use Cbc_jll instead.
end

using BinaryProvider # requires BinaryProvider 0.3.0 or later

# Parse some basic command-line arguments
Expand All @@ -8,7 +12,7 @@ products = [
LibraryProduct(prefix, ["libCbc"], :libCbc),
]

## START-VERSION-UPDATE-BLOCK
## START-VERSION-UPDATE-BLOCK
# Download binaries from hosted location
bin_prefix = "https://github.com/JuliaOpt/CbcBuilder/releases/download/v2.10.3-static-mono-small"
# Listing of files generated by BinaryBuilder:
Expand All @@ -33,8 +37,8 @@ download_info = Dict(
Windows(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.10.3.x86_64-w64-mingw32-gcc7.tar.gz", "aae75d7fe4f34da22233ca9ac0248f00c192be27a3ed43e7a1f8e921769e32a8"),
Windows(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.10.3.x86_64-w64-mingw32-gcc8.tar.gz", "123091adf7806c9c3748c4ceef0fe3929737340d8ad0e743b3b8c80dcf53b494"),
)
## END-VERSION-UPDATE-BLOCK
## END-VERSION-UPDATE-BLOCK

# To fix gcc4 bug in Windows
# https://sourceforge.net/p/mingw-w64/bugs/727/
this_platform = platform_key_abi()
Expand Down
10 changes: 7 additions & 3 deletions src/Cbc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ module Cbc
# bicycle1885/CodecZlib.jl#26.
using Libdl

if isfile(joinpath(@__DIR__, "..", "deps", "deps.jl"))
include(joinpath(@__DIR__, "..", "deps", "deps.jl"))
if haskey(ENV,"JULIA_CBC_LIBRARY_PATH") || VERSION < v"1.3"
if isfile(joinpath(@__DIR__, "..", "deps", "deps.jl"))
include(joinpath(@__DIR__, "..", "deps", "deps.jl"))
else
error("Cbc not properly installed. Please run Pkg.build(\"Cbc\")")
end
else
error("Cbc not properly installed. Please run Pkg.build(\"Cbc\")")
import Cbc_jll: libcbcsolver
end

include("CbcCInterface.jl")
Expand Down