-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
122 additions
and
182 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 |
---|---|---|
|
@@ -3,7 +3,6 @@ os: | |
- linux | ||
- osx | ||
julia: | ||
- 0.6 | ||
- 0.7 | ||
- 1.0 | ||
notifications: | ||
|
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
julia 0.6 | ||
julia 0.7 | ||
MathProgBase 0.5 0.8 | ||
MathOptInterface 0.8 0.9 | ||
BinaryProvider 0.2 | ||
BinDeps | ||
BinaryProvider 0.5.3 | ||
Compat 0.67.1 |
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,6 +1,5 @@ | ||
environment: | ||
matrix: | ||
- julia_version: 0.6 | ||
- julia_version: 0.7 | ||
- julia_version: 1.0 | ||
|
||
|
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,4 +1,2 @@ | ||
downloads | ||
src | ||
usr | ||
deps.jl |
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,134 +1,87 @@ | ||
using BinaryProvider | ||
using BinDeps | ||
using Compat | ||
using BinaryProvider # requires BinaryProvider 0.3.0 or later | ||
|
||
# BinaryBuilder artifacts for linux currently assume libgfortran.so.4 | ||
# is present, so they will not work for any source builds of Julia itself | ||
# when a GCC version older than 7 was used. BinaryBuilder also does not | ||
# support FreeBSD or non-glibc Linux distributions. Continue building from | ||
# source on non-apple unices while these limitations apply. | ||
use_BinaryProvider = Compat.Sys.isapple() || Compat.Sys.iswindows() | ||
# 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, ["libipopt"], :libipopt), | ||
ExecutableProduct(prefix, "ipopt", :amplexe), | ||
] | ||
|
||
@BinDeps.setup | ||
if use_BinaryProvider | ||
# 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 = Product[ | ||
LibraryProduct(prefix, String["libipopt"], :libipopt), | ||
ExecutableProduct(prefix, "ipopt", :amplexe), | ||
] | ||
# Download binaries from hosted location | ||
bin_prefix = "https://github.com/JuliaOpt/IpoptBuilder/releases/download/v3.12.10-1-static" | ||
|
||
# Download binaries from hosted location | ||
bin_prefix = "https://github.com/staticfloat/IpoptBuilder/releases/download/v3.12.8-9" | ||
# Listing of files generated by BinaryBuilder: | ||
download_info = Dict( | ||
Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/IpoptBuilder.v3.12.10.aarch64-linux-gnu-gcc4.tar.gz", "c538279784713baa9d4eec505ffd674f5dfb8b2b408e9efea7c712280ffdb9a7"), | ||
Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/IpoptBuilder.v3.12.10.aarch64-linux-gnu-gcc7.tar.gz", "75a417624b8fcff81739aedd272453e927737d80fae2d66a9ef15280610f9e1d"), | ||
Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/IpoptBuilder.v3.12.10.aarch64-linux-gnu-gcc8.tar.gz", "aa4ec6482bb8af253f9fb7fcae48b7925cd6f7c0b98314188ab376fb7b4dbcca"), | ||
Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/IpoptBuilder.v3.12.10.arm-linux-gnueabihf-gcc4.tar.gz", "d5ab53ef92e153b08f1ac889a5e9cb1966411dea320523c99d81c86b1e204bd3"), | ||
Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/IpoptBuilder.v3.12.10.arm-linux-gnueabihf-gcc7.tar.gz", "b7bf5ef24e300d73063b8c6730a861656d01b32e83c88e59ed1d2802ab6a4d58"), | ||
Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/IpoptBuilder.v3.12.10.arm-linux-gnueabihf-gcc8.tar.gz", "9ebc760de273a090f6a51b6ac3efc395f43a1d0b8d3a78840dfdcfb2b3a557a4"), | ||
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/IpoptBuilder.v3.12.10.i686-linux-gnu-gcc4.tar.gz", "049d166eb2774b40531f8bfd77cb26c1ebb4f1b155e6f8dfa16ff1f9c95a64cd"), | ||
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/IpoptBuilder.v3.12.10.i686-linux-gnu-gcc7.tar.gz", "b3ff1e0fd2508f0a540d8b695408d0363142011beaaa556d58b8fa5cd8fe60dd"), | ||
Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/IpoptBuilder.v3.12.10.i686-linux-gnu-gcc8.tar.gz", "898844802ea87b44aec2fdda160b9a74bca25079410396dd357f88068b86a0cd"), | ||
Windows(:i686, compiler_abi=CompilerABI(:gcc6)) => ("$bin_prefix/IpoptBuilder.v3.12.10.i686-w64-mingw32-gcc6.tar.gz", "05bbb0de01291f2e020640d794a9757f44ece04392148c90e445431eb5b31b12"), | ||
Windows(:i686, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/IpoptBuilder.v3.12.10.i686-w64-mingw32-gcc7.tar.gz", "aa92b5ecb2e319182b136f84c1e54a5c4677375fc5cbb10cf9d0d190e1480ddc"), | ||
Windows(:i686, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/IpoptBuilder.v3.12.10.i686-w64-mingw32-gcc8.tar.gz", "1701343eca9d3c38d46a9801c1f4eea633dceaee2a67b3fdf96c11b82ed09ce6"), | ||
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/IpoptBuilder.v3.12.10.x86_64-apple-darwin14-gcc4.tar.gz", "a15de7b556959ccf184c08fe024cc970b0ed081381eaa266d0e7b4e315c8ca0d"), | ||
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/IpoptBuilder.v3.12.10.x86_64-apple-darwin14-gcc7.tar.gz", "c73f82f56ed0127881b765fabb03df80133ba90e32bd55c1bc6530fcfe3d91ff"), | ||
MacOS(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/IpoptBuilder.v3.12.10.x86_64-apple-darwin14-gcc8.tar.gz", "e81aa4a07af52ac1c04f9299796bf4db7e38fc8dcd6c2526bf3141b9893104c6"), | ||
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/IpoptBuilder.v3.12.10.x86_64-linux-gnu-gcc4.tar.gz", "79d3ac61c596a7f28384aeced5199196ea4ae356f7b732718d226832654ec961"), | ||
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/IpoptBuilder.v3.12.10.x86_64-linux-gnu-gcc7.tar.gz", "92eab7ccd250979234447ebe164120f6d63614b0945c011fa4d280df8579828f"), | ||
Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/IpoptBuilder.v3.12.10.x86_64-linux-gnu-gcc8.tar.gz", "f0eca1fc19fd7703f804b10ab4bc593739f23f472a717df00768534dda408292"), | ||
Windows(:x86_64, compiler_abi=CompilerABI(:gcc6)) => ("$bin_prefix/IpoptBuilder.v3.12.10.x86_64-w64-mingw32-gcc6.tar.gz", "29c34972e2f7fb022054579ce5aaa22aff4e7323158b3be0b6554c1019fd8310"), | ||
Windows(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/IpoptBuilder.v3.12.10.x86_64-w64-mingw32-gcc7.tar.gz", "f7bdbd43f0f356a65038e2c2cfea5151590080dbf125eb09802d3df5c274a114"), | ||
Windows(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/IpoptBuilder.v3.12.10.x86_64-w64-mingw32-gcc8.tar.gz", "3d19545a532ce102a94901dd7cca37043ec11593c4052d0ede6b25fe9ecc25ea"), | ||
) | ||
|
||
# Listing of files generated by BinaryBuilder: | ||
download_info = Dict( | ||
BinaryProvider.Linux(:aarch64, :glibc) => ("$bin_prefix/Ipopt.aarch64-linux-gnu.tar.gz", "ea4b4ed7612d3603307f9a9aaa298c558abcc1c07378bacc5eb0520477f23adf"), | ||
BinaryProvider.Linux(:armv7l, :glibc) => ("$bin_prefix/Ipopt.arm-linux-gnueabihf.tar.gz", "23410ee354456e86294123cd641a01e6062bbc2fe9244f099bd3f06647ce3f3c"), | ||
BinaryProvider.Linux(:i686, :glibc) => ("$bin_prefix/Ipopt.i686-linux-gnu.tar.gz", "7ddb2d3791fe7b8252c074f9bb77cd4094d2a38c9fdcc139ab392a200e17b22b"), | ||
BinaryProvider.Windows(:i686) => ("$bin_prefix/Ipopt.i686-w64-mingw32.tar.gz", "91c2c70b1a4de58e0b3f512b28bcc88594489d64e721557385744e8994189f2e"), | ||
BinaryProvider.MacOS() => ("$bin_prefix/Ipopt.x86_64-apple-darwin14.tar.gz", "8e979f6ac782af6836425bc60f594054cc7644dfc59fb9b0a19fb7a1e3b2ae24"), | ||
BinaryProvider.Linux(:x86_64, :glibc) => ("$bin_prefix/Ipopt.x86_64-linux-gnu.tar.gz", "d3d8f69278905ea8cab23193cf03b49ac30837bcbfab67de377e4c58ec48de46"), | ||
BinaryProvider.Windows(:x86_64) => ("$bin_prefix/Ipopt.x86_64-w64-mingw32.tar.gz", "d967b152449659591095458594948f74981fc0b772cbf3f333a9a24676beab80"), | ||
) | ||
|
||
# First, check to see if we're all satisfied | ||
if any(!satisfied(p; verbose=verbose) for p in products) | ||
if haskey(download_info, platform_key()) | ||
# Download and install binaries | ||
url, tarball_hash = download_info[platform_key()] | ||
install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose) | ||
else | ||
# 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 more even more ambitious here. | ||
error("Your platform $(Sys.MACHINE) is not supported by this package!") | ||
end | ||
end | ||
|
||
# Write out a deps.jl file that will contain mappings for our products | ||
write_deps_file(joinpath(@__DIR__, "deps.jl"), products) | ||
else # !use_BinaryProvider | ||
windllname = "libipopt-1" | ||
libipopt = library_dependency("libipopt", aliases=[windllname]) | ||
|
||
ipoptname = "Ipopt-3.12.8" | ||
# 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 | ||
|
||
provides(Sources, URI("http://www.coin-or.org/download/source/Ipopt/$ipoptname.tgz"), | ||
libipopt, os = :Unix) | ||
function update_product(product::LibraryProduct, library_path, binary_path) | ||
LibraryProduct(library_path, product.libnames, product.variable_name) | ||
end | ||
|
||
prefix=joinpath(BinDeps.depsdir(libipopt),"usr") | ||
patchdir=BinDeps.depsdir(libipopt) | ||
srcdir = joinpath(BinDeps.depsdir(libipopt),"src",ipoptname) | ||
function update_product(product::ExecutableProduct, library_path, binary_path) | ||
ExecutableProduct(joinpath(binary_path, basename(product.path)), product.variable_name) | ||
end | ||
|
||
# fpu_control flag for building on ARM | ||
if Sys.ARCH == :arm | ||
fpu_control = "ADD_CFLAGS=-DNO_fpu_control" | ||
custom_library = false | ||
if haskey(ENV,"JULIA_IPOPT_LIBRARY_PATH") && haskey(ENV,"JULIA_IPOPT_EXECUTABLE_PATH") | ||
custom_products = [update_product(product, ENV["JULIA_IPOPT_LIBRARY_PATH"], ENV["JULIA_IPOPT_EXECUTABLE_PATH"]) for product in products] | ||
if all(satisfied(p; verbose=verbose) for p in custom_products) | ||
products = custom_products | ||
custom_library = true | ||
else | ||
fpu_control = "" | ||
error("Could not install custom libraries from $(ENV["JULIA_IPOPT_LIBRARY_PATH"]) and $(ENV["JULIA_IPOPT_EXECUTABLE_PATH"]).\nTo fall back to BinaryProvider call delete!(ENV,\"JULIA_IPOPT_LIBRARY_PATH\");delete!(ENV,\"JULIA_IPOPT_EXECUTABLE_PATH\") and run build again.") | ||
end | ||
end | ||
|
||
provides(SimpleBuild, | ||
(@build_steps begin | ||
GetSources(libipopt) | ||
@build_steps begin | ||
ChangeDirectory(srcdir) | ||
@build_steps begin | ||
ChangeDirectory(joinpath(srcdir,"ThirdParty","Blas")) | ||
CreateDirectory("build", true) | ||
`sed -i.backup 's/wget"/wget --no-check-certificate"/g' get.Blas` | ||
`./get.Blas` | ||
end | ||
@build_steps begin | ||
ChangeDirectory(joinpath(srcdir,"ThirdParty","Blas","build")) | ||
`../configure --prefix=$prefix --disable-shared --with-pic` | ||
`make install` | ||
end | ||
@build_steps begin | ||
ChangeDirectory(joinpath(srcdir,"ThirdParty","Lapack")) | ||
CreateDirectory("build", true) | ||
`sed -i.backup 's/wget"/wget --no-check-certificate"/g' get.Lapack` | ||
`./get.Lapack` | ||
end | ||
@build_steps begin | ||
ChangeDirectory(joinpath(srcdir,"ThirdParty","Lapack","build")) | ||
`../configure --prefix=$prefix --disable-shared --with-pic | ||
--with-blas="$prefix/lib/libcoinblas.a -lgfortran"` | ||
`make install` | ||
end | ||
@build_steps begin | ||
ChangeDirectory(joinpath(srcdir,"ThirdParty","ASL")) | ||
`./get.ASL` | ||
end | ||
@build_steps begin | ||
ChangeDirectory(joinpath(srcdir,"ThirdParty","Mumps")) | ||
`./get.Mumps` | ||
end | ||
`./configure --prefix=$prefix coin_skip_warn_cxxflags=yes | ||
--with-blas="$prefix/lib/libcoinblas.a -lgfortran" | ||
--with-lapack=$prefix/lib/libcoinlapack.a | ||
$fpu_control` | ||
`make` | ||
`make test` | ||
`make -j1 install` | ||
end | ||
end),libipopt, os = :Unix) | ||
if !custom_library | ||
|
||
# Avoid Issue #62, building into /lib64 on OpenSUSE | ||
configsite = nothing | ||
if haskey(ENV, "CONFIG_SITE") | ||
configsite = pop!(ENV, "CONFIG_SITE") | ||
end | ||
# Install unsatisfied or updated dependencies: | ||
unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) | ||
|
||
@BinDeps.install Dict(:libipopt => :libipopt) | ||
dl_info = choose_download(download_info, platform_key_abi()) | ||
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 configsite !== nothing | ||
ENV["CONFIG_SITE"] = configsite | ||
# 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 | ||
install(dl_info...; prefix=prefix, force=true, verbose=verbose) | ||
end | ||
end | ||
|
||
# Save value of use_BinaryProvider into deps.jl as well | ||
open(joinpath(@__DIR__, "deps.jl"), "a") do f | ||
println(f, "use_BinaryProvider = $use_BinaryProvider") | ||
end | ||
# Write out a deps.jl file that will contain mappings for our products | ||
write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) |
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
Oops, something went wrong.