KarypisLab / METIS

METIS - Serial Graph Partitioning and Fill-reducing Matrix Ordering
Other
665 stars 134 forks source link

libmetis does not link GKlib #50

Closed aliaksei135 closed 1 year ago

aliaksei135 commented 1 year ago

The METIS library depends on functions from GKlib however this is not linked to the metis target in CMake. Instead GKlib is linked against the program binaries in programs.

Using libmetis standalone results in errors missing refs to various gk_* routines

...
undefined reference: 'gk_malloc'
...
karypis commented 1 year ago

You need to link your programs both against metis and GKlib; i.e., "-lmetis -lGKlib".

physicsmonk commented 1 year ago

Using CMake to build libmetis.dylib will generate a linker error showing that it is not linked to GKlib. I found that this is because in CMakeList.txt in libmetis folder, there is no command to order metis to be linked to GKlib. So I added a line target_link_libraries(metis GKlib), and then CMake can complete the building. Hope you can review this and make proper revisions to the package.

annkri commented 1 year ago

Using CMake to build libmetis.dylib will generate a linker error showing that it is not linked to GKlib. I found that this is because in CMakeList.txt in libmetis folder, there is no command to order metis to be linked to GKlib. So I added a line target_link_libraries(metis GKlib), and then CMake can complete the building. Hope you can review this and make proper revisions to the package.

Thanks! This fixed it for me!