-
Notifications
You must be signed in to change notification settings - Fork 35
/
build.jl
97 lines (86 loc) · 7.91 KB
/
build.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using BinaryProvider # requires BinaryProvider 0.3.0 or later
# Parse some basic command-line arguments
const verbose = "--verbose" in ARGS
const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr")))
products = [
LibraryProduct(prefix, ["libCbcSolver"], :libcbcsolver),
LibraryProduct(prefix, ["libCbc"], :libCbc),
]
# Download binaries from hosted location
bin_prefix = "https://github.com/JuliaOpt/CbcBuilder/releases/download/v2.9.9-1-static-parallel"
# Listing of files generated by BinaryBuilder:
download_info = Dict(
Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CbcBuilder.v2.9.9.aarch64-linux-gnu-gcc4.tar.gz", "41a492db886312253fa86434790364132b97934a9706c02adef6e6d3fa856567"),
Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.9.9.aarch64-linux-gnu-gcc7.tar.gz", "2627fef08f83e9f0185e6f527b2a1fa64bd44c04525a08070e3cb3ca5beb5dad"),
Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.9.9.aarch64-linux-gnu-gcc8.tar.gz", "d7afc75ca388ff4537a4410a63870796dce9d3fda6f27b2e62324a01e1c16ce5"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CbcBuilder.v2.9.9.arm-linux-gnueabihf-gcc4.tar.gz", "2d609fec46296a37e6b70826221189292c386d8ed0f26ea943dc8df83e93cb7b"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.9.9.arm-linux-gnueabihf-gcc7.tar.gz", "9d9b878ed38b0fde0abd3bc5ca2538091b16bf96ad16481bb15efbdee157e745"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.9.9.arm-linux-gnueabihf-gcc8.tar.gz", "cb0d08bd69d21ca3891b1f300d4883b0f7c48511b8e70bfd0e7065037e331416"),
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CbcBuilder.v2.9.9.i686-linux-gnu-gcc4.tar.gz", "b3e12c39b25da8d38d73c6d06f63a7dbf2b9f75dd7fc0856b1da303b136e2c0b"),
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.9.9.i686-linux-gnu-gcc7.tar.gz", "d4e21a6102f3ca180fdbc3e1d8ad3a9f659b0b90719203898159f752acc8f97e"),
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.9.9.i686-linux-gnu-gcc8.tar.gz", "a8cc70d6d1bc19dd0c8b45d279c41c46456a695d9368428af4a1e35558f26358"),
Windows(:i686, compiler_abi=CompilerABI(:gcc6)) => ("$bin_prefix/CbcBuilder.v2.9.9.i686-w64-mingw32-gcc6.tar.gz", "c8b6a7aa20e805e3bfdc40b0bc8f879ed2dc79d3a20d3a285f5572ee0e8c4182"),
Windows(:i686, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.9.9.i686-w64-mingw32-gcc7.tar.gz", "f635753118f0a25c351710235214a7f087bfb2215ef038b2dbbcae4f7507f45b"),
Windows(:i686, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.9.9.i686-w64-mingw32-gcc8.tar.gz", "7eed8c3e67583c0bea13f954fb88b5baaec060a10f6a3227761cb47ed03485cd"),
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CbcBuilder.v2.9.9.x86_64-apple-darwin14-gcc4.tar.gz", "720f9ce39fa2f2e4a2bb0324fedaded7ecc552abaa43ccf84c278649502c98b6"),
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.9.9.x86_64-apple-darwin14-gcc7.tar.gz", "9406a5666611584f05a606955dbb938607e9a1448a1ee0e51465c2bbffdd41c9"),
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.9.9.x86_64-apple-darwin14-gcc8.tar.gz", "87c99037bde52800a1f3061fc998275fc6bfec4c34613327f01cf8cee70b5bc5"),
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CbcBuilder.v2.9.9.x86_64-linux-gnu-gcc4.tar.gz", "e41bc18ead7ee708b16d57177adc9c08651ca414d690c32d73040ae54756ed30"),
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.9.9.x86_64-linux-gnu-gcc7.tar.gz", "006b92dade50a3c75420dc1bfb311e16584cd95210f790c6b1dcc19fc2fd9ae7"),
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.9.9.x86_64-linux-gnu-gcc8.tar.gz", "b617514c16c61656ce878a4263cc86776e99944ffe1c57f1f402acd63c5722fb"),
Windows(:x86_64, compiler_abi=CompilerABI(:gcc6)) => ("$bin_prefix/CbcBuilder.v2.9.9.x86_64-w64-mingw32-gcc6.tar.gz", "23e25dd815acda60dfa44d2979448051bef5f0893af8d40939fa1d4613cf33bb"),
Windows(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.9.9.x86_64-w64-mingw32-gcc7.tar.gz", "98e4e2089d530e17fa201124c9f68c26e5c79a8fa2dbff4919194c95a0ef2292"),
Windows(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.9.9.x86_64-w64-mingw32-gcc8.tar.gz", "994410b63d842099f4b2beffed1a0b1da51832f416b23dd5f634e674b57429f7"),
)
# To fix gcc4 bug in Windows
# https://sourceforge.net/p/mingw-w64/bugs/727/
this_platform = platform_key_abi()
if typeof(this_platform)==Windows && this_platform.compiler_abi.gcc_version == :gcc4
this_platform = Windows(arch(this_platform), libc=libc(this_platform), compiler_abi=CompilerABI(:gcc6))
end
# no dynamic dependencies until Pkg3 support for binaries
dependencies = [
# "https://github.com/juan-pablo-vielma/CglBuilder/releases/download/v0.59.10-1/build_CglBuilder.v0.59.10.jl",
# "https://github.com/JuliaOpt/ClpBuilder/releases/download/v1.16.11-1/build_ClpBuilder.v1.16.11.jl",
# "https://github.com/juan-pablo-vielma/OsiBuilder/releases/download/v0.107.9-1/build_OsiBuilder.v0.107.9.jl",
# "https://github.com/juan-pablo-vielma/CoinUtilsBuilder/releases/download/v2.10.14-1/build_CoinUtilsBuilder.v2.10.14.jl",
# "https://github.com/juan-pablo-vielma/COINMumpsBuilder/releases/download/v1.6.0-1/build_COINMumpsBuilder.v1.6.0.jl",
# "https://github.com/juan-pablo-vielma/COINMetisBuilder/releases/download/v1.3.5-1/build_COINMetisBuilder.v1.3.5.jl",
# "https://github.com/juan-pablo-vielma/COINLapackBuilder/releases/download/v1.5.6-1/build_COINLapackBuilder.v1.5.6.jl",
# "https://github.com/juan-pablo-vielma/COINBLASBuilder/releases/download/v1.4.6-1/build_COINBLASBuilder.v1.4.6.jl",
# "https://github.com/juan-pablo-vielma/ASLBuilder/releases/download/v3.1.0-1/build_ASLBuilder.v3.1.0.jl"
]
custom_library = false
if haskey(ENV,"JULIA_CBC_LIBRARY_PATH")
custom_products = [LibraryProduct(ENV["JULIA_CBC_LIBRARY_PATH"],product.libnames,product.variable_name) for product in products]
if all(satisfied(p; verbose=verbose) for p in custom_products)
products = custom_products
custom_library = true
else
error("Could not install custom libraries from $(ENV["JULIA_CBC_LIBRARY_PATH"]).\nTo fall back to BinaryProvider call delete!(ENV,\"JULIA_CBC_LIBRARY_PATH\") and run build again.")
end
end
if !custom_library
# Install unsatisfied or updated dependencies:
unsatisfied = any(!satisfied(p; verbose=verbose) for p in products)
dl_info = choose_download(download_info, this_platform)
if dl_info === nothing && unsatisfied
# If we don't have a compatible .tar.gz to download, complain.
# Alternatively, you could attempt to install from a separate provider,
# build from source or something even more ambitious here.
error("Your platform (\"$(Sys.MACHINE)\", parsed as \"$(triplet(platform_key_abi()))\") is not supported by this package!")
end
# If we have a download, and we are unsatisfied (or the version we're
# trying to install is not itself installed) then load it up!
if unsatisfied || !isinstalled(dl_info...; prefix=prefix)
# Download and install binaries
# no dynamic dependencies until Pkg3 support for binaries
# for dependency in reverse(dependencies) # We do not check for already installed dependencies
# download(dependency,basename(dependency))
# evalfile(basename(dependency))
# end
install(dl_info...; prefix=prefix, force=true, verbose=verbose)
end
end
# Write out a deps.jl file that will contain mappings for our products
write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose)