Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update build.jl * Update REQUIRE * Update build.jl * Update build.jl * Update build.jl * Update build.jl * Update build.jl * Update build.jl * Update build.jl * Update build.jl * Update build.jl * Update REQUIRE * Update SCS.jl * Update SCS.jl * Update REQUIRE * Update SCS.jl * Update SCS.jl * Update build.jl * Update .gitignore * Update README.md * Update SCS.jl * Update REQUIRE * Update SCS.jl * Update SCS.jl * Update REQUIRE * Update SCS.jl * Update REQUIRE * Update SCS.jl * Update build.jl * Update .travis.yml * Update build.jl * Update build.jl * Update .travis.yml * Update build.jl * Update .travis.yml * Update .travis.yml * Update build.jl * Update .travis.yml * Update appveyor.yml * Update build.jl * Update README.md * Update README.md * Update README.md * Update build.jl * Update build.jl * Update build.jl * Update build.jl
- Loading branch information
1 parent
8cf4a24
commit d80fa11
Showing
7 changed files
with
82 additions
and
106 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,6 +1,5 @@ | ||
julia 0.6 | ||
julia 0.6.2 | ||
MathProgBase 0.5 0.8 | ||
MathOptInterface 0.6 0.7 | ||
BinDeps | ||
@osx Homebrew | ||
Compat 0.47 # SparseArrays | ||
BinaryProvider 0.3 | ||
Compat 0.47 |
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,2 @@ | ||
deps.jl | ||
downloads/ | ||
src/ | ||
usr/ | ||
bin32/ | ||
bin64/ | ||
usr |
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,83 +1,55 @@ | ||
using BinDeps | ||
|
||
@BinDeps.setup | ||
|
||
using Compat.Libdl | ||
using Compat.LinearAlgebra.BLAS | ||
using Compat.Sys: isapple | ||
|
||
blasvendor = BLAS.vendor() | ||
|
||
direct = library_dependency("libscsdir", aliases=["libscsdir64"]) | ||
indirect = library_dependency("libscsindir", aliases=["libscsindir64"]) | ||
|
||
# TODO: Provide both libs in the "scs" Homebrew package. | ||
# if Sys.isapple() | ||
# using Homebrew | ||
# provides(Homebrew.HB, "scs", [direct, indirect], os = :Darwin) | ||
# end | ||
|
||
version = "2.0.2" | ||
win_version = "2.0.2" # The windows binaries are not consistent with this version yet. | ||
|
||
provides(Sources, URI("https://github.com/cvxgrp/scs/archive/v$version.tar.gz"), | ||
[direct, indirect], os=:Unix, unpacked_dir="scs-$version") | ||
|
||
# Windows binaries built in Cygwin as follows: | ||
# CFLAGS="-DDLONG -DCOPYAMATRIX -DUSE_LAPACK -DCTRLC=1 -DBLAS64 -DBLASSUFFIX=_64_" LDFLAGS="-L$HOME/julia/usr/bin -lopenblas64_" make CC=x86_64-w64-mingw32-gcc out/libscsdir.dll | ||
# mv out bin64 | ||
# make clean | ||
# CFLAGS="-DDLONG -DCOPYAMATRIX -DUSE_LAPACK -DCTRLC=1" LDFLAGS="-L$HOME/julia32/usr/bin -lopenblas" make CC=i686-w64-mingw32-gcc out/libscsdir.dll | ||
# mv out bin32 | ||
|
||
# TODO: Provide binaries for windows | ||
# provides(Binaries, URI("https://cache.julialang.org/https://bintray.com/artifact/download/tkelman/generic/scs-$win_version-r2.7z"), | ||
# [direct, indirect], unpacked_dir="bin$(Sys.WORD_SIZE)", os = :Windows, | ||
# SHA="62bb4feeb7d2cd3db595f05b86a20fc93cfdef23311e2e898e18168189072d02") | ||
|
||
prefix = joinpath(BinDeps.depsdir(direct), "usr") | ||
srcdir = joinpath(BinDeps.depsdir(direct), "src", "scs-$version/") | ||
|
||
ldflags = "" | ||
if isapple() | ||
ldflags = "$ldflags -undefined suppress -flat_namespace" | ||
end | ||
cflags = "-DCOPYAMATRIX -DDLONG -DUSE_LAPACK -DCTRLC=1" | ||
if blasvendor == :openblas64 | ||
cflags = "$cflags -DBLAS64 -DBLASSUFFIX=_64_" | ||
end | ||
if blasvendor == :mkl | ||
if Base.USE_BLAS64 | ||
cflags = "$cflags -DMKL_ILP64 -DBLAS64" | ||
ldflags = "$ldflags -lmkl_intel_ilp64" | ||
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, ["libscsindir"], :indirect), | ||
LibraryProduct(prefix, ["libscsdir"], :direct), | ||
] | ||
|
||
# Download binaries from hosted location | ||
bin_prefix = "https://github.com/JuliaOpt/SCSBuilder/releases/download/v2.0.2-NOGOMP" | ||
|
||
# Listing of files generated by BinaryBuilder: | ||
download_info = Dict( | ||
Linux(:aarch64, :glibc) => ("$bin_prefix/SCSBuilder.v2.0.2.aarch64-linux-gnu.tar.gz", "9ac63df8629d95588d84f0c8219d7c15cb229eab8fb78d528a4e75fbd2f5c136"), | ||
Linux(:armv7l, :glibc, :eabihf) => ("$bin_prefix/SCSBuilder.v2.0.2.arm-linux-gnueabihf.tar.gz", "1c1241faa174ff47c2c290793b6fec1a9f0db290fda57c7826f9b8942b41943b"), | ||
Linux(:i686, :glibc) => ("$bin_prefix/SCSBuilder.v2.0.2.i686-linux-gnu.tar.gz", "7731d8a2e644bf1e070e013eb100d66e49f17796b8903c3350a806946f7ba752"), | ||
Windows(:i686) => ("$bin_prefix/SCSBuilder.v2.0.2.i686-w64-mingw32.tar.gz", "354cce228b102e9a09a727d44c1f437ad49e97077ba4abff96b22d6d129c751f"), | ||
Linux(:powerpc64le, :glibc) => ("$bin_prefix/SCSBuilder.v2.0.2.powerpc64le-linux-gnu.tar.gz", "7a2847ad3f8621a6927e4281d8ee7f2704a3339cfed41eb1b227a997a59cadf5"), | ||
MacOS(:x86_64) => ("$bin_prefix/SCSBuilder.v2.0.2.x86_64-apple-darwin14.tar.gz", "dc7f0d7bb3f2ee0072cb81653729ac2f5123abfa0735898cd44bc39a2952d248"), | ||
Linux(:x86_64, :glibc) => ("$bin_prefix/SCSBuilder.v2.0.2.x86_64-linux-gnu.tar.gz", "d5503f18e7d504e4a496ae4ea79ef326fab78983cf42ebd2a691e0a682790d96"), | ||
FreeBSD(:x86_64) => ("$bin_prefix/SCSBuilder.v2.0.2.x86_64-unknown-freebsd11.1.tar.gz", "3ef5005d53ca7dee21842856ca5628e0efc244083e125e939304a14092d54858"), | ||
Windows(:x86_64) => ("$bin_prefix/SCSBuilder.v2.0.2.x86_64-w64-mingw32.tar.gz", "289504d5df960c3434e5877f16cc42949e32280eb0ec684020bf6f9336c9316f"), | ||
) | ||
|
||
custom_library = false | ||
if haskey(ENV,"JULIA_SCS_LIBRARY_PATH") | ||
custom_products = [LibraryProduct(ENV["JULIA_SCS_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 | ||
ldflags = "$ldflags -lmkl_intel" | ||
error("Could not install custom libraries from $(ENV["JULIA_SCS_LIBRARY_PATH"]).\nTo fall back to BinaryProvider call delete!(ENV,\"JULIA_SCS_LIBRARY_PATH\") and run build again.") | ||
end | ||
cflags = "$cflags -fopenmp" | ||
ldflags = "$ldflags -lmkl_gnu_thread -lmkl_rt -lmkl_core -lgomp" | ||
end | ||
|
||
ENV2 = copy(ENV) | ||
ENV2["LDFLAGS"] = ldflags | ||
ENV2["CFLAGS"] = cflags | ||
|
||
provides(SimpleBuild, | ||
(@build_steps begin | ||
GetSources(direct) | ||
CreateDirectory(joinpath(prefix, "lib")) | ||
|
||
FileRule(joinpath(prefix, "lib", "libscsdir.$(Libdl.dlext)"), @build_steps begin | ||
ChangeDirectory(srcdir) | ||
setenv(`make BLASLDFLAGS= out/libscsdir.$(Libdl.dlext)`, ENV2) | ||
`mv out/libscsdir.$(Libdl.dlext) $prefix/lib` | ||
end) | ||
|
||
FileRule(joinpath(prefix, "lib", "libscsindir.$(Libdl.dlext)"), @build_steps begin | ||
ChangeDirectory(srcdir) | ||
setenv(`make BLASLDFLAGS= out/libscsindir.$(Libdl.dlext)`, ENV2) | ||
`mv out/libscsindir.$(Libdl.dlext) $prefix/lib` | ||
end) | ||
|
||
end), [direct, indirect], os=:Unix) | ||
# Install unsatisfied or updated dependencies: | ||
unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) | ||
if !custom_library && haskey(download_info, platform_key()) | ||
url, tarball_hash = download_info[platform_key()] | ||
if unsatisfied || !isinstalled(url, tarball_hash; prefix=prefix) | ||
# Download and install binaries | ||
install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose) | ||
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 | ||
|
||
@BinDeps.install Dict(:libscsdir => :direct, :libscsindir => :indirect) | ||
# 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