jump-dev / dsdp.jl Goto Github PK
View Code? Open in Web Editor NEWA Julia interface to the DSDP semidefinite programming solver
Home Page: http://www.mcs.anl.gov/hs/software/DSDP/
License: Other
A Julia interface to the DSDP semidefinite programming solver
Home Page: http://www.mcs.anl.gov/hs/software/DSDP/
License: Other
In a mac, I got the following error
(@v1.7) pkg> add https://github.com/jump-dev/DSDP.jl
Cloning git-repo `https://github.com/jump-dev/DSDP.jl`
Updating git-repo `https://github.com/jump-dev/DSDP.jl`
Updating registry at `~/.julia/registries/General.toml`
Resolving package versions...
Updating `~/.julia/environments/v1.7/Project.toml`
[2714ae6b] + DSDP v0.1.0 `https://github.com/jump-dev/DSDP.jl#master`
Updating `~/.julia/environments/v1.7/Manifest.toml`
[2714ae6b] + DSDP v0.1.0 `https://github.com/jump-dev/DSDP.jl#master`
Building DSDP โ `~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/e3d74a02067b30a5abbe16d2889987a3bb8e27dc/build.log`
ERROR: Error building `DSDP`:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 2547k 100 2547k 0 0 2432k 0 0:00:01 0:00:01 --:--:-- 3681k
patching file src/sys/dsdploginfo.c
patching file Makefile
patching file make.include
patching file pdsdp/PLAPPACK/Makefile
patching file Makefile
patching file make.include
patching file make.include
patching file make.include
Hunk #1 succeeded at 48 with fuzz 1.
make all
make install
make dsdplibrary
==========================================
Compiling DSDP5
For help with installation problems, please send EVERYTHING
printed out below to the developers
==========================================
On Thu May 26 15:04:32 PDT 2022 on Benjamins-MBP-2
Machine characteristics: Darwin Benjamins-MBP-2 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 x86_64
-----------------------------------------
Using C compiler: gcc
Using compiler options: -O3 -I. -I/Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8/include -fPIC
-----------------------------------------
Current Directory: /Users/biona001
Using DSDP directory: /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8
==========================================
cd src; make all
cd solver; make dsdplib;
gcc -O3 -I. -I/Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8/include -fPIC -c dualalg.c
In file included from dsdp.h:5:0,
from dualalg.c:1:
dsdpvec.h:4:18: fatal error: math.h: No such file or directory
#include <math.h>
^
compilation terminated.
make[5]: *** [dualalg.o] Error 1
make[4]: *** [dsdplib] Error 2
make[3]: *** [dsdplibrary] Error 2
make[2]: *** [install] Error 2
make[1]: *** [all] Error 2
make: *** [default] Error 2
[ Info: Attempting to create directory /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/downloads
[ Info: Downloading file http://www.mcs.anl.gov/hs/software/DSDP/DSDP5.8.tar.gz
[ Info: Done downloading file http://www.mcs.anl.gov/hs/software/DSDP/DSDP5.8.tar.gz
[ Info: Attempting to create directory /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src
[ Info: Attempting to create directory /Users/biona001/.julia/packages/DSDP/f2Z4F/deps
[ Info: Directory /Users/biona001/.julia/packages/DSDP/f2Z4F/deps already exists
[ Info: Attempting to create directory /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/usr/lib
[ Info: Changing directory to /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8
[ Info: Changing directory to /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8
[ Info: Changing directory to /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8
[ Info: Changing directory to /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8
[ Info: Changing directory to /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8
[ Info: Changing directory to /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8
[ Info: Changing directory to /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8
[ Info: Changing directory to /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8
[ Info: Changing directory to /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/src/DSDP5.8
ERROR: LoadError: failed process: Process(`make`, ProcessExited(2)) [2]
Stacktrace:
[1] pipeline_error
@ ./process.jl:531 [inlined]
[2] run(::Cmd; wait::Bool)
@ Base ./process.jl:446
[3] run(::Cmd)
@ Base ./process.jl:444
[4] run(s::BinDeps.SynchronousStepCollection) (repeats 2 times)
@ BinDeps ~/.julia/packages/BinDeps/5xsHU/src/BinDeps.jl:524
[5] satisfy!(dep::BinDeps.LibraryDependency, methods::Vector{DataType})
@ BinDeps ~/.julia/packages/BinDeps/5xsHU/src/dependencies.jl:951
[6] satisfy!(dep::BinDeps.LibraryDependency)
@ BinDeps ~/.julia/packages/BinDeps/5xsHU/src/dependencies.jl:929
[7] top-level scope
@ ~/.julia/packages/BinDeps/5xsHU/src/dependencies.jl:984
[8] include(fname::String)
@ Base.MainInclude ./client.jl:451
[9] top-level scope
@ none:5
in expression starting at /Users/biona001/.julia/packages/DSDP/f2Z4F/deps/build.jl:41
Output of versioninfo
julia> versioninfo()
Julia Version 1.7.1
Commit ac5cc99908 (2021-12-22 19:35 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin19.5.0)
CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
The interface with higher-level solvers seems to be broken: with Julia v1.7, DSDP v0.0.1, latest JuMP.jl and Convex.jl (all pulled from github)
julia> using DSDP, Convex
julia> #A is a list of matrices, b is a matrix, c is a vector
julia> A = [[1 0;0 1],[0 1;1 0]]; b = [2 3;4 5]; c = [6,7] # for example
julia> x = Variable(length(A));
julia> problem = minimize(sum(x[l]*v for (l,v) in enumerate(c)),[sum(x[l]*m for (l,m) in enumerate(A))+b in :SDP])
julia> solve!(problem,DSDP.Optimizer)
ERROR: MethodError: no method matching allocate_variables(::DSDP.Optimizer, ::Int64)
Closest candidates are:
allocate_variables(::Union{MathOptInterface.Utilities.AbstractModelLike{T}, MathOptInterface.Utilities.AbstractOptimizer{T}} where T, ::Any) at /Users/laurent/.julia/packages/MathOptInterface/1EYfq/src/Utilities/model.jl:783
allocate_variables(::MathOptInterface.Utilities.MockOptimizer, ::Any) at /Users/laurent/.julia/packages/MathOptInterface/1EYfq/src/Utilities/mockoptimizer.jl:767
Stacktrace:
[1] copy_free_variables(dest::DSDP.Optimizer, idxmap::MathOptInterface.Utilities.IndexMap, vis_src::Vector{MathOptInterface.VariableIndex}, copy_variables::typeof(MathOptInterface.Utilities.allocate_variables))
@ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/1EYfq/src/Utilities/copy.jl:557
[2] allocate_load(dest::DSDP.Optimizer, src::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}, copy_names::Bool, filter_constraints::Nothing)
@ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/1EYfq/src/Utilities/copy.jl:1067
[3] #automatic_copy_to#127
@ ~/.julia/packages/MathOptInterface/1EYfq/src/Utilities/copy.jl:26 [inlined]
[4] #copy_to#3
@ ~/.julia/packages/DSDP/x4iAt/src/MOI_wrapper.jl:201 [inlined]
[5] attach_optimizer(model::MathOptInterface.Utilities.CachingOptimizer{DSDP.Optimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}})
@ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/1EYfq/src/Utilities/cachingoptimizer.jl:185
[6] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{DSDP.Optimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}})
@ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/1EYfq/src/Utilities/cachingoptimizer.jl:248
[7] optimize!
@ ~/.julia/packages/MathOptInterface/1EYfq/src/Bridges/bridge_optimizer.jl:293 [inlined]
[8] solve!(problem::Problem{Float64}, optimizer::DSDP.Optimizer; check_vexity::Bool, verbose::Bool, warmstart::Bool, silent_solver::Bool)
@ Convex ~/.julia/packages/Convex/LMZC7/src/solution.jl:243
[9] solve!(problem::Problem{Float64}, optimizer::DSDP.Optimizer)
@ Convex ~/.julia/packages/Convex/LMZC7/src/solution.jl:221
[10] solve!(problem::Problem{Float64}, optimizer_factory::Type; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Convex ~/.julia/packages/Convex/LMZC7/src/solution.jl:192
[11] solve!(problem::Problem{Float64}, optimizer_factory::Type)
@ Convex ~/.julia/packages/Convex/LMZC7/src/solution.jl:191
[12] top-level scope
@ REPL[17]:1
I had the same problems with JuMP.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
Some code is missing in the latest DSDP package:
julia> using DSDP, Convex
julia> A = [[1 0;0 1],[0 1;1 0]];
julia> b = [2 3;4 5];
julia> c = [6,7];
julia> x = Variable(length(A));
julia> pb = minimize(sum(x[l]*v for (l,v) in enumerate(c)),[sum(x[l]*m for (l,m) in enumerate(A))+b in :SDP]);
julia> solve!(pb,DSDP.Optimizer)
ERROR: TODO
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:33
[2] _setcoefficient!(m::DSDP.Optimizer, coef::Float64, constr::Int64, blk::Int64, i::Int64, j::Int64)
@ DSDP ~/.julia/packages/DSDP/4mGFq/src/MOI_wrapper.jl:304
[3] load_constraint(m::DSDP.Optimizer, ci::MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}, f::MathOptInterface.ScalarAffineFunction{Float64}, s::MathOptInterface.EqualTo{Float64})
@ DSDP ~/.julia/packages/DSDP/4mGFq/src/MOI_wrapper.jl:331
[4] load_constraints(dest::DSDP.Optimizer, src::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ModelFunctionConstraints{Float64}}}, idxmap::MathOptInterface.Utilities.IndexMap, cis_src::Vector{MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64}, MathOptInterface.EqualTo{Float64}}})
@ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/1EYfq/src/Utilities/copy.jl:1020
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.