/
build.jl
96 lines (86 loc) · 7.61 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
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),
]
## 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:
download_info = Dict(
Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.10.3.aarch64-linux-gnu-gcc7.tar.gz", "2f4f8470d5ad1ba94c5456e534acc7dc7b39a65bb8fe80c574d57bb7a09d0a33"),
Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.10.3.aarch64-linux-gnu-gcc8.tar.gz", "0d5f8aa1bd29ad1948c32aedbb802e0e3c8ad9fdbece857cc5ec554e37d59592"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.10.3.arm-linux-gnueabihf-gcc7.tar.gz", "317b915dc88ae80946a024e43b7005bc4c355fb6bded736b5e3d3905fc1181da"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.10.3.arm-linux-gnueabihf-gcc8.tar.gz", "0deae3b140379380df1eb91f1e0dfdedd523fc5bedaa905d84a566e2c2d7394a"),
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CbcBuilder.v2.10.3.i686-linux-gnu-gcc4.tar.gz", "b3ae1aa3eb0c4e857c85c03d7b5f47918c89251e2919b3a20c8325ee0c218fbe"),
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.10.3.i686-linux-gnu-gcc7.tar.gz", "efa9f5a1a177d227de847652ace146e739be1f25d7f9be3e8d86f39cf2c61a05"),
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.10.3.i686-linux-gnu-gcc8.tar.gz", "ca250bbcc505a228f769d2b9ec96e04537c2a49420f50bf744eface5c988fb53"),
Windows(:i686, compiler_abi=CompilerABI(:gcc6)) => ("$bin_prefix/CbcBuilder.v2.10.3.i686-w64-mingw32-gcc6.tar.gz", "77ced49c1c47fecfe8eb7b6f4e34a4a5550764d7174b03dc8f252578d681d633"),
Windows(:i686, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.10.3.i686-w64-mingw32-gcc7.tar.gz", "49c443e52a02367a2759867c387023ce031b046b063287b927125ea39e6d9b30"),
Windows(:i686, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.10.3.i686-w64-mingw32-gcc8.tar.gz", "f726efe558ec9ac6137c8ab68e8fd4aa1238caa56f7a1bb3aaf6d539b7d145ac"),
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CbcBuilder.v2.10.3.x86_64-apple-darwin14-gcc4.tar.gz", "c0487ea6c0a6ef80b3b62a94470d943f7eaea0cf7e69ef8532dbca288d182c18"),
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.10.3.x86_64-apple-darwin14-gcc7.tar.gz", "800ef428b72a51cd602c45ea5f33c437379369411ebae749941b9a18010a07eb"),
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.10.3.x86_64-apple-darwin14-gcc8.tar.gz", "0222b3178cefe53d416e04169185bfce34808a4f8940b3cebcfcaed8b055e594"),
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CbcBuilder.v2.10.3.x86_64-linux-gnu-gcc4.tar.gz", "48a97b0109b3b773757fc83e8c32e5a67612fbaf03f1d15f9cc9a2158845d9a8"),
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CbcBuilder.v2.10.3.x86_64-linux-gnu-gcc7.tar.gz", "86cddcacbf3133e6249da8c795bc1216ef425e585a446e00fec3856678204367"),
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CbcBuilder.v2.10.3.x86_64-linux-gnu-gcc8.tar.gz", "6be3a422be4f6fd4d382df0b82a50c4b54473ea59c66d775c4713e1ed7adc67d"),
Windows(:x86_64, compiler_abi=CompilerABI(:gcc6)) => ("$bin_prefix/CbcBuilder.v2.10.3.x86_64-w64-mingw32-gcc6.tar.gz", "fdb78659594db6f69b96d11dd48d83973da13cdaf72f5a69afbddc1d535c66b2"),
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
# 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)