DrTimothyAldenDavis / SuiteSparse

The official SuiteSparse library: a suite of sparse matrix algorithms authored or co-authored by Tim Davis, Texas A&M University.
https://people.engr.tamu.edu/davis/suitesparse.html
Other
1.11k stars 256 forks source link

Build error on NetBSD due to dl #837

Closed ktnb-netbsd closed 3 weeks ago

ktnb-netbsd commented 3 weeks ago

Describe the bug While attempting to update the version of suitesparse in pkgsrc I get the following error:

[ 93%] Linking C shared library libgraphblas.so
ld: cannot find -ldl
--- GraphBLAS/libgraphblas.so.9.1.0 ---
*** [GraphBLAS/libgraphblas.so.9.1.0] Error code 1

This happens sometimes and is very common. So much that we have a way to bypass these types of errors. That being said, it would be nice if this error were fixed upstream. NetBSD doesn't have libdl.

To Reproduce Try to build wip/suitesparse on NetBSD.

Expected behavior Since NetBSD doesn't have libdl, it would be expected that cmake would not check for libdl on NetBSD. I'm not sure if this is true on other BSDs.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

mmuetzel commented 3 weeks ago

Thank you for your report.

Linking to libdl is currently conditional on a platform check in GraphBLAS (NOT WIN32). It should probably depend on a feature test instead (ability to link to libdl).

I'm working on a PR for that.

mmuetzel commented 3 weeks ago

See PR #838 for a potential fix.

Does that check do the right thing on NetBSD?

ktnb-netbsd commented 3 weeks ago

See PR #838 for a potential fix.

Does that check do the right think on NetBSD?

Yes, that looks like it would work. Thank you!

ktnb-netbsd commented 3 weeks ago

@mmuetzel I'll pull down the changes and attempt a build to make sure once I've got a minute.

ktnb-netbsd commented 3 weeks ago

@mmuetzel I have verified that you're change works! Thank you!

DrTimothyAldenDavis commented 3 weeks ago

Thanks for the heads about NetBSD. I've merged in the changes to the CMake build system, into the dev2 branch.

ktnb-netbsd commented 3 weeks ago

Thanks for the heads about NetBSD. I've merged in the changes to the CMake build system, into the dev2 branch.

Great, thank you. Once the update goes live I'll be sure to merge it into pkgsrc-current.