GraphBLAS / LAGraph

This is a library plus a test harness for collecting algorithms that use the GraphBLAS. For test coverage reports, see https://graphblas.org/LAGraph/ . Documentation: https://lagraph.readthedocs.org
Other
229 stars 61 forks source link

Turning off dynamic (or static) library target #161

Open jamesETsmith opened 1 year ago

jamesETsmith commented 1 year ago

General

I'm working on a team implementing the GraphBLAS standard for some custom hardware. Our build system is only ideal for statically linked libraries right now and LAGraph currently supports dynamic and static linking. By default, LAGraph links the benchmarks and tests to the dynamically linked LAGraph library which causes some problems for us. We can work around them by modifying the cmake files to link all executables to the static library instead, but that's a pretty hacky solution. I understand this is a unique situation, but it would be a handy feature if we could choose a single type of LAGraph library to compile, e.g. dynamic or static, and have all executables link to that library.

Proposal

I have two options in mind, but I'm open to other suggestions.

  1. Allow users to choose either static or dynamic linking. This approach will be fairly simple and shouldn't add too much complexity to the build system, but it will make the build system a little less flexible. Users must build the static and dynamic libraries separately if they want/need both.
  2. Allow users to choose a combination of static and dynamic linking. This approach will require more cmake code to handle the variety of options for users but will give them greater flexibility to configure their builds.

Next Steps

If people think this would be helpful, I'd be glad to open a PR. Just let me know!

DrTimothyAldenDavis commented 1 year ago

Thanks for the note. This is in progress in GraphBLAS (in the main SuiteSparse version, dev2 branch, https://github.com/DrTimothyAldenDavis/SuiteSparse/tree/dev2 . Once it's settled there, I'll likely revise LAGraph accordingly. LAGraph will eventually be copied into SuiteSparse and the other packages follow the strategy of either static or dynamic linking.

jamesETsmith commented 1 year ago

Sounds good, thanks for the heads up. If you want any help as you switch things over, just let me know, I'd be happy to help. I'll leave this open until things on SuiteSparse/dev2 wrap up.