Skip to content

Resolved static linking errors related to pthread

Compare
Choose a tag to compare
@DavidAce DavidAce released this 19 Dec 10:34
  • Bug fix: The h5pp_DIR directory is now inserted into CMAKE_MODULE_PATH instead of appended, to prioritize finding the hand-made Find modules which are included with h5pp.
  • Use "pthread" instead of "-lpthread" when linking to avoid downstream errors. When linking statically, one may need -Wl, --whole-archive phread -Wl,--no-whole-archive as described in stackoverflow. If we mix "-lpthread" and "pthread" and then --whole-archive, CMake is not smart enough to unify the link flags and gives a multiple definition error. Sticking to "pthread" seems most flexible since CMake can add "-l" as needed.
  • Preempt Threads::Threads setting it to link "pthread" if not defined already.