-
Notifications
You must be signed in to change notification settings - Fork 9
Use CSDP_jll #56
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
Merged
Use CSDP_jll #56
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
018f087
Use CSDP_jll
blegat 0e70e61
Rename csdp -> libcsdp
blegat 7140681
Use JLL binary on Julia < 1.3
blegat 6f63905
Add OpenBLAS32
blegat c216171
Updating build.jl similarly to FFMPEG and Cairo
blegat e81dd66
CompilerABI -> _CompilerABI
blegat 3537a62
Use MySQL as example instead
blegat 83b26b5
1 -> 1.0 in appveyor
blegat 45ba1ec
Add `ignore_platform` for OpenBLAS32
blegat cca42dd
Add `ignore_platform` for CSDP
blegat 76293d5
Update deps/build_CSDP.v6.2.0.jl
blegat 9febccb
Update deps/build_OpenBLAS32.v0.3.9.jl
blegat 4cdb52d
Update deps/build_OpenBLAS32.v0.3.9.jl
blegat 7a6bb7e
Update deps/build_CSDP.v6.2.0.jl
blegat 9236f13
Remove JULIA_LAPACK env var on Travis
blegat 1e18ea0
Use the unreleased BP v0.5.9 on travis
blegat 0d79054
Add comments on why is used
blegat 7906dca
Add verbose=true to debug Mac OS
blegat 331f993
Add CompilerSupportLibraries
blegat daf35a7
Use BinaryProvider v0.5.9
blegat 65e19bb
Disable example test on Windows
blegat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,89 +1,25 @@ | ||
using BinDeps | ||
using LinearAlgebra, Libdl | ||
# Inspired from https://github.com/JuliaDatabases/MySQL.jl/blob/36eaf2bfbbdd9a27c408d0b2a734fff0d81b63ad/deps/build.jl | ||
module Anon1 end | ||
module Anon2 end | ||
module Anon3 end | ||
|
||
BinDeps.@setup | ||
@static if VERSION < v"1.3.0" | ||
|
||
blas = library_dependency("libblas", alias=["libblas.dll"]) | ||
lapack = library_dependency("liblapack", alias=["liblapack.dll"]) | ||
using BinaryProvider # requires BinaryProvider 0.3.0 or later | ||
|
||
const ENV_VAR = "CSDP_USE_JULIA_LAPACK" | ||
const JULIA_LAPACK = if haskey(ENV, ENV_VAR) | ||
value = ENV[ENV_VAR] | ||
if lowercase(value) in ["1", "true", "yes"] | ||
@info "Using the blas and lapack libraries shipped with Julia as the environment variable `$ENV_VAR` is set to `$value`." | ||
true | ||
elseif lowercase(value) in ["0", "false", "no"] | ||
@info "Using system blas and lapack libraries as the environment variable `$ENV_VAR` is set to `$value`." | ||
false | ||
else | ||
error("The environment variable `$ENV_VAR` is set to `$value`. Set it to `true` or `false` instead.") | ||
end | ||
else | ||
if BinDeps.issatisfied(blas) && BinDeps.issatisfied(lapack) | ||
@info "Using system blas and lapack libraries. Set the environment variable `$ENV_VAR` to `true` to use the blas/lapack library shipped with Julia." | ||
false | ||
else | ||
@info "Using the blas and lapack libraries shipped with Julia as there is no system blas and lapack libraries installed." | ||
true | ||
end | ||
end | ||
# 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"))) | ||
|
||
include("constants.jl") | ||
include("compile.jl") | ||
products = [ | ||
LibraryProduct(prefix, ["libcsdp"], :libcsdp) | ||
] | ||
|
||
# @info "libname = $libname" | ||
const depends = if JULIA_LAPACK | ||
# Create a new `bindeps_context` global variable that does not | ||
# have `blas` and `lapack` in the list of dependencies. | ||
BinDeps.@setup | ||
[] | ||
else | ||
[blas, lapack] | ||
end | ||
depends = JULIA_LAPACK ? [] : [blas, lapack] | ||
Anon1.include("build_CompilerSupportLibraries.v0.3.3.jl") | ||
Anon2.include("build_OpenBLAS32.v0.3.9.jl") | ||
Anon3.include("build_CSDP.v6.2.0.jl") | ||
|
||
# LaPack/BLAS dependencies | ||
if !JULIA_LAPACK | ||
@static if Sys.iswindows() | ||
# wheel = "numpy/windows-wheel-builder/raw/master/atlas-builds" | ||
# atlas = "https://github.com/$wheel" | ||
# atlasdll = "/atlas-3.11.38-sse2-64/lib/numpy-atlas.dll" | ||
# download("https://raw.githubusercontent.com/$wheel/$atlasdll"), | ||
# "$libdir/libatlas.dll") | ||
## at the end ... | ||
# push!(BinDeps.defaults, BuildProcess) | ||
end | ||
end | ||
# Finally, write out a deps.jl file | ||
write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=true) | ||
|
||
csdp = library_dependency("csdp", aliases=[libname], depends=depends) | ||
|
||
provides(Sources, URI(download_url), csdp, unpacked_dir=csdpversion) | ||
|
||
provides(BuildProcess, | ||
(@build_steps begin | ||
GetSources(csdp) | ||
CreateDirectory(libdir) | ||
CreateDirectory(builddir) | ||
@build_steps begin | ||
ChangeDirectory(srcdir) | ||
patch_int | ||
compile_objs | ||
end | ||
end), | ||
[csdp]) | ||
|
||
# Prebuilt DLLs for Windows | ||
provides(Binaries, | ||
URI("https://github.com/EQt/winlapack/blob/49454aee32649dc52c5b64f408a17b5270bd30f4/win-csdp-$(Sys.WORD_SIZE).7z?raw=true"), | ||
[csdp, lapack, blas], unpacked_dir="usr", os = :Windows) | ||
|
||
@BinDeps.install Dict(:csdp => :csdp) | ||
|
||
open(joinpath(dirname(@__FILE__), "deps.jl"), write = true, append = true) do io | ||
print(io, "const CSDP_INT = ") | ||
if JULIA_LAPACK | ||
println(io, "Clong") | ||
else | ||
println(io, "Cint") | ||
end | ||
end | ||
end # VERSION |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Generated by running | ||
# julia --color=yes generate_buildjl.jl C/Coin-OR/CSDP/build_tarballs.jl JuliaBinaryWrappers/CSDP_jll.jl CSDP-v6.2.0+4 | ||
# in the root the the source tree of https://github.com/JuliaPackaging/Yggdrasil/ | ||
# by first replacing the `include` by its content, see https://github.com/JuliaPackaging/Yggdrasil/issues/858 | ||
# We also added `prefix, ` after `LibraryProduct(`. | ||
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, ["libcsdp"], :libcsdp) | ||
] | ||
|
||
# Download binaries from hosted location | ||
bin_prefix = "https://github.com/JuliaBinaryWrappers/CSDP_jll.jl/releases/download/CSDP-v6.2.0+4" | ||
|
||
# Listing of files generated by BinaryBuilder: | ||
download_info = Dict( | ||
Linux(:aarch64, libc=:glibc) => ("$bin_prefix/CSDP.v6.2.0.aarch64-linux-gnu.tar.gz", "446a2d5c60a9270a345d2aab12093c76accab967c175ff96de7f684e48c2f482"), | ||
Linux(:aarch64, libc=:musl) => ("$bin_prefix/CSDP.v6.2.0.aarch64-linux-musl.tar.gz", "1e0c1e5c89e6b70538ff9b4e705bda3d267721ae4d58ee600152bc5f6101bf46"), | ||
Linux(:armv7l, libc=:glibc, call_abi=:eabihf) => ("$bin_prefix/CSDP.v6.2.0.armv7l-linux-gnueabihf.tar.gz", "88532fc19eb7a33b72bad0b7e01d61b1bd29b6069b4a883d468d6e12f00cf711"), | ||
Linux(:armv7l, libc=:musl, call_abi=:eabihf) => ("$bin_prefix/CSDP.v6.2.0.armv7l-linux-musleabihf.tar.gz", "f1dd8bba6a91b4c94394ad421487b99249c8abd592dfbb2256d0dee704ea2a82"), | ||
Linux(:i686, libc=:glibc) => ("$bin_prefix/CSDP.v6.2.0.i686-linux-gnu.tar.gz", "80e2a2b2263ca378efb23cd565814bd66f5e120cdb955e9bdf548ab32b43b75d"), | ||
Linux(:i686, libc=:musl) => ("$bin_prefix/CSDP.v6.2.0.i686-linux-musl.tar.gz", "df0608d84f7b4c511ef002271f0f6a9481a81da3e3c751d36392d6fc89540cf2"), | ||
Windows(:i686) => ("$bin_prefix/CSDP.v6.2.0.i686-w64-mingw32.tar.gz", "33f83f94bcec13087f9fa9276345ec296722b14b6a28c3790bb494e419bf41ea"), | ||
Linux(:powerpc64le, libc=:glibc) => ("$bin_prefix/CSDP.v6.2.0.powerpc64le-linux-gnu.tar.gz", "461214a00369395ccd544ec40e7c89d787fcc2a869aeb73a832f79ff06c16b97"), | ||
MacOS(:x86_64) => ("$bin_prefix/CSDP.v6.2.0.x86_64-apple-darwin14.tar.gz", "af4cbf6d324b32f26e3700d50ed2950eebbd3bdc6cc13eae8c1d15ba25c70de6"), | ||
Linux(:x86_64, libc=:glibc) => ("$bin_prefix/CSDP.v6.2.0.x86_64-linux-gnu.tar.gz", "7ddaafbe0079f6852b60c3479bbed050b367931da3c231ba26ef20c2b71c698f"), | ||
Linux(:x86_64, libc=:musl) => ("$bin_prefix/CSDP.v6.2.0.x86_64-linux-musl.tar.gz", "337e68f51132e080d8bb5cdf79197326df9637ede69ed9258c67626a99edc7b5"), | ||
FreeBSD(:x86_64) => ("$bin_prefix/CSDP.v6.2.0.x86_64-unknown-freebsd11.1.tar.gz", "d7affbc5d639bff71fce4848d77d368dbca49dd8125cf849a416c4c059668201"), | ||
Windows(:x86_64) => ("$bin_prefix/CSDP.v6.2.0.x86_64-w64-mingw32.tar.gz", "181520ca04efb32323a369ecee7d067937d9a59d5f45ed4b78d3669f8a52769d"), | ||
) | ||
|
||
# Install unsatisfied or updated dependencies: | ||
# We added `, isolate=true` as otherwise, it would segfault when closing `OpenBLAS32`, | ||
# probably because it is conflicting with Julia openblas. | ||
unsatisfied = any(!satisfied(p; verbose=verbose, isolate=true) for p in products) | ||
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 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, ignore_platform=true) | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.