Failed to precompile Ipopt

One of my project is dependent on PowerDynamics.jl, and PowerDynamics.jl is dependent on Ipopt.jl. Today when I was updating this project, the following situation occurs:

pkg> precompile
Precompiling project...
  ✗ Ipopt
  ✗ PowerDynamics
  0 dependencies successfully precompiled in 13 seconds (243 already precompiled)

ERROR: The following 1 direct dependency failed to precompile:

PowerDynamics [cc46b21f-1b17-51c2-b642-af74c3d3a8be]

Failed to precompile PowerDynamics [cc46b21f-1b17-51c2-b642-af74c3d3a8be] to C:\Users\liuwa\.julia\compiled\v1.7\PowerDynamics\jl_48B2.tmp.
ERROR: LoadError: InitError: could not load library "C:\Users\liuwa\.julia\artifacts\fff13fce0db4ed5379a0eeb73b6047a39b950e9d\bin\libipopt-3.dll"
The specified module could not be found.
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl .\libdl.jl:117
  [2] dlopen (repeats 2 times)
    @ .\libdl.jl:117 [inlined]
  [3] __init__()
    @ Ipopt_jll C:\Users\liuwa\.julia\packages\Ipopt_jll\ZudKO\src\wrappers\x86_64-w64-mingw32-libgfortran5-cxx11.jl:79
  [4] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base .\loading.jl:768
  [5] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base .\loading.jl:854
  [6] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1097
  [7] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:1013
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:997
  [9] top-level scope
    @ C:\Users\liuwa\.julia\packages\Ipopt\bYzBL\src\Ipopt.jl:26
 [10] include
    @ .\Base.jl:418 [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::String)
    @ Base .\loading.jl:1318
 [12] top-level scope
    @ none:1
 [13] eval
    @ .\boot.jl:373 [inlined]
 [14] eval(x::Expr)
    @ Base.MainInclude .\client.jl:453
 [15] top-level scope
    @ none:1
during initialization of module Ipopt_jll
in expression starting at C:\Users\liuwa\.julia\packages\Ipopt\bYzBL\src\Ipopt.jl:1
ERROR: LoadError: Failed to precompile Ipopt [b6b21f68-93f8-5de0-b562-5493be1d77c9] to C:\Users\liuwa\.julia\compiled\v1.7\Ipopt\jl_6CBF.tmp.
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
    @ Base .\loading.jl:1466
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1410
  [4] _require(pkg::Base.PkgId)
    @ Base .\loading.jl:1120
  [5] require(uuidkey::Base.PkgId)
    @ Base .\loading.jl:1013
  [6] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:997
  [7] include(mod::Module, _path::String)
    @ Base .\Base.jl:418
  [8] include(x::String)
    @ PowerDynamics C:\Users\liuwa\.julia\packages\PowerDynamics\2NFVY\src\PowerDynamics.jl:4
  [9] top-level scope
    @ C:\Users\liuwa\.julia\packages\PowerDynamics\2NFVY\src\PowerDynamics.jl:62
 [10] include
    @ .\Base.jl:418 [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:1318
 [12] top-level scope
    @ none:1
 [13] eval
    @ .\boot.jl:373 [inlined]
 [14] eval(x::Expr)
    @ Base.MainInclude .\client.jl:453
 [15] top-level scope
    @ none:1
in expression starting at C:\Users\liuwa\.julia\packages\PowerDynamics\2NFVY\src\operationpoint\power_flow.jl:1
in expression starting at C:\Users\liuwa\.julia\packages\PowerDynamics\2NFVY\src\PowerDynamics.jl:4

I had deleted “/.julia”, then had uninstalled and reinstalled the julia, and precompiled the project again. But this error still happened. My system info is:

julia> versioninfo()
Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: AMD Ryzen 9 5900HX with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, znver3)

Please help me, thanks very much

The error message says:“”“ERROR: LoadError: InitError: could not load library “C:\Users\liuwa.julia\artifacts\fff13fce0db4ed5379a0eeb73b6047a39b950e9d\bin\libipopt-3.dll”
The specified module could not be found.”“”. but this file actually exists.

With my project status info:

