Issue importing Clp for SigmoidalProgramming

Hi!

I’m trying to use GitHub - madeleineudell/SigmoidalProgramming.jl: Julia Package for Sigmoidal Programming

The Project.toml looks like:

name = "SigmoidalProgramming"
uuid = "ce2a0656-6bed-5c64-9e01-e7b1ac833b80"
keywords = ["sigmoidal programming", "branch and bound"]
license = "MIT"
version = "1.0"

[deps]
Clp = "e2554f3b-3117-50c0-817c-e040a3ddf72d"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"

[compat]
julia = "1.3"
Clp = "0.8"
DataStructures = "0.18"
GLPK = "0.14"
JuMP = "0.21"
MathOptInterface = "0.9"

However,

calling

import SigmoidalProgramming

results in

 Info: Precompiling SigmoidalProgramming [ce2a0656-6bed-5c64-9e01-e7b1ac833b80]
└ @ Base loading.jl:1342
ERROR: LoadError: InitError: could not load library "/Users/antonsquared/.julia/artifacts/e763b11f6b4d844f817fd25177b3fa5b8ad83f03/lib/libClp.1.14.6.dylib"
dlopen(/Users/antonsquared/.julia/artifacts/e763b11f6b4d844f817fd25177b3fa5b8ad83f03/lib/libClp.1.14.6.dylib, 1): Library not loaded: @rpath/libdmumps.dylib
  Referenced from: /Users/antonsquared/.julia/artifacts/e763b11f6b4d844f817fd25177b3fa5b8ad83f03/lib/libClp.1.14.6.dylib
  Reason: image not found
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl ./libdl.jl:114
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl ./libdl.jl:114
  [3] macro expansion
    @ ~/.julia/packages/JLLWrappers/QpMQW/src/products/library_generators.jl:54 [inlined]
  [4] __init__()
    @ Clp_jll ~/.julia/packages/Clp_jll/ihKVc/src/wrappers/x86_64-apple-darwin-libgfortran5.jl:22
  [5] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base ./loading.jl:696
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:782
  [7] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1020
  [8] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:936
  [9] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:923
 [10] top-level scope
    @ ~/.julia/packages/Clp/nnuI6/src/Clp.jl:11
 [11] include
    @ ./Base.jl:386 [inlined]
 [12] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1235
 [13] top-level scope
    @ none:1
 [14] eval
    @ ./boot.jl:360 [inlined]
 [15] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [16] top-level scope
    @ none:1
during initialization of module Clp_jll
in expression starting at /Users/antonsquared/.julia/packages/Clp/nnuI6/src/Clp.jl:1
ERROR: LoadError: LoadError: Failed to precompile Clp [e2554f3b-3117-50c0-817c-e040a3ddf72d] to /Users/antonsquared/.julia/compiled/v1.6/Clp/jl_irpryl.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IOContext{Base.PipeEndpoint}, internal_stdout::IOContext{Base.PipeEndpoint}, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1385
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1329
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1043
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:936
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:923
  [7] include(mod::Module, _path::String)
    @ Base ./Base.jl:386
  [8] include(x::String)
    @ SigmoidalProgramming ~/.julia/packages/SigmoidalProgramming/kLcUj/src/SigmoidalProgramming.jl:1
  [9] top-level scope
    @ ~/.julia/packages/SigmoidalProgramming/kLcUj/src/SigmoidalProgramming.jl:6
 [10] include
    @ ./Base.jl:386 [inlined]
 [11] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1235
 [12] top-level scope
    @ none:1
 [13] eval
    @ ./boot.jl:360 [inlined]
 [14] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [15] top-level scope
    @ none:1
in expression starting at /Users/antonsquared/.julia/packages/SigmoidalProgramming/kLcUj/src/sp.jl:2
in expression starting at /Users/antonsquared/.julia/packages/SigmoidalProgramming/kLcUj/src/SigmoidalProgramming.jl:1

Failed to precompile SigmoidalProgramming [ce2a0656-6bed-5c64-9e01-e7b1ac833b80] to /Users/antonsquared/.julia/compiled/v1.6/SigmoidalProgramming/jl_g8VTJB.

Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IJulia.IJuliaStdio{Base.PipeEndpoint}, internal_stdout::IJulia.IJuliaStdio{Base.PipeEndpoint}, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1385
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1329
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1043
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:936
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:923
 [7] eval
   @ ./boot.jl:360 [inlined]
 [8] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1116

I’ve already tried:

Pkg.update()
Pkg.recompile()

My julia was installed with

brew install --cask julia

I’m running MacOS 10.14 Mojave on Intel

SigmoidalProgramming.jl is a bit old and unmaintained.

There were some issues with old versions of Clp that we fixed, but it looks like you can’t get the latest releases because of the requirement that you use old versions of Clp, JuMP, and MathOptInterface (all are version 1.0 or later now).

Try explicitly installing this version of MUMPS to see if that fixes the problem:

import Pkg
Pkg.pkg"add MUMPS_seq_jll@5"

Also note that there are no tests:

SigmoidalProgramming.jl/runtests.jl at master · madeleineudell/SigmoidalProgramming.jl · GitHub,

so I don’t know if Madeleine ever intended this for widespread usage.

1 Like

Thanks!

Not a problem, just using this for a school project.

I think the MUMPS thing worked…but I had to do it through the repl. Is it possible to run the notebook using a Julia Project.toml (a la running ipython in a pyenv)?

Is it possible to run the notebook using a Julia Project.toml

Yes, make this your first cell:

import Pkg
Pkg.activate("/path/to//Project.toml")

You’ll need to add a MUMPS_seq_jll = "5" line to the [compat] section of your Project.toml.

Your other option is to use a local copy of SigmoidalProgramming.jl with some edits.

import Pkg
Pkg.dev("SigmoidalProgramming")

Then look in ~/.julia/dev/SigmoidalProgramming and edit the Project.toml to update the bounds to:

[compat]
julia = "1.6"
Clp = "1"
DataStructures = "0.18"
GLPK = "1"
JuMP = "1"
MathOptInterface = "1"

It looks like a simple package, so that might be enough.

1 Like

Hey @odow, thanks for the update! I’ve packaged my work up into a github repo for use inside my research group, using the first approach. For the base julia package, would it be advisable/useable to make a PR adding the a MUMPS_seq_jll = "5" update?

No. The problem only happens for old Clp.jl versions. For newer versions, we fixed the bug.

The real solution is to update SigmoidalProgramming to the version 1 releases of JuMP, MathOptInterface, and Clp.

Or I need to fix this instead: https://github.com/JuliaRegistries/General/blob/master/C/Clp_jll/Compat.toml