Skip to content
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

OSError: libmetis.so: undefined symbol: gk_jbufs #83

Open
ghost opened this issue Feb 2, 2024 · 2 comments
Open

OSError: libmetis.so: undefined symbol: gk_jbufs #83

ghost opened this issue Feb 2, 2024 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 2, 2024

When attempting to use METIS I am facing this error:
Screenshot 2024-02-02 at 1 00 21 PM

I installed METIS in Ubuntu 20.04 by:

git clone [email protected]:KarypisLab/GKlib.git
git clone https://github.com/KarypisLab/METIS.git

cd GKlib
make config cc=gcc prefix=~/local
make
make install

cd ../METIS
make config shared=1 cc=gcc prefix=~/local i64=1 r64=1
make
make install

My cmake is version 3.2. The runtime error arises when using the python metis package.

I could not figure out a way to solve this issue, any assistance would be greatly appreciated. Thank you!

@ghost ghost changed the title OSError: /home/ubuntu/local/lib/libmetis.so: undefined symbol: gk_jbufs OSError: libmetis.so: undefined symbol: gk_jbufs Feb 2, 2024
@gfaster
Copy link

gfaster commented Feb 2, 2024

It looks like GKlib isn't being linked properly. I would try running one of the executables that metis provides - if that also has an error then it means there was something wrong during build. I'm not familiar with how the _dlopen prints its error, but it looks like there is only a single symbol missing - are you able to get a verbose output?

@carandraug
Copy link

This is caused because of a series of issues:

  1. GKLib does not build shared libraries by default, use:

    make config CONFIG_FLAGS='-D BUILD_SHARED_LIBS=ON'
    

    (or add it to ther other flags you probably need) when building GKlib

  2. METIS does not link to GKLib even if it exists. You need to apply the fix in link metis to gklib #77, or:

     sed -i '/add_library(metis ${METIS_LIBRARY_TYPE} ${metis_sources})/ s/$/\ntarget_link_libraries(metis GKlib)/' libmetis/CMakeLists.txt
    

    before building

  3. depending where you install GKLib you may need to tell the linker where to find GKLib (the gklib_path is not enough). I add to do:

    sed -i '/^CONFIG_FLAGS \?= / s,$, -DCMAKE_BUILD_RPATH=${HOME}/.local/lib -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON,' Makefile
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants