jump-dev / ECOS.jl

A Julia interface to the ECOS conic optimization solver
https://github.com/embotech/ecos
Other
41 stars 17 forks source link

ECOS.jl cannot be included in a system image #106

Closed omus closed 4 years ago

omus commented 4 years ago

Attempting to include ECOS.jl in a system image results in this error:

ERROR: LoadError: LoadError: LoadError: LoadError: LoadError: LoadError: LoadError: could not load library "libecos.so"
libecos.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] ver() at /root/.julia/packages/ECOS/P12oD/src/ECOS.jl:29
 [2] top-level scope at /root/.julia/packages/ECOS/P12oD/src/types.jl:143
 [3] include at ./boot.jl:328 [inlined]
 [4] include_relative(::Module, ::String) at ./loading.jl:1105
 [5] include at ./Base.jl:31 [inlined]
 [6] include(::String) at /root/.julia/packages/ECOS/P12oD/src/ECOS.jl:10
 [7] top-level scope at /root/.julia/packages/ECOS/P12oD/src/ECOS.jl:51
 [8] include at ./boot.jl:328 [inlined]
 [9] include_relative(::Module, ::String) at ./loading.jl:1105
 [10] _require(::Base.PkgId) at ./loading.jl:1053
 [11] require(::Base.PkgId) at ./loading.jl:922
 [12] require(::Module, ::Symbol) at ./loading.jl:917
 [13] include at ./boot.jl:328 [inlined]
 [14] include_relative(::Module, ::String) at ./loading.jl:1105
 [15] _require(::Base.PkgId) at ./loading.jl:1053
 [16] require(::Base.PkgId) at ./loading.jl:922
 [17] require(::Module, ::Symbol) at ./loading.jl:917
 [18] include at ./boot.jl:328 [inlined]
 [19] include_relative(::Module, ::String) at ./loading.jl:1105
 [20] _require(::Base.PkgId) at ./loading.jl:1053
 [21] require(::Base.PkgId) at ./loading.jl:922
 [22] require(::Module, ::Symbol) at ./loading.jl:917
 [23] include at ./boot.jl:328 [inlined]
 [24] include_relative(::Module, ::String) at ./loading.jl:1105
 [25] _require(::Base.PkgId) at ./loading.jl:1053
 [26] require(::Base.PkgId) at ./loading.jl:922
 [27] require(::Module, ::Symbol) at ./loading.jl:917
in expression starting at /root/.julia/packages/ECOS/P12oD/src/types.jl:143
in expression starting at /root/.julia/packages/ECOS/P12oD/src/ECOS.jl:51
...
in expression starting at /root/.julia/packages/PackageCompiler/4yNnV/sysimg/run_julia_code.jl:10
ERROR: LoadError: failed process: Process(`/usr/local/julia/bin/julia --sysimage=/root/.julia/packages/PackageCompiler/4yNnV/sysimg/backup/core-avx2/sys.so --startup-file=no --cpu-target=core-avx2 --output-o=sys.a --track-allocation=none --code-coverage=none --history-file=yes --inline=yes --math-mode=ieee --compile=yes --track-allocation=none --sysimage-native-code=yes --sysimage=/usr/local/julia/lib/julia/sys.so --compiled-modules=yes --optimize=2 /root/.julia/packages/PackageCompiler/4yNnV/sysimg/run_julia_code.jl`, ProcessExited(1)) [1]

I believe the issue is that this line calls ver() before the ECOS library is loaded.

omus commented 4 years ago

As ECOS_jll 2.0.5 is already required by the Project.toml it seems like the easiest fix is to just drop the check altogether