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

Multi-GCC BinaryBuilder Binary Dependencies for Julia v1.0 #48

Merged
merged 38 commits into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9bd2ef1
Update build.jl
juan-pablo-vielma Oct 2, 2018
0e82992
Update build.jl
juan-pablo-vielma Oct 2, 2018
5560db6
Update build.jl
juan-pablo-vielma Oct 2, 2018
5b92cc6
Update build.jl
juan-pablo-vielma Oct 2, 2018
b1868cc
Update build.jl
juan-pablo-vielma Oct 2, 2018
f1b5eb8
Update build.jl
juan-pablo-vielma Oct 3, 2018
a988057
Update build.jl
juan-pablo-vielma Oct 4, 2018
d3c3d60
Update build.jl
juan-pablo-vielma Oct 5, 2018
e3e761f
Update build.jl
juan-pablo-vielma Oct 5, 2018
b324242
Update build.jl
juan-pablo-vielma Oct 10, 2018
8d9d955
Update build.jl
juan-pablo-vielma Oct 13, 2018
b89ef6f
Update build.jl
juan-pablo-vielma Oct 13, 2018
8e408de
Update build.jl
juan-pablo-vielma Nov 14, 2018
dcfcf7e
Update build.jl
juan-pablo-vielma Nov 14, 2018
c8dddc5
Update build.jl
juan-pablo-vielma Nov 16, 2018
4379494
Update build.jl
juan-pablo-vielma Nov 16, 2018
948a8fe
Update build.jl
juan-pablo-vielma Nov 16, 2018
fc65250
Update build.jl
juan-pablo-vielma Nov 16, 2018
4ec16f3
Merge pull request #1 from JuliaOpt/master
juan-pablo-vielma Nov 29, 2018
0b5de12
update BinaryProvider requirement to 0.5.3
juan-pablo-vielma Nov 29, 2018
d5cad05
Update build.jl
juan-pablo-vielma Dec 23, 2018
577e2a7
Update build.jl
juan-pablo-vielma Dec 23, 2018
47b8bad
Update build.jl
juan-pablo-vielma Dec 27, 2018
0af9d5d
Update build.jl
juan-pablo-vielma Dec 28, 2018
c6cb5ad
Update build.jl
juan-pablo-vielma Dec 29, 2018
ce9ebcf
Update README.md
juan-pablo-vielma Dec 30, 2018
3c2718c
Update REQUIRE
juan-pablo-vielma Dec 30, 2018
344c680
Update .travis.yml
juan-pablo-vielma Dec 30, 2018
5b569c9
Update appveyor.yml
juan-pablo-vielma Dec 30, 2018
4be7f7c
Update README.md
juan-pablo-vielma Dec 30, 2018
d3e52d2
Update README.md
juan-pablo-vielma Dec 30, 2018
45ba6fc
Update Clp.jl
juan-pablo-vielma Dec 30, 2018
af197db
Update build.jl
juan-pablo-vielma Dec 30, 2018
19e203c
should actually work on julia v0.7 too
juan-pablo-vielma Dec 30, 2018
faac7cf
Minor edits
mlubin Jan 1, 2019
c927f33
Document unused import.
mlubin Jan 1, 2019
baeca78
style fixes and comments
juan-pablo-vielma Jan 2, 2019
404dbf0
Update build.jl
juan-pablo-vielma Jan 3, 2019
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
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ os:
- linux
- osx
julia:
- 0.6
- 0.7
- 1.0

Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ solver-independent `MathProgBase` and `MathOptInterface` API's.
project.*

