ntamas / plfit

Fitting power-law distributions to empirical data, according to the method of Clauset, Shalizi and Newman
GNU General Public License v2.0
47 stars 17 forks source link

src/CMakeLists.txt: link libplfit against $MATH_LIBRARY #45

Closed orlitzky closed 6 months ago

orlitzky commented 6 months ago

The libplfit library makes use of several math functions (exp, log, ...) , and so should be linked to libm directly when libm is required for those functions. If it is not, then compilation may succeed leaving the resulting library underlinked. This can lead to errors like,

test_discrete: symbol lookup error: .../src/libplfit.so.0: undefined symbol: log

when linking with lld and LDFLAGS="Wl,--as-needed". (The error above comes from plfit's own test suite.)

Gentoo-bug: https://bugs.gentoo.org/926433

ntamas commented 6 months ago

Thanks a lot!

ntamas commented 6 months ago

Version 0.9.5 was tagged so feel free to point Gentoo at this new version.

orlitzky commented 6 months ago

Version 0.9.5 was tagged so feel free to point Gentoo at this new version.

Done, thank you!