From 018f0870fd6899b91c09f7077c15c7d81a32194d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Fri, 10 Apr 2020 15:56:42 +0200 Subject: [PATCH 01/21] Use CSDP_jll --- .travis.yml | 3 +-- Project.toml | 4 +++- appveyor.yml | 2 +- src/CSDP.jl | 12 ++++++++---- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index ddc584d..a75820d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,7 @@ os: - osx julia: - 1.0 - - 1.1 - - 1.2 + - 1.4 matrix: allow_failures: diff --git a/Project.toml b/Project.toml index 157962e..e66c6f6 100644 --- a/Project.toml +++ b/Project.toml @@ -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" +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" @@ -15,6 +16,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] BinDeps = "0.8, 0.9, 1" +CSDP_jll = "=6.2.0" Glob = "1.2" MathOptInterface = "0.9.5" MathProgBase = "0.7" diff --git a/appveyor.yml b/appveyor.yml index 342697c..5d19d0b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ environment: matrix: - julia_version: 1 - - julia_version: 1.1 + - julia_version: 1.4 platform: - x86 # 32-bit diff --git a/src/CSDP.jl b/src/CSDP.jl index 6aede6e..75f1eb4 100644 --- a/src/CSDP.jl +++ b/src/CSDP.jl @@ -3,11 +3,15 @@ module CSDP using LinearAlgebra # For Diagonal using SparseArrays # For SparseMatrixCSC -# Try to load the binary dependency -if isfile(joinpath(dirname(@__FILE__),"..","deps","deps.jl")) - include("../deps/deps.jl") +if VERSION < v"1.3" + if isfile(joinpath(dirname(@__FILE__),"..","deps","deps.jl")) + include("../deps/deps.jl") + else + error("CSDP not properly installed. Please run Pkg.build(\"CSDP\")") + end else - error("CSDP not properly installed. Please run Pkg.build(\"CSDP\")") + import CSDP_jll: csdp + const CSDP_INT = Cint end export Blockmatrix From 0e70e61f89b7f0b59d733a2caaaa6b21ac0535ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sun, 12 Apr 2020 15:11:55 +0200 Subject: [PATCH 02/21] Rename csdp -> libcsdp --- src/CSDP.jl | 2 +- src/debug-mat.jl | 10 +-- src/declarations.h.jl | 144 +++++++++++++++++++++--------------------- test/runtests.jl | 2 +- 4 files changed, 79 insertions(+), 79 deletions(-) diff --git a/src/CSDP.jl b/src/CSDP.jl index 75f1eb4..9878c99 100644 --- a/src/CSDP.jl +++ b/src/CSDP.jl @@ -10,7 +10,7 @@ if VERSION < v"1.3" error("CSDP not properly installed. Please run Pkg.build(\"CSDP\")") end else - import CSDP_jll: csdp + import CSDP_jll: libcsdp const CSDP_INT = Cint end diff --git a/src/debug-mat.jl b/src/debug-mat.jl index 970805f..4254c40 100644 --- a/src/debug-mat.jl +++ b/src/debug-mat.jl @@ -1,25 +1,25 @@ function print_block(b::blockrec) - ccall((:printb, CSDP.csdp), Nothing, (blockrec,), b) + ccall((:printb, CSDP.libcsdp), Nothing, (blockrec,), b) end function printm(A::blockmatrix) - ccall((:printm, CSDP.csdp), Nothing, (blockmatrix,), A) + ccall((:printm, CSDP.libcsdp), Nothing, (blockmatrix,), A) end printm(A::BlockMatrix) = printm(A.csdp) export printm print_sparseblock(A::sparseblock) = print_sparseblock(pointer_from_objref(A)) function print_sparseblock(a::Ptr{sparseblock}) - ccall((:print_sparse_block, CSDP.csdp), Nothing, (Ptr{sparseblock},), a) + ccall((:print_sparse_block, CSDP.libcsdp), Nothing, (Ptr{sparseblock},), a) end function print_sizeof() - ccall((:print_sizeof, CSDP.csdp), Nothing, ()) + ccall((:print_sizeof, CSDP.libcsdp), Nothing, ()) end function print_constraints(C::Vector{constraintmatrix}) - ccall((:print_constraints, CSDP.csdp), Nothing, (CSDP_INT, Ptr{constraintmatrix}), length(C), fptr(C)) + ccall((:print_constraints, CSDP.libcsdp), Nothing, (CSDP_INT, Ptr{constraintmatrix}), length(C), fptr(C)) end diff --git a/src/declarations.h.jl b/src/declarations.h.jl index 7e69f50..28d2697 100644 --- a/src/declarations.h.jl +++ b/src/declarations.h.jl @@ -4,221 +4,221 @@ export read_prob function triu(A::blockmatrix) - ccall((:triu,CSDP.csdp),Nothing,(blockmatrix,),A) + ccall((:triu,CSDP.libcsdp),Nothing,(blockmatrix,),A) end function store_packed(A::blockmatrix,B::blockmatrix) - ccall((:store_packed,CSDP.csdp),Nothing,(blockmatrix,blockmatrix),A,B) + ccall((:store_packed,CSDP.libcsdp),Nothing,(blockmatrix,blockmatrix),A,B) end function store_unpacked(A::blockmatrix,B::blockmatrix) - ccall((:store_unpacked,CSDP.csdp),Nothing,(blockmatrix,blockmatrix),A,B) + ccall((:store_unpacked,CSDP.libcsdp),Nothing,(blockmatrix,blockmatrix),A,B) end function alloc_mat_packed(A::blockmatrix,pB::Ref{blockmatrix}) - ccall((:alloc_mat_packed,CSDP.csdp),Nothing,(blockmatrix,Ref{blockmatrix}),A,pB) + ccall((:alloc_mat_packed,CSDP.libcsdp),Nothing,(blockmatrix,Ref{blockmatrix}),A,pB) end function free_mat_packed(A::blockmatrix) - ccall((:free_mat_packed,CSDP.csdp),Nothing,(blockmatrix,),A) + ccall((:free_mat_packed,CSDP.libcsdp),Nothing,(blockmatrix,),A) end function structnnz(n::CSDP_INT,k::CSDP_INT,C::blockmatrix,constraints::Ptr{constraintmatrix}) - ccall((:structnnz,CSDP.csdp),CSDP_INT,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{constraintmatrix}),n,k,C,constraints) + ccall((:structnnz,CSDP.libcsdp),CSDP_INT,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{constraintmatrix}),n,k,C,constraints) end function actnnz(n::CSDP_INT,lda::CSDP_INT,A::Ptr{Cdouble}) - ccall((:actnnz,CSDP.csdp),CSDP_INT,(CSDP_INT,CSDP_INT,Ptr{Cdouble}),n,lda,A) + ccall((:actnnz,CSDP.libcsdp),CSDP_INT,(CSDP_INT,CSDP_INT,Ptr{Cdouble}),n,lda,A) end function bandwidth(n::CSDP_INT,lda::CSDP_INT,A::Ptr{Cdouble}) - ccall((:bandwidth,CSDP.csdp),CSDP_INT,(CSDP_INT,CSDP_INT,Ptr{Cdouble}),n,lda,A) + ccall((:bandwidth,CSDP.libcsdp),CSDP_INT,(CSDP_INT,CSDP_INT,Ptr{Cdouble}),n,lda,A) end function qreig(n::CSDP_INT,maindiag::Ptr{Cdouble},offdiag::Ptr{Cdouble}) - ccall((:qreig,CSDP.csdp),Nothing,(CSDP_INT,Ptr{Cdouble},Ptr{Cdouble}),n,maindiag,offdiag) + ccall((:qreig,CSDP.libcsdp),Nothing,(CSDP_INT,Ptr{Cdouble},Ptr{Cdouble}),n,maindiag,offdiag) end function sort_entries(k::CSDP_INT,C::blockmatrix,constraints::Ptr{constraintmatrix}) - ccall((:sort_entries,CSDP.csdp),Nothing,(CSDP_INT,blockmatrix,Ptr{constraintmatrix}),k,C,constraints) + ccall((:sort_entries,CSDP.libcsdp),Nothing,(CSDP_INT,blockmatrix,Ptr{constraintmatrix}),k,C,constraints) end function norm2(n::CSDP_INT,x::Ptr{Cdouble}) - ccall((:norm2,CSDP.csdp),Cdouble,(CSDP_INT,Ptr{Cdouble}),n,x) + ccall((:norm2,CSDP.libcsdp),Cdouble,(CSDP_INT,Ptr{Cdouble}),n,x) end function norm1(n::CSDP_INT,x::Ptr{Cdouble}) - ccall((:norm1,CSDP.csdp),Cdouble,(CSDP_INT,Ptr{Cdouble}),n,x) + ccall((:norm1,CSDP.libcsdp),Cdouble,(CSDP_INT,Ptr{Cdouble}),n,x) end function norminf(n::CSDP_INT,x::Ptr{Cdouble}) - ccall((:norminf,CSDP.csdp),Cdouble,(CSDP_INT,Ptr{Cdouble}),n,x) + ccall((:norminf,CSDP.libcsdp),Cdouble,(CSDP_INT,Ptr{Cdouble}),n,x) end function Fnorm(A::blockmatrix) - ccall((:Fnorm,CSDP.csdp),Cdouble,(blockmatrix,),A) + ccall((:Fnorm,CSDP.libcsdp),Cdouble,(blockmatrix,),A) end function Knorm(A::blockmatrix) - ccall((:Knorm,CSDP.csdp),Cdouble,(blockmatrix,),A) + ccall((:Knorm,CSDP.libcsdp),Cdouble,(blockmatrix,),A) end function mat1norm(A::blockmatrix) - ccall((:mat1norm,CSDP.csdp),Cdouble,(blockmatrix,),A) + ccall((:mat1norm,CSDP.libcsdp),Cdouble,(blockmatrix,),A) end function matinfnorm(A::blockmatrix) - ccall((:matinfnorm,CSDP.csdp),Cdouble,(blockmatrix,),A) + ccall((:matinfnorm,CSDP.libcsdp),Cdouble,(blockmatrix,),A) end function calc_pobj(C::blockmatrix,X::blockmatrix,constant_offset::Cdouble) - ccall((:calc_pobj,CSDP.csdp),Cdouble,(blockmatrix,blockmatrix,Cdouble),C,X,constant_offset) + ccall((:calc_pobj,CSDP.libcsdp),Cdouble,(blockmatrix,blockmatrix,Cdouble),C,X,constant_offset) end function calc_dobj(k::CSDP_INT,a::Ptr{Cdouble},y::Ptr{Cdouble},constant_offset::Cdouble) - ccall((:calc_dobj,CSDP.csdp),Cdouble,(CSDP_INT,Ptr{Cdouble},Ptr{Cdouble},Cdouble),k,a,y,constant_offset) + ccall((:calc_dobj,CSDP.libcsdp),Cdouble,(CSDP_INT,Ptr{Cdouble},Ptr{Cdouble},Cdouble),k,a,y,constant_offset) end function trace_prod(A::blockmatrix,B::blockmatrix) - ccall((:trace_prod,CSDP.csdp),Cdouble,(blockmatrix,blockmatrix),A,B) + ccall((:trace_prod,CSDP.libcsdp),Cdouble,(blockmatrix,blockmatrix),A,B) end function linesearch(n::CSDP_INT,dX::blockmatrix,work1::blockmatrix,work2::blockmatrix,work3::blockmatrix,cholinv::blockmatrix,q::Ptr{Cdouble},z::Ptr{Cdouble},workvec::Ptr{Cdouble},stepfrac::Cdouble,start::Cdouble,printlevel::CSDP_INT) - ccall((:linesearch,CSDP.csdp),Cdouble,(CSDP_INT,blockmatrix,blockmatrix,blockmatrix,blockmatrix,blockmatrix,Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Cdouble,Cdouble,CSDP_INT),n,dX,work1,work2,work3,cholinv,q,z,workvec,stepfrac,start,printlevel) + ccall((:linesearch,CSDP.libcsdp),Cdouble,(CSDP_INT,blockmatrix,blockmatrix,blockmatrix,blockmatrix,blockmatrix,Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Cdouble,Cdouble,CSDP_INT),n,dX,work1,work2,work3,cholinv,q,z,workvec,stepfrac,start,printlevel) end function pinfeas(k::CSDP_INT,constraints::Ptr{constraintmatrix},X::blockmatrix,a::Ptr{Cdouble},workvec::Ptr{Cdouble}) - ccall((:pinfeas,CSDP.csdp),Cdouble,(CSDP_INT,Ptr{constraintmatrix},blockmatrix,Ptr{Cdouble},Ptr{Cdouble}),k,constraints,X,a,workvec) + ccall((:pinfeas,CSDP.libcsdp),Cdouble,(CSDP_INT,Ptr{constraintmatrix},blockmatrix,Ptr{Cdouble},Ptr{Cdouble}),k,constraints,X,a,workvec) end function dinfeas(k::CSDP_INT,C::blockmatrix,constraints::Ptr{constraintmatrix},y::Ptr{Cdouble},Z::blockmatrix,work1::blockmatrix) - ccall((:dinfeas,CSDP.csdp),Cdouble,(CSDP_INT,blockmatrix,Ptr{constraintmatrix},Ptr{Cdouble},blockmatrix,blockmatrix),k,C,constraints,y,Z,work1) + ccall((:dinfeas,CSDP.libcsdp),Cdouble,(CSDP_INT,blockmatrix,Ptr{constraintmatrix},Ptr{Cdouble},blockmatrix,blockmatrix),k,C,constraints,y,Z,work1) end function dimacserr3(k::CSDP_INT,C::blockmatrix,constraints::Ptr{constraintmatrix},y::Ptr{Cdouble},Z::blockmatrix,work1::blockmatrix) - ccall((:dimacserr3,CSDP.csdp),Cdouble,(CSDP_INT,blockmatrix,Ptr{constraintmatrix},Ptr{Cdouble},blockmatrix,blockmatrix),k,C,constraints,y,Z,work1) + ccall((:dimacserr3,CSDP.libcsdp),Cdouble,(CSDP_INT,blockmatrix,Ptr{constraintmatrix},Ptr{Cdouble},blockmatrix,blockmatrix),k,C,constraints,y,Z,work1) end function op_a(k::CSDP_INT,constraints::Ptr{constraintmatrix},X::blockmatrix,result::Ptr{Cdouble}) - ccall((:op_a,CSDP.csdp),Nothing,(CSDP_INT,Ptr{constraintmatrix},blockmatrix,Ptr{Cdouble}),k,constraints,X,result) + ccall((:op_a,CSDP.libcsdp),Nothing,(CSDP_INT,Ptr{constraintmatrix},blockmatrix,Ptr{Cdouble}),k,constraints,X,result) end function op_at(k::CSDP_INT,y::Ptr{Cdouble},constraints::Ptr{constraintmatrix},result::blockmatrix) - ccall((:op_at,CSDP.csdp),Nothing,(CSDP_INT,Ptr{Cdouble},Ptr{constraintmatrix},blockmatrix),k,y,constraints,result) + ccall((:op_at,CSDP.libcsdp),Nothing,(CSDP_INT,Ptr{Cdouble},Ptr{constraintmatrix},blockmatrix),k,y,constraints,result) end function makefill(k::CSDP_INT,C::blockmatrix,constraints::Ptr{constraintmatrix},pfill::Ref{constraintmatrix},work1::blockmatrix,printlevel::CSDP_INT) - ccall((:makefill,CSDP.csdp),Nothing,(CSDP_INT,blockmatrix,Ptr{constraintmatrix},Ref{constraintmatrix},blockmatrix,CSDP_INT),k,C,constraints,pfill,work1,printlevel) + ccall((:makefill,CSDP.libcsdp),Nothing,(CSDP_INT,blockmatrix,Ptr{constraintmatrix},Ref{constraintmatrix},blockmatrix,CSDP_INT),k,C,constraints,pfill,work1,printlevel) end function op_o(k::CSDP_INT,constraints::Ptr{constraintmatrix},byblocks::Ptr{Ptr{sparseblock}},Zi::blockmatrix,X::blockmatrix,O::Ptr{Cdouble},work1::blockmatrix,work2::blockmatrix) - ccall((:op_o,CSDP.csdp),Nothing,(CSDP_INT,Ptr{constraintmatrix},Ptr{Ptr{sparseblock}},blockmatrix,blockmatrix,Ptr{Cdouble},blockmatrix,blockmatrix),k,constraints,byblocks,Zi,X,O,work1,work2) + ccall((:op_o,CSDP.libcsdp),Nothing,(CSDP_INT,Ptr{constraintmatrix},Ptr{Ptr{sparseblock}},blockmatrix,blockmatrix,Ptr{Cdouble},blockmatrix,blockmatrix),k,constraints,byblocks,Zi,X,O,work1,work2) end function addscaledmat(A::blockmatrix,scale::Cdouble,B::blockmatrix,C::blockmatrix) - ccall((:addscaledmat,CSDP.csdp),Nothing,(blockmatrix,Cdouble,blockmatrix,blockmatrix),A,scale,B,C) + ccall((:addscaledmat,CSDP.libcsdp),Nothing,(blockmatrix,Cdouble,blockmatrix,blockmatrix),A,scale,B,C) end function zero_mat(A::blockmatrix) - ccall((:zero_mat,CSDP.csdp),Nothing,(blockmatrix,),A) + ccall((:zero_mat,CSDP.libcsdp),Nothing,(blockmatrix,),A) end function add_mat(A::blockmatrix,B::blockmatrix) - ccall((:add_mat,CSDP.csdp),Nothing,(blockmatrix,blockmatrix),A,B) + ccall((:add_mat,CSDP.libcsdp),Nothing,(blockmatrix,blockmatrix),A,B) end function sym_mat(A::blockmatrix) - ccall((:sym_mat,CSDP.csdp),Nothing,(blockmatrix,),A) + ccall((:sym_mat,CSDP.libcsdp),Nothing,(blockmatrix,),A) end function make_i(A::blockmatrix) - ccall((:make_i,CSDP.csdp),Nothing,(blockmatrix,),A) + ccall((:make_i,CSDP.libcsdp),Nothing,(blockmatrix,),A) end function copy_mat(A::blockmatrix,B::blockmatrix) - ccall((:copy_mat,CSDP.csdp),Nothing,(blockmatrix,blockmatrix),A,B) + ccall((:copy_mat,CSDP.libcsdp),Nothing,(blockmatrix,blockmatrix),A,B) end function mat_mult(scale1::Cdouble,scale2::Cdouble,A::blockmatrix,B::blockmatrix,C::blockmatrix) - ccall((:mat_mult,CSDP.csdp),Nothing,(Cdouble,Cdouble,blockmatrix,blockmatrix,blockmatrix),scale1,scale2,A,B,C) + ccall((:mat_mult,CSDP.libcsdp),Nothing,(Cdouble,Cdouble,blockmatrix,blockmatrix,blockmatrix),scale1,scale2,A,B,C) end function mat_multspa(scale1::Cdouble,scale2::Cdouble,A::blockmatrix,B::blockmatrix,C::blockmatrix,fill::constraintmatrix) - ccall((:mat_multspa,CSDP.csdp),Nothing,(Cdouble,Cdouble,blockmatrix,blockmatrix,blockmatrix,constraintmatrix),scale1,scale2,A,B,C,fill) + ccall((:mat_multspa,CSDP.libcsdp),Nothing,(Cdouble,Cdouble,blockmatrix,blockmatrix,blockmatrix,constraintmatrix),scale1,scale2,A,B,C,fill) end function mat_multspb(scale1::Cdouble,scale2::Cdouble,A::blockmatrix,B::blockmatrix,C::blockmatrix,fill::constraintmatrix) - ccall((:mat_multspb,CSDP.csdp),Nothing,(Cdouble,Cdouble,blockmatrix,blockmatrix,blockmatrix,constraintmatrix),scale1,scale2,A,B,C,fill) + ccall((:mat_multspb,CSDP.libcsdp),Nothing,(Cdouble,Cdouble,blockmatrix,blockmatrix,blockmatrix,constraintmatrix),scale1,scale2,A,B,C,fill) end function mat_multspc(scale1::Cdouble,scale2::Cdouble,A::blockmatrix,B::blockmatrix,C::blockmatrix,fill::constraintmatrix) - ccall((:mat_multspc,CSDP.csdp),Nothing,(Cdouble,Cdouble,blockmatrix,blockmatrix,blockmatrix,constraintmatrix),scale1,scale2,A,B,C,fill) + ccall((:mat_multspc,CSDP.libcsdp),Nothing,(Cdouble,Cdouble,blockmatrix,blockmatrix,blockmatrix,constraintmatrix),scale1,scale2,A,B,C,fill) end function mat_mult_raw(n::CSDP_INT,scale1::Cdouble,scale2::Cdouble,ap::Ptr{Cdouble},bp::Ptr{Cdouble},cp::Ptr{Cdouble}) - ccall((:mat_mult_raw,CSDP.csdp),Nothing,(CSDP_INT,Cdouble,Cdouble,Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble}),n,scale1,scale2,ap,bp,cp) + ccall((:mat_mult_raw,CSDP.libcsdp),Nothing,(CSDP_INT,Cdouble,Cdouble,Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble}),n,scale1,scale2,ap,bp,cp) end function mat_mult_rawatlas(n::CSDP_INT,scale1::Cdouble,scale2::Cdouble,ap::Ptr{Cdouble},bp::Ptr{Cdouble},cp::Ptr{Cdouble}) - ccall((:mat_mult_rawatlas,CSDP.csdp),Nothing,(CSDP_INT,Cdouble,Cdouble,Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble}),n,scale1,scale2,ap,bp,cp) + ccall((:mat_mult_rawatlas,CSDP.libcsdp),Nothing,(CSDP_INT,Cdouble,Cdouble,Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble}),n,scale1,scale2,ap,bp,cp) end function matvec(A::blockmatrix,x::Ptr{Cdouble},y::Ptr{Cdouble}) - ccall((:matvec,CSDP.csdp),Nothing,(blockmatrix,Ptr{Cdouble},Ptr{Cdouble}),A,x,y) + ccall((:matvec,CSDP.libcsdp),Nothing,(blockmatrix,Ptr{Cdouble},Ptr{Cdouble}),A,x,y) end function alloc_mat(A::blockmatrix,pB::Ref{blockmatrix}) - ccall((:alloc_mat,CSDP.csdp),Nothing,(blockmatrix,Ref{blockmatrix}),A,pB) + ccall((:alloc_mat,CSDP.libcsdp),Nothing,(blockmatrix,Ref{blockmatrix}),A,pB) end function free_mat(A::blockmatrix) - ccall((:free_mat,CSDP.csdp),Nothing,(blockmatrix,),A) + ccall((:free_mat,CSDP.libcsdp),Nothing,(blockmatrix,),A) end function initparams(params::Ptr{paramstruc},pprintlevel::Ptr{CSDP_INT}) - ccall((:initparams,CSDP.csdp),Nothing,(Ptr{paramstruc},Ptr{CSDP_INT}),params,pprintlevel) + ccall((:initparams,CSDP.libcsdp),Nothing,(Ptr{paramstruc},Ptr{CSDP_INT}),params,pprintlevel) end function loaded_initsoln(problem::Ptr{Cvoid}, X::Ref{blockmatrix}, Z::Ref{blockmatrix}) y = Ref{Ptr{Cdouble}}(C_NULL) - ccall((:loaded_initsoln,CSDP.csdp),Nothing,(Ptr{Cvoid},Ref{blockmatrix},Ref{Ptr{Cdouble}},Ref{blockmatrix}),problem,X,y,Z) + ccall((:loaded_initsoln,CSDP.libcsdp),Nothing,(Ptr{Cvoid},Ref{blockmatrix},Ref{Ptr{Cdouble}},Ref{blockmatrix}),problem,X,y,Z) return y[] end function initsoln(n::CSDP_INT,k::CSDP_INT,C::blockmatrix,a::Ptr{Cdouble},constraints::Ptr{constraintmatrix}) X = Ref{blockmatrix}(blockmatrix(0, C_NULL)) y = Ref{Ptr{Cdouble}}(C_NULL) Z = Ref{blockmatrix}(blockmatrix(0, C_NULL)) - ccall((:initsoln,CSDP.csdp),Nothing,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Ptr{constraintmatrix},Ref{blockmatrix},Ref{Ptr{Cdouble}},Ref{blockmatrix}),n,k,C,a,constraints,X,y,Z) + ccall((:initsoln,CSDP.libcsdp),Nothing,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Ptr{constraintmatrix},Ref{blockmatrix},Ref{Ptr{Cdouble}},Ref{blockmatrix}),n,k,C,a,constraints,X,y,Z) X[], y[], Z[] end function trans(A::blockmatrix) - ccall((:trans,CSDP.csdp),Nothing,(blockmatrix,),A) + ccall((:trans,CSDP.libcsdp),Nothing,(blockmatrix,),A) end function chol_inv(A::blockmatrix,B::blockmatrix) - ccall((:chol_inv,CSDP.csdp),Nothing,(blockmatrix,blockmatrix),A,B) + ccall((:chol_inv,CSDP.libcsdp),Nothing,(blockmatrix,blockmatrix),A,B) end function chol(A::blockmatrix) - ccall((:chol,CSDP.csdp),CSDP_INT,(blockmatrix,),A) + ccall((:chol,CSDP.libcsdp),CSDP_INT,(blockmatrix,),A) end function solvesys(m::CSDP_INT,ldam::CSDP_INT,A::Ptr{Cdouble},rhs::Ptr{Cdouble}) - ccall((:solvesys,CSDP.csdp),CSDP_INT,(CSDP_INT,CSDP_INT,Ptr{Cdouble},Ptr{Cdouble}),m,ldam,A,rhs) + ccall((:solvesys,CSDP.libcsdp),CSDP_INT,(CSDP_INT,CSDP_INT,Ptr{Cdouble},Ptr{Cdouble}),m,ldam,A,rhs) end function user_exit(n::CSDP_INT,k::CSDP_INT,C::blockmatrix,a::Ptr{Cdouble},dobj::Cdouble,pobj::Cdouble,constant_offset::Cdouble,constraints::Ptr{constraintmatrix},X::blockmatrix,y::Ptr{Cdouble},Z::blockmatrix,params::paramstruc) - ccall((:user_exit,CSDP.csdp),CSDP_INT,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Cdouble,Cdouble,Cdouble,Ptr{constraintmatrix},blockmatrix,Ptr{Cdouble},blockmatrix,paramstruc),n,k,C,a,dobj,pobj,constant_offset,constraints,X,y,Z,params) + ccall((:user_exit,CSDP.libcsdp),CSDP_INT,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Cdouble,Cdouble,Cdouble,Ptr{constraintmatrix},blockmatrix,Ptr{Cdouble},blockmatrix,paramstruc),n,k,C,a,dobj,pobj,constant_offset,constraints,X,y,Z,params) end function read_sol(fname::Ptr{UInt8},n::CSDP_INT,k::CSDP_INT,C::blockmatrix,pX::Ptr{blockmatrix},py::Ptr{Ptr{Cdouble}},pZ::Ptr{blockmatrix}) - ccall((:read_sol,CSDP.csdp),CSDP_INT,(Ptr{UInt8},CSDP_INT,CSDP_INT,blockmatrix,Ptr{blockmatrix},Ptr{Ptr{Cdouble}},Ptr{blockmatrix}),fname,n,k,C,pX,py,pZ) + ccall((:read_sol,CSDP.libcsdp),CSDP_INT,(Ptr{UInt8},CSDP_INT,CSDP_INT,blockmatrix,Ptr{blockmatrix},Ptr{Ptr{Cdouble}},Ptr{blockmatrix}),fname,n,k,C,pX,py,pZ) end function load_prob_from_file(fname::String,C::Ref{blockmatrix},printlevel::Integer=1) problem = Ref{Ptr{Cvoid}}(C_NULL) - ret = ccall((:load_prob_from_file,CSDP.csdp),CSDP_INT,(Ptr{UInt8},Ref{blockmatrix},Ref{Ptr{Cvoid}},CSDP_INT),fname,C,problem,printlevel) + ret = ccall((:load_prob_from_file,CSDP.libcsdp),CSDP_INT,(Ptr{UInt8},Ref{blockmatrix},Ref{Ptr{Cvoid}},CSDP_INT),fname,C,problem,printlevel) if !iszero(ret) error("`CSDP.load_prob_from_file` failed.") end @@ -230,7 +230,7 @@ function read_prob(fname::String,printlevel::Integer=1) C = Ref{blockmatrix}(blockmatrix(0, C_NULL)) a = Ref{Ptr{Cdouble}}(C_NULL) constraints = Ref{Ptr{constraintmatrix}}(C_NULL) - ccall((:read_prob,CSDP.csdp),CSDP_INT,(Ptr{UInt8},Ref{CSDP_INT},Ref{CSDP_INT},Ref{blockmatrix},Ref{Ptr{Cdouble}},Ref{Ptr{constraintmatrix}},CSDP_INT),fname,n,k,C,a,constraints,printlevel) + ccall((:read_prob,CSDP.libcsdp),CSDP_INT,(Ptr{UInt8},Ref{CSDP_INT},Ref{CSDP_INT},Ref{blockmatrix},Ref{Ptr{Cdouble}},Ref{Ptr{constraintmatrix}},CSDP_INT),fname,n,k,C,a,constraints,printlevel) C = mywrap(C[]) a = mywrap(a[], k[]) constraints = mywrap(constraints[], k[]) @@ -248,7 +248,7 @@ function write_prob(fname::String, C::blockmatrix, a::Ptr{Cdouble}, constraints::Ptr{constraintmatrix}) - ccall((:write_prob,CSDP.csdp),CSDP_INT,(Ptr{UInt8},CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Ptr{constraintmatrix}), + ccall((:write_prob,CSDP.libcsdp),CSDP_INT,(Ptr{UInt8},CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Ptr{constraintmatrix}), fname,n,k,C,a,constraints) end @@ -258,7 +258,7 @@ function write_sol(fname::String, X::blockmatrix, y::Ptr{Cdouble}, Z::blockmatrix) - ccall((:write_sol,CSDP.csdp), + ccall((:write_sol,CSDP.libcsdp), CSDP_INT, (Ptr{UInt8}, CSDP_INT, @@ -270,39 +270,39 @@ function write_sol(fname::String, end function free_prob(n::CSDP_INT,k::CSDP_INT,C::blockmatrix,a::Ptr{Cdouble},constraints::Ptr{constraintmatrix},X::blockmatrix,y::Ptr{Cdouble},Z::blockmatrix) - ccall((:free_prob,CSDP.csdp),Nothing,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Ptr{constraintmatrix},blockmatrix,Ptr{Cdouble},blockmatrix),n,k,C,a,constraints,X,y,Z) + ccall((:free_prob,CSDP.libcsdp),Nothing,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Ptr{constraintmatrix},blockmatrix,Ptr{Cdouble},blockmatrix),n,k,C,a,constraints,X,y,Z) end #function new_blockmatrix(nblocks::Integer) -# return ccall((:new_blockmatrix,CSDP.csdp),Ptr{Cvoid},(CSDP_INT,),nblocks) +# return ccall((:new_blockmatrix,CSDP.libcsdp),Ptr{Cvoid},(CSDP_INT,),nblocks) #end #function free_blockmatrix(C::Ptr{Cvoid}) -# ccall((:free_blockmatrix,CSDP.csdp),Nothing,(Ptr{Cvoid},),C) +# ccall((:free_blockmatrix,CSDP.libcsdp),Nothing,(Ptr{Cvoid},),C) #end function Base.getindex(A::blockrec, i::Integer, j::Integer) - return ccall((:getindex,CSDP.csdp), Cdouble, (blockrec,CSDP_INT,CSDP_INT), A, i, j) + return ccall((:getindex,CSDP.libcsdp), Cdouble, (blockrec,CSDP_INT,CSDP_INT), A, i, j) end function getblockrec(A::blockmatrix, i::Integer) - return ccall((:getblockrec,CSDP.csdp), blockrec, (blockmatrix,CSDP_INT), A, i) + return ccall((:getblockrec,CSDP.libcsdp), blockrec, (blockmatrix,CSDP_INT), A, i) end function allocate_loading_prob(pC::Ref{blockmatrix}, block_dims::Ptr{CSDP_INT}, num_constraints::Integer, num_entries::Ptr{CSDP_INT}, printlevel::Integer) - return ccall((:allocate_loading_prob,CSDP.csdp),Ptr{Cvoid},(Ref{blockmatrix},Ptr{CSDP_INT},CSDP_INT,Ptr{CSDP_INT},CSDP_INT),pC,block_dims,num_constraints,num_entries,printlevel) + return ccall((:allocate_loading_prob,CSDP.libcsdp),Ptr{Cvoid},(Ref{blockmatrix},Ptr{CSDP_INT},CSDP_INT,Ptr{CSDP_INT},CSDP_INT),pC,block_dims,num_constraints,num_entries,printlevel) end function free_loading_prob(problem::Ptr{Cvoid}) - ccall((:free_loading_prob,CSDP.csdp),Nothing,(Ptr{Cvoid},),problem) + ccall((:free_loading_prob,CSDP.libcsdp),Nothing,(Ptr{Cvoid},),problem) end function free_loaded_prob(problem::Ptr{Cvoid},X::blockmatrix,y::Ptr{Cdouble},Z::blockmatrix) - ccall((:free_loaded_prob,CSDP.csdp),Nothing,(Ptr{Cvoid},blockmatrix,Ptr{Cdouble},blockmatrix),problem,X,y,Z) + ccall((:free_loaded_prob,CSDP.libcsdp),Nothing,(Ptr{Cvoid},blockmatrix,Ptr{Cdouble},blockmatrix),problem,X,y,Z) end function setconstant(problem::Ptr{Cvoid}, mat::Integer, ent::Cdouble) - ccall((:setconstant,CSDP.csdp),Nothing,(Ptr{Cvoid},CSDP_INT,Cdouble),problem,mat,ent) + ccall((:setconstant,CSDP.libcsdp),Nothing,(Ptr{Cvoid},CSDP_INT,Cdouble),problem,mat,ent) end function addentry(problem::Ptr{Cvoid}, mat::Integer, blk::Integer, indexi::Integer, indexj::Integer, ent::Cdouble, allow_duplicates::Integer) - ccall((:addentry,CSDP.csdp),CSDP_INT,(Ptr{Cvoid},CSDP_INT,CSDP_INT,CSDP_INT,CSDP_INT,Cdouble,CSDP_INT),problem,mat,blk,indexi,indexj,ent,allow_duplicates) + ccall((:addentry,CSDP.libcsdp),CSDP_INT,(Ptr{Cvoid},CSDP_INT,CSDP_INT,CSDP_INT,CSDP_INT,Cdouble,CSDP_INT),problem,mat,blk,indexi,indexj,ent,allow_duplicates) end function sdp(n::CSDP_INT, k::CSDP_INT, @@ -336,7 +336,7 @@ function sdp(n::CSDP_INT, k::CSDP_INT, sort_entries(k, C, constraints) - status = ccall((:sdp, CSDP.csdp), CSDP_INT, + status = ccall((:sdp, CSDP.libcsdp), CSDP_INT, (CSDP_INT, CSDP_INT, # n, k blockmatrix, Ptr{Cdouble}, Cdouble, Ptr{constraintmatrix}, Ptr{Ptr{sparseblock}}, constraintmatrix, # byblocks, fill @@ -384,7 +384,7 @@ end function loaded_sdp(problem::Ptr{Cvoid},constant_offset::Cdouble,pX::Ref{blockmatrix},py::Ref{Ptr{Cdouble}},pZ::Ref{blockmatrix},printlevel::CSDP_INT,parameters::paramstruc) pobj = Ref{Cdouble}(0.0) dobj = Ref{Cdouble}(0.0) - status = ccall((:loaded_sdp,CSDP.csdp),CSDP_INT, + status = ccall((:loaded_sdp,CSDP.libcsdp),CSDP_INT, (Ptr{Cvoid},Cdouble, Ref{blockmatrix},Ref{Ptr{Cdouble}},Ref{blockmatrix},Ref{Cdouble},Ref{Cdouble},CSDP_INT,paramstruc), problem, constant_offset,pX, py, pZ,pobj,dobj,printlevel,parameters) return status, pobj[], dobj[] @@ -392,20 +392,20 @@ end function parametrized_sdp(n::CSDP_INT,k::CSDP_INT,C::blockmatrix,a::Ptr{Cdouble},constraints::Ptr{constraintmatrix},constant_offset::Cdouble,pX::Ptr{blockmatrix},py::Ref{Ptr{Cdouble}},pZ::Ptr{blockmatrix},printlevel::CSDP_INT,parameters::paramstruc) pobj = Ref{Cdouble}(0.0) dobj = Ref{Cdouble}(0.0) - status = ccall((:parametrized_sdp,CSDP.csdp),CSDP_INT,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Ptr{constraintmatrix},Cdouble,Ptr{blockmatrix},Ref{Ptr{Cdouble}},Ptr{blockmatrix},Ref{Cdouble},Ref{Cdouble},CSDP_INT,paramstruc),n,k,C,a,constraints,constant_offset,pX,py,pZ,pobj,dobj,printlevel,parameters) + status = ccall((:parametrized_sdp,CSDP.libcsdp),CSDP_INT,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Ptr{constraintmatrix},Cdouble,Ptr{blockmatrix},Ref{Ptr{Cdouble}},Ptr{blockmatrix},Ref{Cdouble},Ref{Cdouble},CSDP_INT,paramstruc),n,k,C,a,constraints,constant_offset,pX,py,pZ,pobj,dobj,printlevel,parameters) return status, pobj[], dobj[] end function easy_sdp(n::CSDP_INT,k::CSDP_INT,C::blockmatrix,a::Ptr{Cdouble},constraints::Ptr{constraintmatrix},constant_offset::Cdouble,pX::Ptr{blockmatrix},py::Ref{Ptr{Cdouble}},pZ::Ptr{blockmatrix}) pobj = Ref{Cdouble}(0.0) dobj = Ref{Cdouble}(0.0) - status = ccall((:easy_sdp,CSDP.csdp),CSDP_INT,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Ptr{constraintmatrix},Cdouble,Ptr{blockmatrix},Ref{Ptr{Cdouble}},Ptr{blockmatrix},Ref{Cdouble},Ref{Cdouble}),n,k,C,a,constraints,constant_offset,pX,py,pZ,pobj,dobj) + status = ccall((:easy_sdp,CSDP.libcsdp),CSDP_INT,(CSDP_INT,CSDP_INT,blockmatrix,Ptr{Cdouble},Ptr{constraintmatrix},Cdouble,Ptr{blockmatrix},Ref{Ptr{Cdouble}},Ptr{blockmatrix},Ref{Cdouble},Ref{Cdouble}),n,k,C,a,constraints,constant_offset,pX,py,pZ,pobj,dobj) return status, pobj[], dobj[] end function tweakgap(n::CSDP_INT,k::CSDP_INT,a::Ptr{Cdouble},constraints::Ptr{constraintmatrix},gap::Cdouble,Z::blockmatrix,dZ::blockmatrix,y::Ptr{Cdouble},dy::Ptr{Cdouble},work1::blockmatrix,work2::blockmatrix,work3::blockmatrix,work4::blockmatrix,workvec1::Ptr{Cdouble},workvec2::Ptr{Cdouble},workvec3::Ptr{Cdouble},workvec4::Ptr{Cdouble},printlevel::CSDP_INT) - ccall((:tweakgap,CSDP.csdp),Nothing,(CSDP_INT,CSDP_INT,Ptr{Cdouble},Ptr{constraintmatrix},Cdouble,blockmatrix,blockmatrix,Ptr{Cdouble},Ptr{Cdouble},blockmatrix,blockmatrix,blockmatrix,blockmatrix,Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},CSDP_INT),n,k,a,constraints,gap,Z,dZ,y,dy,work1,work2,work3,work4,workvec1,workvec2,workvec3,workvec4,printlevel) + ccall((:tweakgap,CSDP.libcsdp),Nothing,(CSDP_INT,CSDP_INT,Ptr{Cdouble},Ptr{constraintmatrix},Cdouble,blockmatrix,blockmatrix,Ptr{Cdouble},Ptr{Cdouble},blockmatrix,blockmatrix,blockmatrix,blockmatrix,Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},CSDP_INT),n,k,a,constraints,gap,Z,dZ,y,dy,work1,work2,work3,work4,workvec1,workvec2,workvec3,workvec4,printlevel) end function bisect_(n::Ptr{CSDP_INT},eps1::Ptr{Cdouble},d::Ptr{Cdouble},e::Ptr{Cdouble},e2::Ptr{Cdouble},lb::Ptr{Cdouble},ub::Ptr{Cdouble},mm::Ptr{CSDP_INT},m::Ptr{CSDP_INT},w::Ptr{Cdouble},ind::Ptr{CSDP_INT},ierr::Ptr{CSDP_INT},rv4::Ptr{Cdouble},rv5::Ptr{Cdouble}) - ccall((:bisect_,CSDP.csdp),CSDP_INT,(Ptr{CSDP_INT},Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Ptr{CSDP_INT},Ptr{CSDP_INT},Ptr{Cdouble},Ptr{CSDP_INT},Ptr{CSDP_INT},Ptr{Cdouble},Ptr{Cdouble}),n,eps1,d,e,e2,lb,ub,mm,m,w,ind,ierr,rv4,rv5) + ccall((:bisect_,CSDP.libcsdp),CSDP_INT,(Ptr{CSDP_INT},Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble},Ptr{CSDP_INT},Ptr{CSDP_INT},Ptr{Cdouble},Ptr{CSDP_INT},Ptr{CSDP_INT},Ptr{Cdouble},Ptr{Cdouble}),n,eps1,d,e,e2,lb,ub,mm,m,w,ind,ierr,rv4,rv5) end diff --git a/test/runtests.jl b/test/runtests.jl index a05daef..43b4bad 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -18,7 +18,7 @@ end @testset "Call libcsdp.norm1" begin vec = Cdouble[1.0, 2.0, 0.0, -1.0] try - n1 = ccall((:norm1, CSDP.csdp), + n1 = ccall((:norm1, CSDP.libcsdp), Cdouble, (Cint, Ptr{Cdouble}), length(vec), vec) From 71406813fce9059f264d906a8ef310534c9e70ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Tue, 14 Apr 2020 10:58:50 +0200 Subject: [PATCH 03/21] Use JLL binary on Julia < 1.3 --- Project.toml | 4 +- deps/.deps.jl | 19 ------ deps/build.jl | 129 +++++++++++++-------------------------- deps/clang.jl | 54 ---------------- deps/compile.jl | 98 ----------------------------- deps/constants.jl | 19 ------ deps/src/debug-mat.c | 122 ------------------------------------ deps/src/lapack.h | 15 ----- deps/src/makefile | 21 ------- deps/src/patch.py | 95 ---------------------------- deps/src/patch_lapack.jl | 9 --- src/CSDP.jl | 5 +- 12 files changed, 50 insertions(+), 540 deletions(-) delete mode 100644 deps/.deps.jl delete mode 100644 deps/clang.jl delete mode 100644 deps/compile.jl delete mode 100644 deps/constants.jl delete mode 100644 deps/src/debug-mat.c delete mode 100644 deps/src/lapack.h delete mode 100644 deps/src/makefile delete mode 100755 deps/src/patch.py delete mode 100644 deps/src/patch_lapack.jl diff --git a/Project.toml b/Project.toml index e66c6f6..f4894a9 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,7 @@ repo = "https://github.com/JuliaOpt/CSDP.jl.git" 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" @@ -15,7 +15,7 @@ SemidefiniteModels = "169818f4-1a3d-53bf-95b3-11177825b1e3" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] -BinDeps = "0.8, 0.9, 1" +BinaryProvider = "0.5" CSDP_jll = "=6.2.0" Glob = "1.2" MathOptInterface = "0.9.5" diff --git a/deps/.deps.jl b/deps/.deps.jl deleted file mode 100644 index 3098bf7..0000000 --- a/deps/.deps.jl +++ /dev/null @@ -1,19 +0,0 @@ -# This is an auto-generated file; do not edit - -# Pre-hooks - -# Macro to load a library -macro checked_lib(libname, path) - path = string(path) - ((Base.Libdl.dlopen_e)(path) == C_NULL) && error("Unable to load \n\n$libname ($path)\n\nPlease re-run Pkg.build(package), and restart Julia.") - quote const $(esc(libname)) = $path end -end - -include("constants.jl") - -const csdp = dlpath - -info("Using $csdp") - -# Load-hooks - diff --git a/deps/build.jl b/deps/build.jl index 2d19c5f..29cf5e2 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -1,89 +1,48 @@ -using BinDeps -using LinearAlgebra, Libdl - -BinDeps.@setup - -blas = library_dependency("libblas", alias=["libblas.dll"]) -lapack = library_dependency("liblapack", alias=["liblapack.dll"]) - -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 - -include("constants.jl") -include("compile.jl") - -# @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] +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: +unsatisfied = any(!satisfied(p; verbose=verbose) 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 -depends = JULIA_LAPACK ? [] : [blas, lapack] -# 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 +# 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 -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 +# Write out a deps.jl file that will contain mappings for our products +write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) diff --git a/deps/clang.jl b/deps/clang.jl deleted file mode 100644 index 6d88ea8..0000000 --- a/deps/clang.jl +++ /dev/null @@ -1,54 +0,0 @@ -# Automated generation by c header files using Clang.jl -# See -# http://nbviewer.jupyter.org/github/ihnorton/Clang.jl/blob/master/examples/parsing_c_with_clangjl/notebook.ipynb -# -using Clang.wrap_c - -# add libclang to DL_LOAD_PATH -try - ENV["LLVM_CONFIG"] = readchomp(`which llvm-config-3.6`) -catch - try - ENV["LLVM_CONFIG"] = readchomp(`which llvm-config`) - catch - error("llvm-config not found") - end -end -push!(Libdl.DL_LOAD_PATH, readchomp(`$(ENV["LLVM_CONFIG"]) --libdir`)) - -include(joinpath(dirname(@__FILE__), "constants.jl")) -cd(joinpath(dirname(@__FILE__), "src", csdpversion)) - -wrap_c.cl_to_jl[Clang.cindex.Pointer] = :Ptr -header_naming = n -> joinpath(dirname(@__FILE__), "..", "src", "$(basename(n)).jl") -context = wrap_c.init(header_outputfile = header_naming, - header_library = "CSDP.csdp", - clang_diagnostics=true, - common_file = joinpath(dirname(@__FILE__), "..", "src", "blockmat.h.jl"), - clang_args = ["-DNOSHORTS"]) - # rewriter = s -> (println(s); s)) -context.options.wrap_structs = true -wrap_c.wrap_c_headers(context, ["include/blockmat.h", "include/declarations.h"]) - -function readchangewrite(f, fname) - content = read(fname, String) - open(fname, "w") do file - write(file, f(content)) - end -end - -readchangewrite(header_naming("blockmat.h")) do b - for (pat, subs) in [(r"^( begin enum)"m, s"#\1") - ,(r"^(nst NOSHORTS = 1)$"m, s"co\1") - #,(r"::Ptr", s"::Ref") - ,(r"\ntype "m, "\nimmutable ") - ] - b = replace(b, pat => subs) - end - b -end - -readchangewrite(header_naming("declarations.h")) do d - replace(d, r"\nfunction \w+_\(\)\n(.+?)\nend\n"sm => "") -end - diff --git a/deps/compile.jl b/deps/compile.jl deleted file mode 100644 index eeb682e..0000000 --- a/deps/compile.jl +++ /dev/null @@ -1,98 +0,0 @@ -import Glob - -const FORTRAN_FUNCTIONS = - [:dnrm2, :dasum, :ddot, :idamax, :dgemm, :dgemv, :dger, - :dtrsm, :dtrmv, :dpotrf, :dpotrs, :dpotri, :dtrtri] - -""" - find_obj([Makefile]) - -Parse the original Csdp `Makefile` and return all the object names -(without extension `.o`) for `libsdp`. -Remark: You cannot use the Makefile directly as it produces only a -static library. -""" -function find_obj(makefile_path=Makefile) - makefile = read(makefile_path, String) - m = match(r"libsdp\.a\:(.+)", makefile) - m != nothing || error("Could not find `libsdp.a` target in '$makefile_path'") - objs = collect(m.match for m in eachmatch(r"\w+\.o", m.captures[1])) - objs = String[splitext(o)[1] for o in [objs; basename(patchf)]] -end - - -""" - patch_int() - -Modify the files `lib/*.c` and the headers in `include/` to use `integer` -instead of `int`; the `printf` format `%d` is adapted, accordingly. -Notify that this happens *inplace*, i.e. without backup. -""" -function patch_int(; verbose::Bool = false) - let patchsrc = "$srcdir/$(basename(patchf))" - isfile(patchsrc) || cp(patchf, patchsrc) - end - if JULIA_LAPACK - @info "Patching int --> integer" - cfiles = [Glob.glob("*.c", srcdir); [joinpath(srcdir, "..", "include", "$d.h") - for d in ["declarations", - "blockmat", - "parameters"]]] - for cfile in cfiles - if verbose; println(cfile); end - content = read(cfile, String) - for (re,subst) in - [(r"int ([^(]+);", s"integer \1;"), - (r"int ", s"integer "), - (r"int \*", s"integer *"), - (r"integer mycompare", s"int mycompare"), - (r"\(int\)", s"(integer)"), - (r"%d", s"%ld"), - (r"%2d", s"%2ld"), - (r" int ", s" integer "), - (r"dsymv_", s"dsymv_64_")] - content = replace(content, re => subst) - end - open(cfile, "w") do io - print(io, content) - end - end - end -end - - -function compile_objs(JULIA_LAPACK=JULIA_LAPACK) - if JULIA_LAPACK - lapack = Libdl.dlpath(LinearAlgebra.LAPACK.liblapack) - lflag = replace(splitext(basename(lapack))[1], r"^lib" => "") - libs = ["-L$(dirname(lapack))", "-l$lflag"] - @info libs - if endswith(LinearAlgebra.LAPACK.liblapack, "64_") - push!(cflags, "-march=x86-64", "-m64", "-Dinteger=long") - for f in FORTRAN_FUNCTIONS - let ext=string(LinearAlgebra.BLAS.@blasfunc "") - push!(cflags, "-D$(f)_=$(f)_$ext") - end - end - @info cflags - end - else - libs = ["-l$l" for l in ["blas", "lapack"]] - @static if Sys.iswindows() unshift!(libs, "-L$libdir") end - end - - - @static if Sys.isunix() push!(cflags, "-fPIC") end - for o in find_obj() - @info "CC $o.c" - run(`$CC $cflags -o $builddir/$o.o -c $srcdir/$o.c`) - end - objs = ["$builddir/$o.o" for o in find_obj()] - cmd = `gcc -shared -o $dlpath $objs $libs` - try - run(cmd) - @info "LINK --> $dlpath" - catch - println(cmd) - end -end diff --git a/deps/constants.jl b/deps/constants.jl deleted file mode 100644 index 15b6f20..0000000 --- a/deps/constants.jl +++ /dev/null @@ -1,19 +0,0 @@ -# use Julia's libopenblas instead of system's liblapack and libblas? -const version = "6.2.0" -const libname = "libcsdp.$(Libdl.dlext)" -const csdpversion = "Csdp-readprob" -const download_url = - "https://github.com/blegat/Csdp/archive/readprob.zip" - -patchf = joinpath(dirname(@__FILE__), "src", "debug-mat.c") -srcdir = joinpath(dirname(@__FILE__), "src", csdpversion, "lib") -prefix = joinpath(dirname(@__FILE__), "usr") -builddir = joinpath(dirname(@__FILE__), "build") -cflags = ["-I$srcdir/../include", "-DNOSHORTS", "-g"] -libdir = joinpath(prefix, @static Sys.iswindows() ? "bin" : "lib/") -dlpath = joinpath(libdir, libname) -Makefile = joinpath(srcdir, "Makefile") -CC = get(ENV, "CCOMPILER", "gcc") - -"""Name of the current Git branch""" -git_branch() = chomp(read(`git rev-parse --abbrev-ref HEAD`, String)) diff --git a/deps/src/debug-mat.c b/deps/src/debug-mat.c deleted file mode 100644 index 15a12bc..0000000 --- a/deps/src/debug-mat.c +++ /dev/null @@ -1,122 +0,0 @@ -#include -#include "blockmat.h" - - -void printb(struct blockrec b) { - int i; - int size; - printf("blockrec:\n"); - printf(" blockcategory: %d\n", (int) b.blockcategory); - printf(" blocksize: %d\n", b.blocksize); - printf(" data.vec: %p\n", b.data.vec); - if (b.blocksize <= 16) { - switch (b.blockcategory) { - case MATRIX: - size = b.blocksize * b.blocksize; - for (i = 0; i < size; i++) - printf(" %f\n", b.data.vec[i]); - break; - case DIAG: - for (i = 1; i <= b.blocksize; i++) - printf(" %f\n", b.data.vec[i]); - break; - default: - fprintf(stderr, "UNKNOWN blockcat: %d", - (int) b.blockcategory); - } - } -} - - -void printb_(struct blockrec *b) { - printb(*b); -} - - -void print_sizeof() { - printf("sizeof(void*) %d\n", - (int) sizeof(void*)); - printf("sizeof(int) %d\n", - (int) sizeof(int)); - printf("sizeof(enum blockcat) %d\n", - (int) sizeof(enum blockcat)); - printf("sizeof(struct blockrec) %d\n", - (int) sizeof(struct blockrec)); - printf("sizeof(struct blockmatrix) %d\n", - (int) sizeof(struct blockmatrix)); - printf("sizeof(struct sparseblock) %d\n", - (int) sizeof(struct sparseblock)); -} - - - -void printm(struct blockmatrix A) { - int blk; - printf("A.nblocks = %d\n", A.nblocks); - printf("A.blocks = %p\n", A.blocks); - for (blk=1; blk <= A.nblocks; blk++) { - printf("block[%d]: %p\n", blk, &A.blocks[blk]); - printb(A.blocks[blk]); - } - -} - -FILE *fid; - -void print_sparse_block(struct sparseblock *b) { - int i; - fid = stdout; - fprintf(fid, "\n* Printing block: %p\n", b); - if (b == NULL) - return; - fprintf(fid, " next: %p\n", b->next); - fprintf(fid, " nextbyblock: %p\n", b->nextbyblock); - fprintf(fid, " constraintnum: %d\n", b->constraintnum); - fprintf(fid, " blocknum: %d\n", b->blocknum); - fprintf(fid, " blocksize: %d\n", b->blocksize); - fprintf(fid, " numentries: %d\n", b->numentries); - if (b->blocksize <= 30) { - for (i = 1; i <= b->numentries; i++) { - fprintf(fid, " block[%d, %d] = %f\n", - b->iindices[i], - b->jindices[i], - b->entries[i]); - } - } else { - fprintf(fid, " TOO LARGE\n"); - } - print_sparse_block(b->next); -} - -void print_constraints(int k, - struct constraintmatrix *constraints) -{ - int i, j; - fid = stdout; - struct sparseblock *p; - - fprintf(fid, "constraints == %p\n", constraints); - - for (i=1; i<=k; i++) - { - fprintf(fid, "\n\nprinting constraints[%d].blocks\n", i); - p=constraints[i].blocks; - while (p != NULL) - { - fprintf(fid, "p == %p\n\n", p); - print_sparse_block(p); - fprintf(fid, "\n"); - for (j=1; j<=p->numentries; j++) - { - fprintf(fid, "i=%d, j=%d\n", i, j); - fprintf(fid,"%d %d %d %d %f \n", - i, - p->blocknum, - p->iindices[j], - p->jindices[j], - p->entries[j]); - }; - p=p->next; - }; - }; -} diff --git a/deps/src/lapack.h b/deps/src/lapack.h deleted file mode 100644 index 95231d8..0000000 --- a/deps/src/lapack.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Copied from https://github.com/xianyi/OpenBLAS/blob/develop/common.h */ - -/* #if defined(OS_WINDOWS) && defined(__64BIT__) */ -/* typedef long long BLASLONG; */ -/* #else */ -/* typedef long BLASLONG; */ -/* #endif */ - -/* #if __WORDSIZE == 64 */ -/* typedef BLASLONG integer; */ -/* #else */ -/* typedef int integer; */ -/* #endif */ - -typedef double doublereal; diff --git a/deps/src/makefile b/deps/src/makefile deleted file mode 100644 index 8bd7f48..0000000 --- a/deps/src/makefile +++ /dev/null @@ -1,21 +0,0 @@ -csdp = Csdp-6.1.1 -libs = -lblas -llapack -build = ../build -CFLAGS = -DNOSHORTS -I$(csdp)/include -g - -CFLAGS64=-O3 -ansi -Wall -DNOSHORTS -DUSEGETTIME -I../include -Dinteger=long -fopenmp -g -m64 - -LIBS64OPENBLAS=-L../../../usr/lib/ -lcsdp.64 -lopenblas64_ -gfortran -lm - - -srcs = $(shell ls $(csdp)/lib/*.c) -objs = $(patsubst $(csdp)/lib/%.c,$(build)/%.o,$(srcs)) - -$(build)/%.o: $(csdp)/lib/%.c - $(CC) -c -fPIC $(CFLAGS) -o $@ $< - -../usr/lib/libcsdp.so: $(objs) - $(LD) -shared -o $@ $(libs) $^ - -libopenblas: - ln -s $(shell julia -e 'println(Libdl.dlpath(BLAS.libblas))') ../usr/lib/ diff --git a/deps/src/patch.py b/deps/src/patch.py deleted file mode 100755 index d81e7f1..0000000 --- a/deps/src/patch.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python -# Starting point https://github.com/llvm-mirror/clang/blob/master/bindings/python/examples/cindex/cindex-dump.py -# -# Needs clang module to be installed. -# - -from __future__ import print_function -import os -import re -import requests -import sys -import shutil - -try: - from clang.cindex import Index - from clang.cindex import CursorKind as C -except ImportError: - print("You need to install `clang`. In Python e.g.\n$ pip install 'libclang-py3'", - file=sys.stderr) - exit(1) - - -HEADER = "Csdp-6.1.1/include/declarations.h" -LAPACK_RE = "([di].+)_" - -def function_decl(header = HEADER): - """Return list of cursors to all function declarations in header""" - idx = Index.create() - tu = idx.parse(header) - return [c for c in tu.cursor.get_children() - if c.kind == C.FUNCTION_DECL] - - -def cblas_header(cblas_h = "cblas.h"): - """Return the cblas header as string (is downloaded if not found)""" - cblas_url = "https://raw.githubusercontent.com/xianyi/OpenBLAS/master/cblas.h" - if not os.path.exists(cblas_h): - r = requests.get(cblas_url) - assert r.status_code == 200 - with open(cblas_h, "wb") as io: - io.write(r.content) - return r.content - else: - return open(cblas_h).read() - -def clapack_header(clapack_h = "clapack.h"): - """Return the clapack header as string (is downloaded if not found)""" - clapack_url = "http://www.netlib.org/clapack/clapack.h" - if not os.path.exists(clapack_h): - r = requests.get(clapack_url) - assert r.status_code == 200 - with open(clapack_h, "wb") as io: - io.write(r.content) - return r.content - else: - return open(clapack_h).read() - - -def substr(s, c): - return s[c.extent.start.offset:c.extent.end.offset+1] - - -def patch(origin_header, out = sys.stdout): - cursors = function_decl(origin_header) - wrong = {c.spelling : c for c in cursors - if re.match(LAPACK_RE, c.spelling)} - fnames = [c.spelling for c in cursors - if re.match(LAPACK_RE, c.spelling)] - - clapack = clapack_header() - lapack_fs = function_decl("clapack.h") - correct = {c.spelling : c for c in lapack_fs if c.spelling in fnames} - - header = open(origin_header).read() - pos = 0 - for fn in fnames: - c = correct[fn] - w = wrong[fn] - a, b = w.extent.start.offset, w.extent.end.offset - repl = substr(clapack, c) - print(header[pos:a], file=out) - print(repl, file=out) - pos = b+1 - print(header[pos:], file=out) - - -if __name__ == "__main__": - header_backup = HEADER + ".bak.h" - header_new = HEADER + ".new" - if not os.path.exists(header_backup): - shutil.copy(HEADER, header_backup) - print("Creating backup " + header_backup) - with open(header_new, "w") as io: - patch(header_backup, io) - shutil.move(header_new, HEADER) diff --git a/deps/src/patch_lapack.jl b/deps/src/patch_lapack.jl deleted file mode 100644 index 16bea67..0000000 --- a/deps/src/patch_lapack.jl +++ /dev/null @@ -1,9 +0,0 @@ -using Clang - -const INCLUDE = "Csdp-6.1.1/include" - -idx = Clang.cindex.parse_header("$INCLUDE/declarations.h"; - diagnostics=true, - includes=[INCLUDE], - args=["-DNOSHORTS"]) -cursor = idx.data[1] diff --git a/src/CSDP.jl b/src/CSDP.jl index 9878c99..05f0fe5 100644 --- a/src/CSDP.jl +++ b/src/CSDP.jl @@ -11,9 +11,12 @@ if VERSION < v"1.3" end else import CSDP_jll: libcsdp - const CSDP_INT = Cint end +# This is the size of int used by the LAPACK library used by CSDP. +# If libcsdp is patched to use a 64-bit integer LAPACK, this should be replaced by `Clong`. +const CSDP_INT = Cint + export Blockmatrix include("blockdiag.jl") From 6f63905f480014b7d46324d91ae5ccc7b765a501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 13:30:09 +0200 Subject: [PATCH 04/21] Add OpenBLAS32 --- deps/build.jl | 50 +----------------- deps/build_CSDP.v6.2.0.jl | 53 +++++++++++++++++++ deps/build_OpenBLAS32.v0.3.9.jl | 94 +++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+), 48 deletions(-) create mode 100644 deps/build_CSDP.v6.2.0.jl create mode 100644 deps/build_OpenBLAS32.v0.3.9.jl diff --git a/deps/build.jl b/deps/build.jl index 29cf5e2..36a374a 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -1,48 +1,2 @@ -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: -unsatisfied = any(!satisfied(p; verbose=verbose) 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) -end - -# Write out a deps.jl file that will contain mappings for our products -write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) +include("build_OpenBLAS32.v0.3.9.jl") +include("build_CSDP.v6.2.0.jl") diff --git a/deps/build_CSDP.v6.2.0.jl b/deps/build_CSDP.v6.2.0.jl new file mode 100644 index 0000000..399ce2b --- /dev/null +++ b/deps/build_CSDP.v6.2.0.jl @@ -0,0 +1,53 @@ +# 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: +unsatisfied = any(!satisfied(p; verbose=verbose) 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) +end + +# Write out a deps.jl file that will contain mappings for our products +write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) diff --git a/deps/build_OpenBLAS32.v0.3.9.jl b/deps/build_OpenBLAS32.v0.3.9.jl new file mode 100644 index 0000000..52336a6 --- /dev/null +++ b/deps/build_OpenBLAS32.v0.3.9.jl @@ -0,0 +1,94 @@ +# Generated by running +# julia --color=yes generate_buildjl.jl O/OpenBLAS/OpenBLAS32@0.3.9/build_tarballs.jl JuliaBinaryWrappers/OpenBLAS32_jll.jl OpenBLAS32-v0.3.9+2 +# 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 +# Needed to add this as this method was not defined. +function BinaryProvider.CompilerABI(; libgfortran_version=nothing) + # See https://github.com/JuliaPackaging/BinaryProvider.jl/blob/332b58c898486c6cdf3c963164b1f66f9850d64b/src/PlatformNames.jl#L560-L564 + if libgfortran_version == v"3.0.0" + gcc = :gcc4 + elseif libgfortran_version == v"4.0.0" + gcc = :gcc7 + elseif libgfortran_version == v"5.0.0" + gcc = :gcc8 + else + error("Unrecognied libgfortran version $libgfortran_version.") + end + return CompilerABI(gcc) +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"))) +products = [ + LibraryProduct(prefix, ["libopenblas"], :libopenblas), +] + +# Download binaries from hosted location +bin_prefix = "https://github.com/JuliaBinaryWrappers/OpenBLAS32_jll.jl/releases/download/OpenBLAS32-v0.3.9+2" + +# Listing of files generated by BinaryBuilder: +download_info = Dict( + Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-gnu-libgfortran3.tar.gz", "70c72d420d3358c885f00ab57b48acbd1af76b3d575fd77071e36fbbaa00892e"), + Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-gnu-libgfortran4.tar.gz", "5046fbf88664004298b5033782365ec2481b012c08e501d81aa88f341b00d6d7"), + Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-gnu-libgfortran5.tar.gz", "ee396e4681f2582bb1af846399946bc877771e7703b51ded58d943eddac5efc6"), + Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-musl-libgfortran3.tar.gz", "b79b8c5b473885c7e4988d1a62b52e90d9f5034c8000b39e1b831a10ba753a5c"), + Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-musl-libgfortran4.tar.gz", "9931954d062b0dd603c6b4bb049672404726bdbd4969b22068400accbbd233a4"), + Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-musl-libgfortran5.tar.gz", "376f594def5d788f2d235b02f6f54fe7e9956e893ff3a0a42e12abb0ac1cff15"), + Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-gnueabihf-libgfortran3.tar.gz", "edd34511fe5876f47883eaec62bc2e7b220d9396c32c924e5496a6cbfb86a0ff"), + Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-gnueabihf-libgfortran4.tar.gz", "ad10a79218b8bc8ccdb442d640bc392d8c1d41a89d49de116819f022525d6cc5"), + Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-gnueabihf-libgfortran5.tar.gz", "04c5b704ae04c209d7c0f9506c29bf870760272096a7f106b4161a803fbbfcf6"), + Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-musleabihf-libgfortran3.tar.gz", "668f70e1b4b76feee0ee9d51f2b256dfd2d9a05f3c7936d6ed5e3bb16c6f91f6"), + Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-musleabihf-libgfortran4.tar.gz", "03b70ad1cb44c8530c66fbab8adfd6d1ca0b7c66f34a6b4cfe8c93c264c5f881"), + Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-musleabihf-libgfortran5.tar.gz", "24d3be8016ca46467d8a207334609c761bc6b7d3a07634ca81ddd2be52625a1b"), + Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-gnu-libgfortran3.tar.gz", "41ce6b10e963824d2cbbbbf31e02ba5edc4784d9ce8adf4edfd611042753b472"), + Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-gnu-libgfortran4.tar.gz", "4ba05d858cde46d35120295e2b0f549d666327b25f15892520dda94af3ce29b9"), + Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-gnu-libgfortran5.tar.gz", "1bd5dd9c01cb418d3c1b30b0d02826c7f193883e5a493b38728b81db52f318cb"), + Linux(:i686, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-musl-libgfortran3.tar.gz", "fa5ee765cea55afb5de007c4c9fe28db10c75f426a895f39f57363da3e248a71"), + Linux(:i686, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-musl-libgfortran4.tar.gz", "50db036850af08df7b241ab25f5e7f668fc0dbb7ac779b899693f386af21fac8"), + Linux(:i686, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-musl-libgfortran5.tar.gz", "e38be09ffa8a48010e395a8cf57d0e2348d8147a4724054962baf2750fabe6c9"), + Windows(:i686, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-w64-mingw32-libgfortran3.tar.gz", "7673c3c0eed1e48d0bb3771d73a9b192e95af78b134b68cb40cd69e533849a53"), + Windows(:i686, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-w64-mingw32-libgfortran4.tar.gz", "eb21686bbc2e880c5c0fe59da595816b427a023422810c2866ed826626763fa7"), + Windows(:i686, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-w64-mingw32-libgfortran5.tar.gz", "433ec40a8496efce9680bc6297efa510374f7e9038ef0eaacd314fd7133fa278"), + Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.powerpc64le-linux-gnu-libgfortran3.tar.gz", "772480f50a235b311a2d8e767339cca46665d0ee4aa39abf24f3ec4d4c261f5c"), + Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.powerpc64le-linux-gnu-libgfortran4.tar.gz", "ae3596cb668b02e7c82302c8e7b3e445260a32252b5d85fdc6bd7cddfc7783a0"), + Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.powerpc64le-linux-gnu-libgfortran5.tar.gz", "c94e277724c5ef483775cceac9f16b778c8c4a9a823353dbd4bfaffd137d7a58"), + MacOS(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-apple-darwin14-libgfortran3.tar.gz", "bb41f81ec7aae04a773c188fe9683bc6ad47af211e87f3ede1195ab83961f951"), + MacOS(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-apple-darwin14-libgfortran4.tar.gz", "99d88d0a7dc55bafe071c61a231fe36279f89317fef196954dbea80c566be96d"), + MacOS(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-apple-darwin14-libgfortran5.tar.gz", "56ee6d750897c91f29d701ead5b2f44a2a12a72d5c1eb9b09dc2c0eb3b65d1d1"), + Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-gnu-libgfortran3.tar.gz", "13861d28a1832ce0d5f1b8ecb84de2f19d7970ab9188d07da6da209ac4c4e5d0"), + Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-gnu-libgfortran4.tar.gz", "e2786ab3c111e3cb33f4e4eda50de5ea536aea99edcc952e7d6a87c82b802c36"), + Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-gnu-libgfortran5.tar.gz", "639b8f40d0c8f9177574b413b9e475eb9045abe2e82078c5a4dde4efbfe39a07"), + Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-musl-libgfortran3.tar.gz", "0bba4279e2e524a6504c16b7cc4266621ba09f62880b6847e291955c90ec5c6c"), + Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-musl-libgfortran4.tar.gz", "cfcc99aa3a9124e54225e01299e86e8b7599b0de75835db12d88e643cd1ef83a"), + Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-musl-libgfortran5.tar.gz", "a9dd680a5bcefad112d03993a35d6de434baafc055a71e2f4961d5f8177b983b"), + FreeBSD(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-unknown-freebsd11.1-libgfortran3.tar.gz", "9c877be5d99c2fb5d479e72c5945d076994b720431e11bfc1426ff69c9147183"), + FreeBSD(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-unknown-freebsd11.1-libgfortran4.tar.gz", "90bb169c6fc582243eabf6f2849d3fb53b0b7e17a3e39f4693c004a4f3249f4c"), + FreeBSD(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-unknown-freebsd11.1-libgfortran5.tar.gz", "0e7c2f8125cda30d1e6cae556caea06a7db3b98479119b361826f5973316632f"), + Windows(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-w64-mingw32-libgfortran3.tar.gz", "21949a80fde51fda975a423c893843c7b94557f9286bb73ba079792e33be3c8d"), + Windows(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-w64-mingw32-libgfortran4.tar.gz", "417fe312177ed42a6a95cf4b5bfd39aa202199ca1e210d9a5bd25b622f511944"), + Windows(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-w64-mingw32-libgfortran5.tar.gz", "b945a95923389da1ec7efd76bbfa1337ac525a37581053dc6aed0cf113c5a1d7"), +) + +# Install unsatisfied or updated dependencies: +unsatisfied = any(!satisfied(p; verbose=verbose) 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) +end + +# Write out a deps.jl file that will contain mappings for our products +write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) From c2161714f86326077fbb8bff21f9e80cf573e0c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 18:30:31 +0200 Subject: [PATCH 05/21] Updating build.jl similarly to FFMPEG and Cairo --- deps/build.jl | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/deps/build.jl b/deps/build.jl index 36a374a..959ecc7 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -1,2 +1,27 @@ -include("build_OpenBLAS32.v0.3.9.jl") -include("build_CSDP.v6.2.0.jl") +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) +] + + +dependencies = [ + "build_OpenBLAS32.v0.3.9.jl", + "build_CSDP.v6.2.0.jl" +] + +for dependency in dependencies + # it's a bit faster to run the build in an anonymous module instead of + # starting a new julia process + + # Build the dependencies + Mod = @eval module Anon end + Mod.include(dependency) +end + +# Finally, write out a deps.jl file +write_deps_file(joinpath(@__DIR__, "deps.jl"), products) From e81dd660e227b0608415b9b8609ed9865d8f06cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 18:30:45 +0200 Subject: [PATCH 06/21] CompilerABI -> _CompilerABI --- deps/build_OpenBLAS32.v0.3.9.jl | 84 ++++++++++++++++----------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/deps/build_OpenBLAS32.v0.3.9.jl b/deps/build_OpenBLAS32.v0.3.9.jl index 52336a6..3e33390 100644 --- a/deps/build_OpenBLAS32.v0.3.9.jl +++ b/deps/build_OpenBLAS32.v0.3.9.jl @@ -3,9 +3,8 @@ # 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 -# Needed to add this as this method was not defined. -function BinaryProvider.CompilerABI(; libgfortran_version=nothing) +# Renamed `CompilerABI` into `_CompilerABI` and added this as this method was not defined. +function _CompilerABI(; libgfortran_version=nothing) # See https://github.com/JuliaPackaging/BinaryProvider.jl/blob/332b58c898486c6cdf3c963164b1f66f9850d64b/src/PlatformNames.jl#L560-L564 if libgfortran_version == v"3.0.0" gcc = :gcc4 @@ -19,6 +18,7 @@ function BinaryProvider.CompilerABI(; libgfortran_version=nothing) return CompilerABI(gcc) end +using BinaryProvider # requires BinaryProvider 0.3.0 or later # Parse some basic command-line arguments const verbose = "--verbose" in ARGS @@ -32,45 +32,45 @@ bin_prefix = "https://github.com/JuliaBinaryWrappers/OpenBLAS32_jll.jl/releases/ # Listing of files generated by BinaryBuilder: download_info = Dict( - Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-gnu-libgfortran3.tar.gz", "70c72d420d3358c885f00ab57b48acbd1af76b3d575fd77071e36fbbaa00892e"), - Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-gnu-libgfortran4.tar.gz", "5046fbf88664004298b5033782365ec2481b012c08e501d81aa88f341b00d6d7"), - Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-gnu-libgfortran5.tar.gz", "ee396e4681f2582bb1af846399946bc877771e7703b51ded58d943eddac5efc6"), - Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-musl-libgfortran3.tar.gz", "b79b8c5b473885c7e4988d1a62b52e90d9f5034c8000b39e1b831a10ba753a5c"), - Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-musl-libgfortran4.tar.gz", "9931954d062b0dd603c6b4bb049672404726bdbd4969b22068400accbbd233a4"), - Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-musl-libgfortran5.tar.gz", "376f594def5d788f2d235b02f6f54fe7e9956e893ff3a0a42e12abb0ac1cff15"), - Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-gnueabihf-libgfortran3.tar.gz", "edd34511fe5876f47883eaec62bc2e7b220d9396c32c924e5496a6cbfb86a0ff"), - Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-gnueabihf-libgfortran4.tar.gz", "ad10a79218b8bc8ccdb442d640bc392d8c1d41a89d49de116819f022525d6cc5"), - Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-gnueabihf-libgfortran5.tar.gz", "04c5b704ae04c209d7c0f9506c29bf870760272096a7f106b4161a803fbbfcf6"), - Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-musleabihf-libgfortran3.tar.gz", "668f70e1b4b76feee0ee9d51f2b256dfd2d9a05f3c7936d6ed5e3bb16c6f91f6"), - Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-musleabihf-libgfortran4.tar.gz", "03b70ad1cb44c8530c66fbab8adfd6d1ca0b7c66f34a6b4cfe8c93c264c5f881"), - Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-musleabihf-libgfortran5.tar.gz", "24d3be8016ca46467d8a207334609c761bc6b7d3a07634ca81ddd2be52625a1b"), - Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-gnu-libgfortran3.tar.gz", "41ce6b10e963824d2cbbbbf31e02ba5edc4784d9ce8adf4edfd611042753b472"), - Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-gnu-libgfortran4.tar.gz", "4ba05d858cde46d35120295e2b0f549d666327b25f15892520dda94af3ce29b9"), - Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-gnu-libgfortran5.tar.gz", "1bd5dd9c01cb418d3c1b30b0d02826c7f193883e5a493b38728b81db52f318cb"), - Linux(:i686, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-musl-libgfortran3.tar.gz", "fa5ee765cea55afb5de007c4c9fe28db10c75f426a895f39f57363da3e248a71"), - Linux(:i686, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-musl-libgfortran4.tar.gz", "50db036850af08df7b241ab25f5e7f668fc0dbb7ac779b899693f386af21fac8"), - Linux(:i686, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-musl-libgfortran5.tar.gz", "e38be09ffa8a48010e395a8cf57d0e2348d8147a4724054962baf2750fabe6c9"), - Windows(:i686, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-w64-mingw32-libgfortran3.tar.gz", "7673c3c0eed1e48d0bb3771d73a9b192e95af78b134b68cb40cd69e533849a53"), - Windows(:i686, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-w64-mingw32-libgfortran4.tar.gz", "eb21686bbc2e880c5c0fe59da595816b427a023422810c2866ed826626763fa7"), - Windows(:i686, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-w64-mingw32-libgfortran5.tar.gz", "433ec40a8496efce9680bc6297efa510374f7e9038ef0eaacd314fd7133fa278"), - Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.powerpc64le-linux-gnu-libgfortran3.tar.gz", "772480f50a235b311a2d8e767339cca46665d0ee4aa39abf24f3ec4d4c261f5c"), - Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.powerpc64le-linux-gnu-libgfortran4.tar.gz", "ae3596cb668b02e7c82302c8e7b3e445260a32252b5d85fdc6bd7cddfc7783a0"), - Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.powerpc64le-linux-gnu-libgfortran5.tar.gz", "c94e277724c5ef483775cceac9f16b778c8c4a9a823353dbd4bfaffd137d7a58"), - MacOS(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-apple-darwin14-libgfortran3.tar.gz", "bb41f81ec7aae04a773c188fe9683bc6ad47af211e87f3ede1195ab83961f951"), - MacOS(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-apple-darwin14-libgfortran4.tar.gz", "99d88d0a7dc55bafe071c61a231fe36279f89317fef196954dbea80c566be96d"), - MacOS(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-apple-darwin14-libgfortran5.tar.gz", "56ee6d750897c91f29d701ead5b2f44a2a12a72d5c1eb9b09dc2c0eb3b65d1d1"), - Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-gnu-libgfortran3.tar.gz", "13861d28a1832ce0d5f1b8ecb84de2f19d7970ab9188d07da6da209ac4c4e5d0"), - Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-gnu-libgfortran4.tar.gz", "e2786ab3c111e3cb33f4e4eda50de5ea536aea99edcc952e7d6a87c82b802c36"), - Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-gnu-libgfortran5.tar.gz", "639b8f40d0c8f9177574b413b9e475eb9045abe2e82078c5a4dde4efbfe39a07"), - Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-musl-libgfortran3.tar.gz", "0bba4279e2e524a6504c16b7cc4266621ba09f62880b6847e291955c90ec5c6c"), - Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-musl-libgfortran4.tar.gz", "cfcc99aa3a9124e54225e01299e86e8b7599b0de75835db12d88e643cd1ef83a"), - Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-musl-libgfortran5.tar.gz", "a9dd680a5bcefad112d03993a35d6de434baafc055a71e2f4961d5f8177b983b"), - FreeBSD(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-unknown-freebsd11.1-libgfortran3.tar.gz", "9c877be5d99c2fb5d479e72c5945d076994b720431e11bfc1426ff69c9147183"), - FreeBSD(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-unknown-freebsd11.1-libgfortran4.tar.gz", "90bb169c6fc582243eabf6f2849d3fb53b0b7e17a3e39f4693c004a4f3249f4c"), - FreeBSD(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-unknown-freebsd11.1-libgfortran5.tar.gz", "0e7c2f8125cda30d1e6cae556caea06a7db3b98479119b361826f5973316632f"), - Windows(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-w64-mingw32-libgfortran3.tar.gz", "21949a80fde51fda975a423c893843c7b94557f9286bb73ba079792e33be3c8d"), - Windows(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-w64-mingw32-libgfortran4.tar.gz", "417fe312177ed42a6a95cf4b5bfd39aa202199ca1e210d9a5bd25b622f511944"), - Windows(:x86_64, compiler_abi=CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-w64-mingw32-libgfortran5.tar.gz", "b945a95923389da1ec7efd76bbfa1337ac525a37581053dc6aed0cf113c5a1d7"), + Linux(:aarch64, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-gnu-libgfortran3.tar.gz", "70c72d420d3358c885f00ab57b48acbd1af76b3d575fd77071e36fbbaa00892e"), + Linux(:aarch64, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-gnu-libgfortran4.tar.gz", "5046fbf88664004298b5033782365ec2481b012c08e501d81aa88f341b00d6d7"), + Linux(:aarch64, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-gnu-libgfortran5.tar.gz", "ee396e4681f2582bb1af846399946bc877771e7703b51ded58d943eddac5efc6"), + Linux(:aarch64, libc=:musl, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-musl-libgfortran3.tar.gz", "b79b8c5b473885c7e4988d1a62b52e90d9f5034c8000b39e1b831a10ba753a5c"), + Linux(:aarch64, libc=:musl, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-musl-libgfortran4.tar.gz", "9931954d062b0dd603c6b4bb049672404726bdbd4969b22068400accbbd233a4"), + Linux(:aarch64, libc=:musl, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.aarch64-linux-musl-libgfortran5.tar.gz", "376f594def5d788f2d235b02f6f54fe7e9956e893ff3a0a42e12abb0ac1cff15"), + Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-gnueabihf-libgfortran3.tar.gz", "edd34511fe5876f47883eaec62bc2e7b220d9396c32c924e5496a6cbfb86a0ff"), + Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-gnueabihf-libgfortran4.tar.gz", "ad10a79218b8bc8ccdb442d640bc392d8c1d41a89d49de116819f022525d6cc5"), + Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-gnueabihf-libgfortran5.tar.gz", "04c5b704ae04c209d7c0f9506c29bf870760272096a7f106b4161a803fbbfcf6"), + Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-musleabihf-libgfortran3.tar.gz", "668f70e1b4b76feee0ee9d51f2b256dfd2d9a05f3c7936d6ed5e3bb16c6f91f6"), + Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-musleabihf-libgfortran4.tar.gz", "03b70ad1cb44c8530c66fbab8adfd6d1ca0b7c66f34a6b4cfe8c93c264c5f881"), + Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.armv7l-linux-musleabihf-libgfortran5.tar.gz", "24d3be8016ca46467d8a207334609c761bc6b7d3a07634ca81ddd2be52625a1b"), + Linux(:i686, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-gnu-libgfortran3.tar.gz", "41ce6b10e963824d2cbbbbf31e02ba5edc4784d9ce8adf4edfd611042753b472"), + Linux(:i686, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-gnu-libgfortran4.tar.gz", "4ba05d858cde46d35120295e2b0f549d666327b25f15892520dda94af3ce29b9"), + Linux(:i686, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-gnu-libgfortran5.tar.gz", "1bd5dd9c01cb418d3c1b30b0d02826c7f193883e5a493b38728b81db52f318cb"), + Linux(:i686, libc=:musl, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-musl-libgfortran3.tar.gz", "fa5ee765cea55afb5de007c4c9fe28db10c75f426a895f39f57363da3e248a71"), + Linux(:i686, libc=:musl, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-musl-libgfortran4.tar.gz", "50db036850af08df7b241ab25f5e7f668fc0dbb7ac779b899693f386af21fac8"), + Linux(:i686, libc=:musl, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-linux-musl-libgfortran5.tar.gz", "e38be09ffa8a48010e395a8cf57d0e2348d8147a4724054962baf2750fabe6c9"), + Windows(:i686, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-w64-mingw32-libgfortran3.tar.gz", "7673c3c0eed1e48d0bb3771d73a9b192e95af78b134b68cb40cd69e533849a53"), + Windows(:i686, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-w64-mingw32-libgfortran4.tar.gz", "eb21686bbc2e880c5c0fe59da595816b427a023422810c2866ed826626763fa7"), + Windows(:i686, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.i686-w64-mingw32-libgfortran5.tar.gz", "433ec40a8496efce9680bc6297efa510374f7e9038ef0eaacd314fd7133fa278"), + Linux(:powerpc64le, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.powerpc64le-linux-gnu-libgfortran3.tar.gz", "772480f50a235b311a2d8e767339cca46665d0ee4aa39abf24f3ec4d4c261f5c"), + Linux(:powerpc64le, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.powerpc64le-linux-gnu-libgfortran4.tar.gz", "ae3596cb668b02e7c82302c8e7b3e445260a32252b5d85fdc6bd7cddfc7783a0"), + Linux(:powerpc64le, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.powerpc64le-linux-gnu-libgfortran5.tar.gz", "c94e277724c5ef483775cceac9f16b778c8c4a9a823353dbd4bfaffd137d7a58"), + MacOS(:x86_64, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-apple-darwin14-libgfortran3.tar.gz", "bb41f81ec7aae04a773c188fe9683bc6ad47af211e87f3ede1195ab83961f951"), + MacOS(:x86_64, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-apple-darwin14-libgfortran4.tar.gz", "99d88d0a7dc55bafe071c61a231fe36279f89317fef196954dbea80c566be96d"), + MacOS(:x86_64, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-apple-darwin14-libgfortran5.tar.gz", "56ee6d750897c91f29d701ead5b2f44a2a12a72d5c1eb9b09dc2c0eb3b65d1d1"), + Linux(:x86_64, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-gnu-libgfortran3.tar.gz", "13861d28a1832ce0d5f1b8ecb84de2f19d7970ab9188d07da6da209ac4c4e5d0"), + Linux(:x86_64, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-gnu-libgfortran4.tar.gz", "e2786ab3c111e3cb33f4e4eda50de5ea536aea99edcc952e7d6a87c82b802c36"), + Linux(:x86_64, libc=:glibc, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-gnu-libgfortran5.tar.gz", "639b8f40d0c8f9177574b413b9e475eb9045abe2e82078c5a4dde4efbfe39a07"), + Linux(:x86_64, libc=:musl, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-musl-libgfortran3.tar.gz", "0bba4279e2e524a6504c16b7cc4266621ba09f62880b6847e291955c90ec5c6c"), + Linux(:x86_64, libc=:musl, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-musl-libgfortran4.tar.gz", "cfcc99aa3a9124e54225e01299e86e8b7599b0de75835db12d88e643cd1ef83a"), + Linux(:x86_64, libc=:musl, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-linux-musl-libgfortran5.tar.gz", "a9dd680a5bcefad112d03993a35d6de434baafc055a71e2f4961d5f8177b983b"), + FreeBSD(:x86_64, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-unknown-freebsd11.1-libgfortran3.tar.gz", "9c877be5d99c2fb5d479e72c5945d076994b720431e11bfc1426ff69c9147183"), + FreeBSD(:x86_64, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-unknown-freebsd11.1-libgfortran4.tar.gz", "90bb169c6fc582243eabf6f2849d3fb53b0b7e17a3e39f4693c004a4f3249f4c"), + FreeBSD(:x86_64, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-unknown-freebsd11.1-libgfortran5.tar.gz", "0e7c2f8125cda30d1e6cae556caea06a7db3b98479119b361826f5973316632f"), + Windows(:x86_64, compiler_abi=_CompilerABI(libgfortran_version=v"3.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-w64-mingw32-libgfortran3.tar.gz", "21949a80fde51fda975a423c893843c7b94557f9286bb73ba079792e33be3c8d"), + Windows(:x86_64, compiler_abi=_CompilerABI(libgfortran_version=v"4.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-w64-mingw32-libgfortran4.tar.gz", "417fe312177ed42a6a95cf4b5bfd39aa202199ca1e210d9a5bd25b622f511944"), + Windows(:x86_64, compiler_abi=_CompilerABI(libgfortran_version=v"5.0.0")) => ("$bin_prefix/OpenBLAS32.v0.3.9.x86_64-w64-mingw32-libgfortran5.tar.gz", "b945a95923389da1ec7efd76bbfa1337ac525a37581053dc6aed0cf113c5a1d7"), ) # Install unsatisfied or updated dependencies: From 3537a6202ed1a1aa621f3f2829a0849d1504a366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 20:12:19 +0200 Subject: [PATCH 07/21] Use MySQL as example instead --- deps/build.jl | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/deps/build.jl b/deps/build.jl index 959ecc7..d63dd19 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -1,3 +1,9 @@ +# Inspired from https://github.com/JuliaDatabases/MySQL.jl/blob/36eaf2bfbbdd9a27c408d0b2a734fff0d81b63ad/deps/build.jl +module Anon1 end +module Anon2 end + +@static if VERSION < v"1.3.0" + using BinaryProvider # requires BinaryProvider 0.3.0 or later # Parse some basic command-line arguments @@ -8,20 +14,10 @@ products = [ LibraryProduct(prefix, ["libcsdp"], :libcsdp) ] - -dependencies = [ - "build_OpenBLAS32.v0.3.9.jl", - "build_CSDP.v6.2.0.jl" -] - -for dependency in dependencies - # it's a bit faster to run the build in an anonymous module instead of - # starting a new julia process - - # Build the dependencies - Mod = @eval module Anon end - Mod.include(dependency) -end +Anon1.include("build_OpenBLAS32.v0.3.9.jl") +Anon2.include("build_CSDP.v6.2.0.jl") # Finally, write out a deps.jl file write_deps_file(joinpath(@__DIR__, "deps.jl"), products) + +end # VERSION From 83b26b555235881225a9479b1ddaf14113b79d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 20:38:58 +0200 Subject: [PATCH 08/21] 1 -> 1.0 in appveyor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Mosè Giordano --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 5d19d0b..6bc06c9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ environment: matrix: - - julia_version: 1 + - julia_version: 1.0 - julia_version: 1.4 platform: From 45ba1ecede81dc648f2f3c0bf638c95e1d55d765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 21:39:37 +0200 Subject: [PATCH 09/21] Add `ignore_platform` for OpenBLAS32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Mosè Giordano --- deps/build_OpenBLAS32.v0.3.9.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/build_OpenBLAS32.v0.3.9.jl b/deps/build_OpenBLAS32.v0.3.9.jl index 3e33390..e6b4664 100644 --- a/deps/build_OpenBLAS32.v0.3.9.jl +++ b/deps/build_OpenBLAS32.v0.3.9.jl @@ -87,7 +87,7 @@ end # 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) + install(dl_info...; prefix=prefix, force=true, verbose=verbose, ignore_platform=true) end # Write out a deps.jl file that will contain mappings for our products From cca42dd0a042e702bf8fd04ce1ce29db90d95674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 21:40:08 +0200 Subject: [PATCH 10/21] Add `ignore_platform` for CSDP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Mosè Giordano --- deps/build_CSDP.v6.2.0.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/build_CSDP.v6.2.0.jl b/deps/build_CSDP.v6.2.0.jl index 399ce2b..daabff5 100644 --- a/deps/build_CSDP.v6.2.0.jl +++ b/deps/build_CSDP.v6.2.0.jl @@ -46,7 +46,7 @@ end # 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) + install(dl_info...; prefix=prefix, force=true, verbose=verbose, ignore_platform=true) end # Write out a deps.jl file that will contain mappings for our products From 76293d5ae8488b3d69c6103a18ed279672a8da78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 21:40:27 +0200 Subject: [PATCH 11/21] Update deps/build_CSDP.v6.2.0.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Mosè Giordano --- deps/build_CSDP.v6.2.0.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/build_CSDP.v6.2.0.jl b/deps/build_CSDP.v6.2.0.jl index daabff5..a6db705 100644 --- a/deps/build_CSDP.v6.2.0.jl +++ b/deps/build_CSDP.v6.2.0.jl @@ -33,7 +33,7 @@ download_info = Dict( ) # Install unsatisfied or updated dependencies: -unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) +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. From 9febccb056cb95769d37409ad265e68216c009a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 21:40:38 +0200 Subject: [PATCH 12/21] Update deps/build_OpenBLAS32.v0.3.9.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Mosè Giordano --- deps/build_OpenBLAS32.v0.3.9.jl | 3 --- 1 file changed, 3 deletions(-) diff --git a/deps/build_OpenBLAS32.v0.3.9.jl b/deps/build_OpenBLAS32.v0.3.9.jl index e6b4664..539317a 100644 --- a/deps/build_OpenBLAS32.v0.3.9.jl +++ b/deps/build_OpenBLAS32.v0.3.9.jl @@ -89,6 +89,3 @@ if unsatisfied || !isinstalled(dl_info...; prefix=prefix) # Download and install binaries install(dl_info...; prefix=prefix, force=true, verbose=verbose, ignore_platform=true) end - -# Write out a deps.jl file that will contain mappings for our products -write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) From 4cdb52d5cdef59f8b36b4edda5288d7467eda4ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 21:40:48 +0200 Subject: [PATCH 13/21] Update deps/build_OpenBLAS32.v0.3.9.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Mosè Giordano --- deps/build_OpenBLAS32.v0.3.9.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/build_OpenBLAS32.v0.3.9.jl b/deps/build_OpenBLAS32.v0.3.9.jl index 539317a..4103b62 100644 --- a/deps/build_OpenBLAS32.v0.3.9.jl +++ b/deps/build_OpenBLAS32.v0.3.9.jl @@ -74,7 +74,7 @@ download_info = Dict( ) # Install unsatisfied or updated dependencies: -unsatisfied = any(!satisfied(p; verbose=verbose) for p in products) +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. From 7a6bb7e7e3c9e36d8f31dc0e3c0a55239bba2cd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 21:40:58 +0200 Subject: [PATCH 14/21] Update deps/build_CSDP.v6.2.0.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Mosè Giordano --- deps/build_CSDP.v6.2.0.jl | 3 --- 1 file changed, 3 deletions(-) diff --git a/deps/build_CSDP.v6.2.0.jl b/deps/build_CSDP.v6.2.0.jl index a6db705..d84c87e 100644 --- a/deps/build_CSDP.v6.2.0.jl +++ b/deps/build_CSDP.v6.2.0.jl @@ -48,6 +48,3 @@ if unsatisfied || !isinstalled(dl_info...; prefix=prefix) # Download and install binaries install(dl_info...; prefix=prefix, force=true, verbose=verbose, ignore_platform=true) end - -# Write out a deps.jl file that will contain mappings for our products -write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) From 9236f13870546e9ebd14ee7e3c69aee97bb864e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 18 Apr 2020 23:43:34 +0200 Subject: [PATCH 15/21] Remove JULIA_LAPACK env var on Travis --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a75820d..73c6060 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,10 +11,6 @@ matrix: allow_failures: - julia: nightly -env: - - CSDP_USE_JULIA_LAPACK=true - - CSDP_USE_JULIA_LAPACK=false - addons: apt: # apt-get for linux packages: From 1e18ea0bd8e169b1855da29cb7159e254ba51b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sun, 19 Apr 2020 09:56:31 +0200 Subject: [PATCH 16/21] Use the unreleased BP v0.5.9 on travis --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 73c6060..a70c521 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,9 @@ addons: - liblapack-dev - libblas-dev +before_script: + - julia -e 'using Pkg; Pkg.add(PackageSpec(name="BinaryProvider", rev="mg/fix-write-deps-isolation"))' + notifications: email: false after_success: From 0d7905428cc12c06476e700da6e08f345260ce5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sun, 19 Apr 2020 10:06:32 +0200 Subject: [PATCH 17/21] Add comments on why is used --- deps/build_CSDP.v6.2.0.jl | 2 ++ deps/build_OpenBLAS32.v0.3.9.jl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/deps/build_CSDP.v6.2.0.jl b/deps/build_CSDP.v6.2.0.jl index d84c87e..5fd4954 100644 --- a/deps/build_CSDP.v6.2.0.jl +++ b/deps/build_CSDP.v6.2.0.jl @@ -33,6 +33,8 @@ download_info = Dict( ) # 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 diff --git a/deps/build_OpenBLAS32.v0.3.9.jl b/deps/build_OpenBLAS32.v0.3.9.jl index 4103b62..afcc2a7 100644 --- a/deps/build_OpenBLAS32.v0.3.9.jl +++ b/deps/build_OpenBLAS32.v0.3.9.jl @@ -74,6 +74,8 @@ download_info = Dict( ) # 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 From 7906dca7806aaf4cec0a8a978c73f08cf688a13e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sun, 19 Apr 2020 10:08:27 +0200 Subject: [PATCH 18/21] Add verbose=true to debug Mac OS --- deps/build.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/build.jl b/deps/build.jl index d63dd19..9ae502b 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -18,6 +18,6 @@ Anon1.include("build_OpenBLAS32.v0.3.9.jl") Anon2.include("build_CSDP.v6.2.0.jl") # Finally, write out a deps.jl file -write_deps_file(joinpath(@__DIR__, "deps.jl"), products) +write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=true) end # VERSION From 331f9939d6c12e89e05ce35d1861edf504ef2393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sun, 19 Apr 2020 11:24:49 +0200 Subject: [PATCH 19/21] Add CompilerSupportLibraries --- deps/build.jl | 6 +- deps/build_CompilerSupportLibraries.v0.3.3.jl | 82 +++++++++++++++++++ 2 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 deps/build_CompilerSupportLibraries.v0.3.3.jl diff --git a/deps/build.jl b/deps/build.jl index 9ae502b..6b04804 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -1,6 +1,7 @@ # Inspired from https://github.com/JuliaDatabases/MySQL.jl/blob/36eaf2bfbbdd9a27c408d0b2a734fff0d81b63ad/deps/build.jl module Anon1 end module Anon2 end +module Anon3 end @static if VERSION < v"1.3.0" @@ -14,8 +15,9 @@ products = [ LibraryProduct(prefix, ["libcsdp"], :libcsdp) ] -Anon1.include("build_OpenBLAS32.v0.3.9.jl") -Anon2.include("build_CSDP.v6.2.0.jl") +Anon1.include("build_CompilerSupportLibraries.v0.3.3.jl") +Anon2.include("build_OpenBLAS32.v0.3.9.jl") +Anon3.include("build_CSDP.v6.2.0.jl") # Finally, write out a deps.jl file write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=true) diff --git a/deps/build_CompilerSupportLibraries.v0.3.3.jl b/deps/build_CompilerSupportLibraries.v0.3.3.jl new file mode 100644 index 0000000..e9e4916 --- /dev/null +++ b/deps/build_CompilerSupportLibraries.v0.3.3.jl @@ -0,0 +1,82 @@ +# Generated by running +# julia --color=yes generate_buildjl.jl C/CompilerSupportLibraries/build_tarballs.jl JuliaBinaryWrappers/CompilerSupportLibraries_jll.jl CompilerSupportLibraries-v0.3.3+0 +# 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 +# and commenting out `build_info = autobuild(...)`, `tarball_path, ...` and replace `sources = ...` by `sources = nothing`. +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, ["libgcc_s", "libgcc_s_sjlj", "libgcc_s_seh"], :libgcc_s), + LibraryProduct(prefix, ["libstdc++"], :libstdcxx), + LibraryProduct(prefix, ["libgfortran"], :libgfortran), + LibraryProduct(prefix, ["libgomp"], :libgomp), +] + +# Download binaries from hosted location +bin_prefix = "https://github.com/JuliaBinaryWrappers/CompilerSupportLibraries_jll.jl/releases/download/CompilerSupportLibraries-v0.3.3+0" + +# Listing of files generated by BinaryBuilder: +download_info = Dict( + Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.aarch64-linux-gnu-libgfortran3.tar.gz", "17132bd0c2f2c6d8426a601b57de2c4e670da64076ab7ab0f311dc3c39ed421c"), + Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.aarch64-linux-gnu-libgfortran4.tar.gz", "c6fa95bb0873c23084bfb7e154ef546b21488777e2d352e5acf38d8e9800c14d"), + Linux(:aarch64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.aarch64-linux-gnu-libgfortran5.tar.gz", "a3b98e7b24c580f5120ac2344d19c4884c93b17271fb296fa0b97fc562de7f2d"), + Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.aarch64-linux-musl-libgfortran3.tar.gz", "ee0b1e57302709cf159573ec23017fec797af6b0dae7dbd2ea0904e67b4e0343"), + Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.aarch64-linux-musl-libgfortran4.tar.gz", "b5fb9e89ed28eb3aa31397a165e583d6e860e54e24bd9af7474670335e2b2d57"), + Linux(:aarch64, libc=:musl, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.aarch64-linux-musl-libgfortran5.tar.gz", "85cd3c8ad611c8949f7cd0fd01444650358144f576e69fa20d58e9f29f781695"), + Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.armv7l-linux-gnueabihf-libgfortran3.tar.gz", "6964b730d3764a82252fe6144d0e9103d0d9a409027c44de224afc8f05782733"), + Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.armv7l-linux-gnueabihf-libgfortran4.tar.gz", "6b76ac45d465413bf6bc6b45cda8f1f528ce212979d94887b80d9b975e116696"), + Linux(:armv7l, libc=:glibc, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.armv7l-linux-gnueabihf-libgfortran5.tar.gz", "e5c9854d8191f2fabe81ef1fb7974ce4c4e9261c790ec21e225fbdc57ccf3bf0"), + Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.armv7l-linux-musleabihf-libgfortran3.tar.gz", "ead80d5f2f8ed45598fd8331da07dc3e430e42b8129d982e1209c6dc392c4595"), + Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.armv7l-linux-musleabihf-libgfortran4.tar.gz", "713f7de6f6b79869c4818b861d9877d008ef0f9bc287a88fb6c80c5757a5f80d"), + Linux(:armv7l, libc=:musl, call_abi=:eabihf, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.armv7l-linux-musleabihf-libgfortran5.tar.gz", "7fcd1b6a46cf1bb89602b3ad64dc546c251ca628197a9ab3d23d2ef460f39709"), + Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.i686-linux-gnu-libgfortran3.tar.gz", "39f8673f0fb61a1d2c9bb3e847a0e7275bf56ad3a9f41e2c85063c1d9c4c9d5e"), + Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.i686-linux-gnu-libgfortran4.tar.gz", "aafe4c28b74eb3fe57e861a814bec3bf7d5d0d1ec252f558a34fd95ea3fedac8"), + Linux(:i686, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.i686-linux-gnu-libgfortran5.tar.gz", "55abe3b785c179e86430616ad6309c0bde47d32517f468f064c5c69a1b506e74"), + Linux(:i686, libc=:musl, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.i686-linux-musl-libgfortran3.tar.gz", "2846df4b60cbabfc86b990c87bec8d7e58431c4ad1b250036993a899fdb29172"), + Linux(:i686, libc=:musl, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.i686-linux-musl-libgfortran4.tar.gz", "73ba40c10b825b0a5abc4fd6bd1edd9d270ff4dd37c652a6380e38da5aeab864"), + Linux(:i686, libc=:musl, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.i686-linux-musl-libgfortran5.tar.gz", "80f8df63b1137a061b30a11bc2b0a985fbde56c665601bb30ff7762e3fbace72"), + Windows(:i686, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.i686-w64-mingw32-libgfortran3.tar.gz", "e53493d881c2a36d697e6abbeaeec8181488868e479bf06ea7db959d9a016763"), + Windows(:i686, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.i686-w64-mingw32-libgfortran4.tar.gz", "58c25e695e7dace12db66d19575914922183a8083c353b691e16b1bf86ab9a3a"), + Windows(:i686, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.i686-w64-mingw32-libgfortran5.tar.gz", "c9bc14ed49945c57353fffa7d7e374fbb146218bc0345d43bbbf8182f142ca77"), + Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.powerpc64le-linux-gnu-libgfortran3.tar.gz", "c2a29d7f514acca1f9a8f0b723098d1340f3002ab689010546afcb0f9fa5d315"), + Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.powerpc64le-linux-gnu-libgfortran4.tar.gz", "facbe1ae766e774c9ca2782dcb5dc6544b1c025ec1cc091bae15b3f57e6b5513"), + Linux(:powerpc64le, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.powerpc64le-linux-gnu-libgfortran5.tar.gz", "c11ab7865a3812446c2f1b32c78d89e3af2ddd31c9c32b472706e8f20368d6ed"), + MacOS(:x86_64, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-apple-darwin14-libgfortran3.tar.gz", "2739fe9184b065bf32cd1246ee12c1fd6507a9932a921dbf1bf268a3819164a0"), + MacOS(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-apple-darwin14-libgfortran4.tar.gz", "cb2825f0eae2cf4e5b6bc7075f3ee70afb8a31711fd5220bfd85827b87625a43"), + MacOS(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-apple-darwin14-libgfortran5.tar.gz", "e308cbb8e0b2b50635f98cf700b24743a2eb9d5c7726a99375ef31e096371642"), + Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-linux-gnu-libgfortran3.tar.gz", "9d0223f3562e0b609595904ecab0fd55650f068da367353a38146394d8329f69"), + Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-linux-gnu-libgfortran4.tar.gz", "adcc8519411cf0518c472d3ce47d8ac93492934a05c0276afe76eda6d91c4f4d"), + Linux(:x86_64, libc=:glibc, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-linux-gnu-libgfortran5.tar.gz", "23771ec6d2fa014db480b5cfe8e1b6f34b2d29e8bbea8cdce1edd5f1e15cb6e0"), + Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-linux-musl-libgfortran3.tar.gz", "a04abda3002d81567e415d17b6d72c010ef6e202d47e6d8bac32c034321ddd48"), + Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-linux-musl-libgfortran4.tar.gz", "b6911e4ece0432d74c24d47d12000179fb00912e587ddae08e0ab1b7eda4bcf5"), + Linux(:x86_64, libc=:musl, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-linux-musl-libgfortran5.tar.gz", "269279af71f2b64c30162cfb0d2168d518fa913aade7564fa28c8928497b3e64"), + FreeBSD(:x86_64, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-unknown-freebsd11.1-libgfortran3.tar.gz", "aeda35832c30df2d24f06cd061b21f573b1167c76ff57f3f20f1b5dfbe249adc"), + FreeBSD(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-unknown-freebsd11.1-libgfortran4.tar.gz", "3476688c80d8032685c57ced39a810447fc3da1b3f3275fe3af37509ccc1252e"), + FreeBSD(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-unknown-freebsd11.1-libgfortran5.tar.gz", "19a779b6e539b0050432684d952342b18c28587b0c27a399cb0a00da2773c381"), + Windows(:x86_64, compiler_abi=CompilerABI(:gcc4)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-w64-mingw32-libgfortran3.tar.gz", "bec6c38ec12b26b1fd3c99944af81e463a29daf52152b53f49ca15fbf633b528"), + Windows(:x86_64, compiler_abi=CompilerABI(:gcc7)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-w64-mingw32-libgfortran4.tar.gz", "aec25acb618447247e3ad5ee9aec88725cd26d7abb9b6c29ac45e7aea601331e"), + Windows(:x86_64, compiler_abi=CompilerABI(:gcc8)) => ("$bin_prefix/CompilerSupportLibraries.v0.3.3.x86_64-w64-mingw32-libgfortran5.tar.gz", "69957fdd4eb5d6cfd1073c3b63b63a3ff3e2db909b4f4834b102d8a96944f66c"), +) + +# Install unsatisfied or updated dependencies: +unsatisfied = any(!satisfied(p; verbose=verbose) 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) +end + +# Write out a deps.jl file that will contain mappings for our products +write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) From daf35a7d966805f40992c3a07b79eee97344d550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Wed, 29 Apr 2020 22:36:13 +0200 Subject: [PATCH 20/21] Use BinaryProvider v0.5.9 --- .travis.yml | 3 --- Project.toml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a70c521..73c6060 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,6 @@ addons: - liblapack-dev - libblas-dev -before_script: - - julia -e 'using Pkg; Pkg.add(PackageSpec(name="BinaryProvider", rev="mg/fix-write-deps-isolation"))' - notifications: email: false after_success: diff --git a/Project.toml b/Project.toml index f4894a9..6462639 100644 --- a/Project.toml +++ b/Project.toml @@ -15,7 +15,7 @@ SemidefiniteModels = "169818f4-1a3d-53bf-95b3-11177825b1e3" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" [compat] -BinaryProvider = "0.5" +BinaryProvider = "0.5.9" CSDP_jll = "=6.2.0" Glob = "1.2" MathOptInterface = "0.9.5" From 65e19bb32f44481071f00fb0a4d2fde59f3805c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 2 May 2020 16:21:21 +0200 Subject: [PATCH 21/21] Disable example test on Windows --- test/runtests.jl | 50 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 43b4bad..f14d9b6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -29,30 +29,32 @@ end end end -@testset "Example" begin - cd(joinpath(dirname(dirname(pathof(CSDP))), "examples")) do - include(joinpath(pwd(), "example.jl")) - @test size(X) == (7, 7) - @test length(y) == 2 - @test size(Z) == (7, 7) - X✓ = [3 3 0 0 0 0 0; - 3 3 0 0 0 0 0; - 0 0 16 0 0 0 0; - 0 0 0 0 0 0 0; - 0 0 0 0 0 0 0; - 0 0 0 0 0 0 0; - 0 0 0 0 0 0 0] / 24 - @test norm(convert(AbstractArray, X) - X✓) < 1e-6 - y✓ = [3, 4] / 4 - @test norm(convert(AbstractArray, y) - y✓) < 1e-6 - Z✓ = [1 -1 0 0 0 0 0; - -1 1 0 0 0 0 0; - 0 0 0 0 0 0 0; - 0 0 0 8 0 0 0; - 0 0 0 0 8 0 0; - 0 0 0 0 0 3 0; - 0 0 0 0 0 0 4] / 4 - @test norm(convert(AbstractArray, Z) - Z✓) < 1e-6 +@static if !Sys.iswindows() # FIXME Segfault on Windows + @testset "Example" begin + cd(joinpath(dirname(dirname(pathof(CSDP))), "examples")) do + include(joinpath(pwd(), "example.jl")) + @test size(X) == (7, 7) + @test length(y) == 2 + @test size(Z) == (7, 7) + X✓ = [3 3 0 0 0 0 0; + 3 3 0 0 0 0 0; + 0 0 16 0 0 0 0; + 0 0 0 0 0 0 0; + 0 0 0 0 0 0 0; + 0 0 0 0 0 0 0; + 0 0 0 0 0 0 0] / 24 + @test norm(convert(AbstractArray, X) - X✓) < 1e-6 + y✓ = [3, 4] / 4 + @test norm(convert(AbstractArray, y) - y✓) < 1e-6 + Z✓ = [1 -1 0 0 0 0 0; + -1 1 0 0 0 0 0; + 0 0 0 0 0 0 0; + 0 0 0 8 0 0 0; + 0 0 0 0 8 0 0; + 0 0 0 0 0 3 0; + 0 0 0 0 0 0 4] / 4 + @test norm(convert(AbstractArray, Z) - Z✓) < 1e-6 + end end end