[![Build Status](https://travis-ci.org/JuliaOpt/Clp.jl.svg?branch=master)](https://travis-ci.org/JuliaOpt/Clp.jl)

[![Clp](http://pkg.julialang.org/badges/Clp_0.6.svg)](http://pkg.julialang.org/?pkg=Clp&ver=0.6)
[![codecov](https://codecov.io/gh/JuliaOpt/Clp.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaOpt/Clp.jl)

[Clp]: https://projects.coin-or.org/Clp
[Cbc]: https://github.com/JuliaOpt/Cbc.jl
Expand All @@ -22,22 +21,21 @@ project.*
The package is registered in `METADATA.jl` and so can be installed with `Pkg.add`.

```
julia> Pkg.add("Clp")
julia> import Pkg; Pkg.add("Clp")
```

Clp.jl will use [BinaryProvider.jl](https://github.com/JuliaPackaging/BinaryProvider.jl) to automatically install the Clp binaries.
Clp.jl will use [BinaryProvider.jl](https://github.com/JuliaPackaging/BinaryProvider.jl) to automatically install the Clp binaries. This should work for both the official Julia binaries from `https://julialang.org/downloads/` and source-builds.

## Custom Installation

After Clp.jl is installed and built, you can replace the installed binary dependencies with custom builds by overwritting the binaries and libraries in Clp.jl's `deps/usr` folder. For instance, Julia v0.6 this can be achieved by running
```bash
./configure --prefix=$HOME/.julia/v0.6/Clp/deps/usr ...
make
make install
To install custom built Clp binaries set the environmental variable `JULIA_CLP_LIBRARY_PATH` and call `import Pkg; Pkg.build("Clp")`. For instance, if the libraries are installed in `/opt/lib`, then call
```julia
ENV["JULIA_CLP_LIBRARY_PATH"] = "/opt/lib"
import Pkg; Pkg.build("Clp")
```
in Clp's source folder.
If you do not want BinaryProvider to download the default binaries on install, set `JULIA_CLP_LIBRARY_PATH` before calling `import Pkg; Pkg.add("Clp")`.

Note that the custom binaries will not be overwritten by subsequent builds of the currently installed version of Clp.jl. However, if Clp.jl is updated and the update includes new BinaryProvider versions of the Clp binaries, then the custom binaries will be overwritten by the new BinaryProvider versions.
To switch back to the default binaries clear `JULIA_CLP_LIBRARY_PATH` and call `import Pkg; Pkg.build("Clp")`.

### Using with **[MathProgBase]**

Expand Down
4 changes: 2 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
julia 0.6.2
julia 0.7
Compat 0.59
BinaryProvider 0.3
BinaryProvider 0.5.3
MathProgBase 0.5 0.8
LinQuadOptInterface 0.4 0.5

1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
environment:
matrix:
- julia_version: 0.6
- julia_version: 0.7
- julia_version: 1.0

Expand Down
120 changes: 78 additions & 42 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,58 +1,94 @@
using BinaryProvider

dependencies = [
"https://github.com/juan-pablo-vielma/OsiBuilder/releases/download/v0.107.9-beta/build_OsiBuilder.v0.107.9.jl",
"https://github.com/juan-pablo-vielma/CoinUtilsBuilder/releases/download/v2.10.14-beta2/build_CoinUtilsBuilder.v2.10.14.jl",
"https://github.com/juan-pablo-vielma/COINGLPKBuilder/releases/download/v1.10.5-beta4/build_COINGLPKBuilder.v1.10.5.jl",
"https://github.com/juan-pablo-vielma/COINMumpsBuilder/releases/download/v1.6.0-beta/build_COINMumpsBuilder.v1.6.0.jl",
"https://github.com/juan-pablo-vielma/COINMetisBuilder/releases/download/v1.3.5-beta/build_COINMetisBuilder.v1.3.5.jl",
"https://github.com/juan-pablo-vielma/COINLapackBuilder/releases/download/v1.5.6-beta/build_COINLapackBuilder.v1.5.6.jl",
"https://github.com/juan-pablo-vielma/COINBLASBuilder/releases/download/v1.4.6-beta2/build_COINBLASBuilder.v1.4.6.jl"
]
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, String["libOsiClp"], :libOsiClp),
LibraryProduct(prefix, String["libClp"], :libClp),
LibraryProduct(prefix, String["libClpSolver"], :libClpSolver),
#LibraryProduct(prefix, ["libOsiClp"], :libOsiClp),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nit: Remove commented code or explain why it's commented and when it should be uncomented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted. We may want it back on the BinaryBuilder side eventually, but not on the BinaryProvider side.

LibraryProduct(prefix, ["libClp"], :libClp),
LibraryProduct(prefix, ["libClpSolver"], :libClpSolver),
]

# Download binaries from hosted location
bin_prefix = "https://github.com/juan-pablo-vielma/ClpBuilder/releases/download/v1.16.11-beta"
bin_prefix = "https://github.com/JuliaOpt/ClpBuilder/releases/download/v1.16.11-1-static"

# Listing of files generated by BinaryBuilder:
download_info = Dict(
Linux(:aarch64, :glibc) => ("$bin_prefix/ClpBuilder.v1.16.11.aarch64-linux-gnu.tar.gz", "8dd14d6149933cd7c989a2b71711ecef39cf578229ed0c05174114902fc89259"),
Linux(:armv7l, :glibc, :eabihf) => ("$bin_prefix/ClpBuilder.v1.16.11.arm-linux-gnueabihf.tar.gz", "68e6400ffb69717cfd421876b8e376378bee7d0fa714d6d5b13a5bf4f68b5d6a"),
Linux(:i686, :glibc) => ("$bin_prefix/ClpBuilder.v1.16.11.i686-linux-gnu.tar.gz", "f24960b4e00e13ecc0d0eb1ae3332d606c2f7c62e7f14df55096ddeaec94822d"),
Windows(:i686) => ("$bin_prefix/ClpBuilder.v1.16.11.i686-w64-mingw32.tar.gz", "538d158389d70eab44ac4481119d5712de940452a4aa9d0b8f36d141285e4b00"),
MacOS(:x86_64) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-apple-darwin14.tar.gz", "0197c7100870427a652ced8a3954ae6acac9f65bba4b81cad4747c3bf28801b4"),
Linux(:x86_64, :glibc) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-linux-gnu.tar.gz", "cd5c66ab1375219037b78e0b189c4491c613515c6831e8918663369362f9c47d"),
Windows(:x86_64) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-w64-mingw32.tar.gz", "aa48ab4ba27cee81589a601e6ce7bbae28b504d7388a48c2c0f5250074f1da8c"),
Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/ClpBuilder.v1.16.11.aarch64-linux-gnu-gcc4.tar.gz", "7486e8fee3ee02770276692784cbb2f6f5833445af5873ba4ee8e0dccce73ea9"),
Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/ClpBuilder.v1.16.11.aarch64-linux-gnu-gcc7.tar.gz", "d245f665a2cd764cb220a15bd25b8f22d39e29c1a8602830d76bccb98d6efcfa"),
Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/ClpBuilder.v1.16.11.aarch64-linux-gnu-gcc8.tar.gz", "4f35d9c124ce56a7289c7648a417f1ecaa771282f66eb7f958ed5e4d434a9e0e"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/ClpBuilder.v1.16.11.arm-linux-gnueabihf-gcc4.tar.gz", "476be15b10ee70b20f20ae4f5120e1664715de406bf504b8ac1ae447214aedaf"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/ClpBuilder.v1.16.11.arm-linux-gnueabihf-gcc7.tar.gz", "ffdb45fd798892b850d95b2a26c59f3f86a702a82c0ab227a9f8aebb75b892f4"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/ClpBuilder.v1.16.11.arm-linux-gnueabihf-gcc8.tar.gz", "fffbea4035857537006f3e466ef72369d4daa149e960bd69ee8c7d52562013f8"),
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/ClpBuilder.v1.16.11.i686-linux-gnu-gcc4.tar.gz", "cbcd28e3ac7a6bd1250294a804114181c87f1b616113225ef7d35dcfb7f6ffa7"),
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/ClpBuilder.v1.16.11.i686-linux-gnu-gcc7.tar.gz", "977b830cd6997272cdee726c6deab24a5ccb54e5d10626c47d6be630a684db44"),
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/ClpBuilder.v1.16.11.i686-linux-gnu-gcc8.tar.gz", "718aad4ef7d46106ca8f1f082bface33c3b64e223b523ce02ba143e8e08b72e7"),
Windows(:i686, compiler_abi=CompilerABI(:gcc6)) => ("$bin_prefix/ClpBuilder.v1.16.11.i686-w64-mingw32-gcc6.tar.gz", "181fef44a57723a3d9e4cac6828aff308d2fa849245f6bf800110c7645a7bfdd"),
Windows(:i686, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/ClpBuilder.v1.16.11.i686-w64-mingw32-gcc7.tar.gz", "252ecd181bb32b5610d3131b3eee0c70cc68ae3f1d4fe2ba689256caf52afe86"),
Windows(:i686, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/ClpBuilder.v1.16.11.i686-w64-mingw32-gcc8.tar.gz", "0ac76950c0874f06bb52b13a85ec813181aa9c9162d741c8dc0d4bae01a22a26"),
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-apple-darwin14-gcc4.tar.gz", "5a9aeb6e27ff9677464bcf3ecc0735a67d5473937b8555b6dc6b9064ed921b82"),
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-apple-darwin14-gcc7.tar.gz", "262e7a7f16d08edf17d838a232016be29c6b5fc8484aa12790da2c44bed3917e"),
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-apple-darwin14-gcc8.tar.gz", "1ba927665b089b0e6738d5cc62eb8fa916e0d5387e38964b388205d44f10005b"),
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-linux-gnu-gcc4.tar.gz", "b7e1b16b7a478762cf24f3112f6d064d497b845bac63896fdda19085d2109985"),
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-linux-gnu-gcc7.tar.gz", "b955aadca6134586babe120c499aee6583715d4964075bf73bbc42216e5ba911"),
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-linux-gnu-gcc8.tar.gz", "9b9ae725558a642b6a03a327236d91b1fc8c2c99c3afed932a3921d27ef1cbf6"),
Windows(:x86_64, compiler_abi=CompilerABI(:gcc6)) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-w64-mingw32-gcc6.tar.gz", "03252a30570e9740dcc5f1413dd3481a68e8c12c7373fc1ac2a58cec73f3ff6f"),
Windows(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-w64-mingw32-gcc7.tar.gz", "76078cbbf17456ea3b27145a3539a1f16c26ac261a13485068c8718d55aba6a3"),
Windows(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/ClpBuilder.v1.16.11.x86_64-w64-mingw32-gcc8.tar.gz", "705cd3fc170d1607899e9bcfe981c84ef5244a94187abbc479251c7f37b316e1"),
)

# Install unsatisfied or updated dependencies:
unsatisfied = any(!satisfied(p; verbose=verbose) for p in products)
if haskey(download_info, platform_key())
url, tarball_hash = download_info[platform_key()]
# Check if this build.jl is providing new versions of the binaries, and
# if so, ovewrite the current binaries even if they were installed by the user
if unsatisfied || !isinstalled(url, tarball_hash; prefix=prefix)
# Download and install binaries
for dependency in reverse(dependencies) # We do not check for already installed dependencies
download(dependency,basename(dependency))
evalfile(basename(dependency))
end
install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose)
# To fix gcc4 bug in Windows
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should also be a link to the issue here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

# 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/JuliaOpt/OsiBuilder/releases/download/v0.107.9-1/build_OsiBuilder.v0.107.9.jl",
# "https://github.com/JuliaOpt/CoinUtilsBuilder/releases/download/v2.10.14-1/build_CoinUtilsBuilder.v2.10.14.jl",
# "https://github.com/JuliaOpt/COINMumpsBuilder/releases/download/v1.6.0-1/build_COINMumpsBuilder.v1.6.0.jl",
# "https://github.com/JuliaOpt/COINMetisBuilder/releases/download/v1.3.5-1/build_COINMetisBuilder.v1.3.5.jl",
# "https://github.com/JuliaOpt/COINLapackBuilder/releases/download/v1.5.6-1/build_COINLapackBuilder.v1.5.6.jl",
# "https://github.com/JuliaOpt/COINBLASBuilder/releases/download/v1.4.6-1/build_COINBLASBuilder.v1.4.6.jl",
# "https://github.com/JuliaOpt/ASLBuilder/releases/download/v3.1.0-1/build_ASLBuilder.v3.1.0.jl"
]

custom_library = false
if haskey(ENV,"JULIA_CLP_LIBRARY_PATH")
custom_products = [LibraryProduct(ENV["JULIA_CLP_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_CLP_LIBRARY_PATH"]).\nTo fall back to BinaryProvider call delete!(ENV,\"JULIA_CLP_LIBRARY_PATH\") and run build again.")
end
elseif unsatisfied
# If we don't have a BinaryProvider-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 $(triplet(platform_key())) is not supported by this package!")
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)
write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose)# using BinaryProvider # requires BinaryProvider 0.3.0 or later
3 changes: 3 additions & 0 deletions src/Clp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ VERSION < v"0.7.0-beta2.199" && __precompile__()
module Clp

using Compat
# This 'using' is required to suppress a warning about Clp not having Libdl in its
# dependencies (Libdl is used by BinaryProvider), e.g.: bicycle1885/CodecZlib.jl#26.
using Libdl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu suppress a warning about Clp not having Libdl in its dependencies (Libdl is used by BinaryProvider), e.g. : JuliaIO/CodecZlib.jl#26


include("ClpCInterface.jl")
include("ClpSolverInterface.jl")
Expand Down