pkg> st
      Status `E:\seprojs\juliapowermodel\psyssecurity\Project.toml`
  [6e4b80f9] BenchmarkTools v1.3.1    
  [336ed68f] CSV v0.10.4
  [a93c6f00] DataFrames v1.3.4        
  [5721bf48] DataVoyager v1.0.2       
  [c43c736e] Genie v4.18.0
  [682c06a0] JSON v0.21.3
  [0f8b85d8] JSON3 v1.9.4
  [b9914132] JSONTables v1.0.3        
  [bac558e1] OrderedCollections v1.4.1
  [cc46b21f] PowerDynamics v3.0.0     
  [c36e90e8] PowerModels v0.18.4      
  [229d1e32] PowerPlots v0.4.3        
  [295af30f] Revise v3.3.3
  [856f2bd8] StructTypes v1.8.1       
  [112f6efa] VegaLite v2.6.0
  [2a0f44e3] Base64
  [ade2ca70] Dates

I was able to reproduce this in a clean environment, so maybe worth filing an issue?

I don’t know anything about this package, but for some reason a fresh install pulls in Ipopt 0.6.3, a very old version of the dependency. The package should actually be compatible with Ipopt 0.9, and I was able to precompile it by first doing ]add Ipopt@0.9 and then adding PowerDynamics afterwards.

1 Like

In a temporary environment (]activate --temp) install DependencyWalker.jl and Ipopt_jll.jl

]add DependencyWalker Ipopt_jll

(you may get an error here, ignore it) then run

using DependencyWalker, Ipopt_jll

you should get an error here, that’s ok, it’s what we want, then run

Library(raw"C:\Users\liuwa\.julia\artifacts\fff13fce0db4ed5379a0eeb73b6047a39b950e9d\bin\libipopt-3.dll")

This should show which library is missing. Unfortunately Windows isn’t very collaborative: it knows something is missing, but it wouldn’t tell you what :person_shrugging:

1 Like

Thanks, got it.
The version of Ipopt.jl in my project is too lower(0.6.3), i update the version to 0.7.0, the problem disappears

Thanks.

Sounds like there are some missing compat bounds somewhere. It’d be good to know what, to avoid the same troubles to other users in the future.

Older versions of Ipopt_jll didn’t have any compat bounds: Ipopt_jll.jl/Project.toml at Ipopt-v3.13.2+1 · JuliaBinaryWrappers/Ipopt_jll.jl · GitHub

The culprit is usually MUMPS.

This can be fixed in the registry; I think https://github.com/JuliaRegistries/RetroCap.jl is one option for implementing a fix.

Can we get a fix in the registry? We’re seeing failures in AutoMerge because of this, like https://github.com/JuliaRegistries/General/runs/6408226248?check_suite_focus=true and https://github.com/JuliaRegistries/General/runs/6408617521?check_suite_focus=true

Other PR which is failing: https://github.com/JuliaRegistries/General/pull/60114. This seems a rather widespread breakage

I tried RetroCap with its MonotonicUpperBound option, after editing it to affect JLLs, and it gave me

diff --git a/I/Ipopt_jll/Compat.toml b/I/Ipopt_jll/Compat.toml
index d2e570109f..f9462e16ff 100644
--- a/I/Ipopt_jll/Compat.toml
+++ b/I/Ipopt_jll/Compat.toml
@@ -1,6 +1,11 @@
 [3]
+ASL_jll = "0.0.0 - 0.1"
+OpenBLAS32_jll = "0.0.0 - 0.3"
 julia = "1"
 
+["3-3.13.1"]
+MUMPS_seq_jll = "0.0.0 - 5"
+
 ["3.13.2"]
 JLLWrappers = "1.1.0-1"
 
@@ -11,6 +16,8 @@ MUMPS_seq_jll = "5.2.1"
 JLLWrappers = "1.2.0-1"
 
 [300]
+ASL_jll = "0.0.0 - 0.1"
 JLLWrappers = "1.2.0-1"
 MUMPS_seq_jll = "5.4.1"
+OpenBLAS32_jll = "0.0.0 - 0.3"
 julia = "1.6.0-1"

But I realize I don’t actually know where the incompabilities are… (I don’t use any of these libraries)

I’ll take a look.

Does this fix it? https://github.com/JuliaRegistries/General/pull/60145

2 Likes

It looks like your PR solved the failure to load the package in https://github.com/JuliaRegistries/General/pull/60114. Thanks!

1 Like