Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 1 addition & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ os:
- osx
julia:
- 1.0
- 1.1
- 1.2
- 1.4

matrix:
allow_failures:
- julia: nightly

env:
- CSDP_USE_JULIA_LAPACK=true
- CSDP_USE_JULIA_LAPACK=false

addons:
apt: # apt-get for linux
packages:
Expand Down
8 changes: 5 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name = "CSDP"
uuid = "0a46da34-8e4b-519e-b418-48813639ff34"
repo = "https://github.com/JuliaOpt/CSDP.jl.git"
version = "0.5.4"
version = "0.6.0"

[deps]
BinDeps = "9e28174c-4ba2-5203-b857-d8d62c4213ee"
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
CSDP_jll = "9ce75daa-2788-5e2c-ba1d-cf8c48367b27"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand All @@ -14,7 +15,8 @@ SemidefiniteModels = "169818f4-1a3d-53bf-95b3-11177825b1e3"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
BinDeps = "0.8, 0.9, 1"
BinaryProvider = "0.5.9"
CSDP_jll = "=6.2.0"
Glob = "1.2"
MathOptInterface = "0.9.5"
MathProgBase = "0.7"
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
environment:
matrix:
- julia_version: 1
- julia_version: 1.1
- julia_version: 1.0
- julia_version: 1.4

platform:
- x86 # 32-bit
Expand Down
19 changes: 0 additions & 19 deletions deps/.deps.jl

This file was deleted.

100 changes: 18 additions & 82 deletions deps/build.jl
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
52 changes: 52 additions & 0 deletions deps/build_CSDP.v6.2.0.jl
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
Loading