-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using SDPAFamily
#29
Comments
This is because of eg libpaths = split(get(ENV, "DYLD_LIBRARY_PATH", ""), ":")
if !("/Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia" in libpaths)
push!(libpaths, "/Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia")
end being present in the ## This file autogenerated by BinaryProvider.write_deps_file().
## Do not edit.
##
## Include this file within your main top-level source, and call
## `check_deps()` from within your module's `__init__()` method
if isdefined((@static VERSION < v"0.7.0-DEV.484" ? current_module() : @__MODULE__), :Compat)
import Compat.Libdl
elseif VERSION >= v"0.7.0-DEV.3382"
import Libdl
end
const sdpa_gmp = joinpath(dirname(@__FILE__), "usr/bin/sdpa_gmp")
const libqd = joinpath(dirname(@__FILE__), "usr/lib/libqd.0.dylib")
const sdpa_qd = joinpath(dirname(@__FILE__), "usr/bin/sdpa_qd")
const libqd = joinpath(dirname(@__FILE__), "usr/lib/libqd.0.dylib")
const sdpa_dd = joinpath(dirname(@__FILE__), "usr/bin/sdpa_dd")
const libqd = joinpath(dirname(@__FILE__), "usr/lib/libqd.0.dylib")
const sdpa = joinpath(dirname(@__FILE__), "usr/bin/sdpa")
const libsdpa = joinpath(dirname(@__FILE__), "usr/lib/libsdpa.0.dylib")
function check_deps()
global sdpa_gmp
if !isfile(sdpa_gmp)
error("$(sdpa_gmp) does not exist, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
global libqd
if !isfile(libqd)
error("$(libqd) does not exist, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
if Libdl.dlopen_e(libqd) in (C_NULL, nothing)
error("$(libqd) cannot be opened, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
global sdpa_qd
if !isfile(sdpa_qd)
error("$(sdpa_qd) does not exist, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
global libqd
if !isfile(libqd)
error("$(libqd) does not exist, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
if Libdl.dlopen_e(libqd) in (C_NULL, nothing)
error("$(libqd) cannot be opened, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
global sdpa_dd
if !isfile(sdpa_dd)
error("$(sdpa_dd) does not exist, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
global libqd
if !isfile(libqd)
error("$(libqd) does not exist, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
if Libdl.dlopen_e(libqd) in (C_NULL, nothing)
error("$(libqd) cannot be opened, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
global sdpa
if !isfile(sdpa)
error("$(sdpa) does not exist, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
global libsdpa
if !isfile(libsdpa)
error("$(libsdpa) does not exist, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
if Libdl.dlopen_e(libsdpa) in (C_NULL, nothing)
error("$(libsdpa) cannot be opened, Please re-run Pkg.build(\"SDPAFamily\"), and restart Julia.")
end
libpaths = split(get(ENV, "DYLD_LIBRARY_PATH", ""), ":")
if !("/Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia" in libpaths)
push!(libpaths, "/Applications/Julia-1.3.app/Contents/Resources/julia/lib/julia")
end
ENV["DYLD_LIBRARY_PATH"] = join(filter(!isempty, libpaths), ":")
end
const HAS_WSL = Dict{Symbol,Bool}(Dict(:sdpa_dd => 0,:sdpa_gmp => 0,:sdpa_qd => 0,:sdpa => 0)) |
I think this will be solved by switching SDPA to a JLL package when JuliaPackaging/Yggdrasil#804 is finished. |
Now in JuliaPackaging/Yggdrasil#1478. It would be great if folks from here who may know the cxxwrap related internals better can chime in on that PR. I believe we should be fairly close. |
That’s awesome! I have to say, I really don’t know the Cxxwrap internals at all, I just copied them from https://github.com/jump-dev/SDPA.jl (I think @blegat has done a lot of work for that package, so he might know better) |
We definitely need updates on the cxxwrap. See comments in the Yggdrasil PR. |
This is merged now. Can we try it out? Do see the comments in the Yggdrasil PR about the gfortran issue- but it should hopefully just work. |
just to follow up, hopefully the SDPA JLL package can help here once the gfortran issues are sorted out (I can't really help at all, all this build stuff is very far from my experience). For SDPAFamily to be fully JLL'd, we'd need the high-precision variants SDPA-GMP, SDPA-DD, and SDPA-QD as well to be built with the new binarybuilder. (Note https://github.com/jump-dev/SDPA.jl does not support these and just uses SDPA itself). They are a bit strange in that they don't expose a programmatic API, but just a binary executable to shell out to (and in fact, we just write a file and ask it to read the file). I tried to build QD in JuliaPackaging/Yggdrasil#380, one of the dependencies of these binaries, but there is something wrong with the build: JuliaPackaging/Yggdrasil#755. We actually don't need to load any libraries into the Julia process, however, since we only shell out to the final binaries, so this might not be an issue for that use-case. I think the new scratch spaces (which is now in https://github.com/JuliaPackaging/Scratch.jl I believe) can help make the old BinaryBuilder/BinaryProvider setup work in a better way, however. We can just make a scratch space to keep the deps files instead of mutating the package directory. We could even do that for the old way of building SDPA (also keying the scratch space off the Julia version) which would eliminate the error in this issue without needing the JLL. Separately, we can also use the scratch spaces to store the files we read and write to interact with the binaries; right now we use |
Sometimes I get this error when calling
using SDPAFamily
:I think it comes from using SDPAFamily from different Julia versions, and needing to rebuild the package. I'm not quite sure how to fix it; I think one easy fix might just be to remove the plain-SDPA functionality and only support the high-precision variants, since then we don't need to link against anything.
The text was updated successfully, but these errors were encountered: