-
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.
New build.jl using BinaryBuilder (#98)
* New build.jl using BinaryBuilder * update build.jl * update build.jl to v3.12.8-9 * amplexe now defined in deps.jl * linux binaries require 0.6.2 * BinDeps no longer needed * test binary on travis * fix library paths for the ipopt binary * remove stale comment * try DYLD_LIBRARY_PATH * document custom installation
- Loading branch information
Showing
6 changed files
with
110 additions
and
108 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
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,5 +1,4 @@ | ||
julia 0.6 | ||
BinDeps | ||
julia 0.6.2 | ||
MathProgBase 0.5 0.8 | ||
@osx Homebrew | ||
@windows WinRPM | ||
BinaryProvider | ||
Compat |
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,93 +1,40 @@ | ||
using BinDeps | ||
using Compat | ||
|
||
@BinDeps.setup | ||
|
||
windllname = "libipopt-1" | ||
libipopt = library_dependency("libipopt", aliases=[windllname]) | ||
|
||
ipoptname = "Ipopt-3.12.8" | ||
|
||
provides(Sources, URI("http://www.coin-or.org/download/source/Ipopt/$ipoptname.tgz"), | ||
libipopt, os = :Unix) | ||
|
||
prefix=joinpath(BinDeps.depsdir(libipopt),"usr") | ||
patchdir=BinDeps.depsdir(libipopt) | ||
srcdir = joinpath(BinDeps.depsdir(libipopt),"src",ipoptname) | ||
|
||
# fpu_control flag for building on ARM | ||
if Sys.ARCH == :arm | ||
fpu_control = "ADD_CFLAGS=-DNO_fpu_control" | ||
else | ||
fpu_control = "" | ||
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) | ||
|
||
# OS X | ||
if is_apple() | ||
using Homebrew | ||
provides(Homebrew.HB, "staticfloat/juliadeps/ipopt", libipopt, os = :Darwin) | ||
end | ||
|
||
# Windows | ||
if is_windows() | ||
using WinRPM | ||
provides(WinRPM.RPM, "Ipopt", [libipopt], os = :Windows) | ||
end | ||
|
||
# Avoid Issue #62, building into /lib64 on OpenSUSE | ||
configsite = nothing | ||
if haskey(ENV, "CONFIG_SITE") | ||
configsite = pop!(ENV, "CONFIG_SITE") | ||
end | ||
|
||
@BinDeps.install Dict(:libipopt => :libipopt) | ||
|
||
if configsite !== nothing | ||
ENV["CONFIG_SITE"] = configsite | ||
using 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/staticfloat/IpoptBuilder/releases/download/v3.12.8-9" | ||
|
||
# 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) | ||
|
||
# Write out a deps.jl file that will contain mappings for our products | ||
write_deps_file(joinpath(@__DIR__, "deps.jl"), products) | ||
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 |
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