Skip to content

Commit

Permalink
Add SDP support
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed May 15, 2024
1 parent f106018 commit 0c90f9a
Show file tree
Hide file tree
Showing 5 changed files with 240 additions and 137 deletions.
8 changes: 2 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ repo = "https://github.com/jump-dev/DSDP.jl.git"
version = "0.1.0"

[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
DSDP_jll = "1065e140-e56c-5613-be8b-7480bf7138df"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"

[compat]
DSDP_jll = "0.0.1"
MathOptInterface = "1"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
5 changes: 4 additions & 1 deletion src/DSDP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ module DSDP
import DSDP_jll
using LinearAlgebra

const lib = DSDP_jll.libdsdp
#const lib = "/home/blegat/bin/DSDP5.8/lib/libdsdp.so"

macro dsdp_ccall(f, args...)
quote
# QuoteNode prevents the interpretion of the symbol
# and leave it as a symbol
info = ccall(($(QuoteNode(f)), DSDP_jll.libdsdp), Cint, $(esc.(args)...))
info = ccall(($(QuoteNode(f)), lib), Cint, $(esc.(args)...))
if !iszero(info)
error("DSDP call $($(QuoteNode(f))) returned nonzero status $info.")
end
Expand Down
Loading

0 comments on commit 0c90f9a

Please sign in to comment.