kahypar / KaHyPar.jl

KaHyPar.jl is a Julia interface to the KaHyPar multilevel hypergraph partitioning package.
Other
22 stars 6 forks source link

Can not load KaHyPar shared object file #19

Closed GiggleLiu closed 2 years ago

GiggleLiu commented 3 years ago

Julia v1.6.1, KaHyPar 0.2.0, Ubuntu 20.04

julia> using KaHyPar
[ Info: Precompiling KaHyPar [2a6221f6-aa48-11e9-3542-2d9e0ef01880]
ERROR: LoadError: InitError: could not load library "/home/leo/.julia/artifacts/1f9c17d74a12ed0de413318dd1f11e2379e4716f/lib/libkahypar.so"
libboost_program_options.so.1.71.0: cannot open shared object file: No such file or directory
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/bkwIo/src/products/library_generators.jl:54 [inlined]
  [4] __init__()
    @ KaHyPar_jll ~/.julia/packages/KaHyPar_jll/6UpOK/src/wrappers/x86_64-linux-gnu.jl:9
  [5] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base ./loading.jl:674
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:760
  [7] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:998
  [8] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:914
  [9] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:901
 [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:1213
 [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
during initialization of module KaHyPar_jll
in expression starting at /home/leo/.julia/packages/KaHyPar/YSKB3/src/KaHyPar.jl:1
ERROR: Failed to precompile KaHyPar [2a6221f6-aa48-11e9-3542-2d9e0ef01880] to /home/leo/.julia/compiled/v1.6/KaHyPar/jl_1aVynj.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY)
   @ Base ./loading.jl:1360
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1306
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1021
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:914
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:901

Note: I can fix it by typing

$ sudo apt-get install libboost-program-options-dev

Still wondering why the error took place. I just updated some packages.

GiggleLiu commented 3 years ago

My friend also see this error when using google cloud with OS: Debian 9.13. This might be related to specifying a specific version of boost. Why it searches the system path instead of using the boost_jll?

GiggleLiu commented 3 years ago

I find required lib file in the artifacts folder, maybe it is just an issue of look up path.

(base) ➜  artifacts find .|grep libboost_program
./9e486cf987b892f0435f3d745c329d3e7a038ab5/lib/libboost_program_options.so.1.76.0
./9e486cf987b892f0435f3d745c329d3e7a038ab5/lib/cmake/boost_program_options-1.76.0/libboost_program_options-variant-shared.cmake
./9e486cf987b892f0435f3d745c329d3e7a038ab5/lib/cmake/boost_program_options-1.76.0/libboost_program_options-variant-static.cmake
./9e486cf987b892f0435f3d745c329d3e7a038ab5/lib/libboost_program_options.so
./9e486cf987b892f0435f3d745c329d3e7a038ab5/lib/libboost_program_options.a
./9960e060b732618174ffd95804d6635833f99513/lib/cmake/boost_program_options-1.71.0/libboost_program_options-variant-shared.cmake
./9960e060b732618174ffd95804d6635833f99513/lib/cmake/boost_program_options-1.71.0/libboost_program_options-variant-static.cmake
./9960e060b732618174ffd95804d6635833f99513/lib/libboost_program_options.so.1.71.0
./9960e060b732618174ffd95804d6635833f99513/lib/libboost_program_options.so.1
./9960e060b732618174ffd95804d6635833f99513/lib/libboost_program_options.so.1.71
./9960e060b732618174ffd95804d6635833f99513/lib/libboost_program_options.so
./9960e060b732618174ffd95804d6635833f99513/lib/libboost_program_options.a
./1f9c17d74a12ed0de413318dd1f11e2379e4716f/logs/KaHyPar/update_rpath_libkahypar.so_libboost_program_options.so.1.71.0.log.gz
./1f9c17d74a12ed0de413318dd1f11e2379e4716f/logs/KaHyPar/update_linkage_libkahypar.so_libboost_program_options.so.1.71.0.log.gz

This problem make KaHyPar.jl installation unsuccessful in most hosts. So I think it is quite urgent. Since I know little about how the binaries are compiled. Can anyone help look into it?

BarzegarAlireza commented 3 years ago

I have the same issue. Have you found any solution?

GiggleLiu commented 3 years ago

I have found a temporary solution: For Ubuntu 20.04, this is fine, just install libboost-program-options-dev, For older version, compile-install libboost > 1.7 and link the file to target file

sudo ln -s /usr/lib/libboost_program_options.so.1.7x.y /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.71.0
jalving commented 2 years ago

@GiggleLiu: I agree this is kind of urgent. I will try to take a look at this when I can find the time. Thanks for the temporary solution. I recently ran into this problem on an old Ubuntu 14.04 machine, and could not get it to work no matter what work-around I tried.

GiggleLiu commented 2 years ago

@jalving For older version Ubuntu, you need to compile and install latest libboost first, then you need to located the so file and link it to the required file. If this does not work, then I also have no idea.

BarzegarAlireza commented 2 years ago

@GiggleLiu and @jalving Thanks for the answer, any solution for Windows machines?

jalving commented 2 years ago

@BarzegarAlireza We haven't managed to get a working windows artifact yet, mostly because neither I or the KaHyPar devs have had time to work with windows compilers. I think some KaHyPar users have managed to compile with Windows, so it's technically possible to create an artifact.

giordano commented 2 years ago

Fixed by https://github.com/JuliaRegistries/General/pull/49308 (alternatively, you could have installed ]add boost_jll@1.71.0)

jalving commented 2 years ago

Closing this issue. Feel free to re-open if it persists.