Skip to content

CMake build with BUILD_PROG=ON fails on Linux due to libm #759

Description

@cho-m

Was experimenting with CMake build at Homebrew Homebrew/homebrew-core#194875 (mainly due to #757) and noticed the Linux build kept failing on libm.

Probably similar to BSD (d5c36c8).

One note is that failure is happening in a file not specified in list, i.e. blend4_reg

  /usr/bin/ld: CMakeFiles/blend4_reg.dir/blend4_reg.c.o: undefined reference to symbol 'sqrt@@GLIBC_2.2.5'
  /usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line

set(math_progs "dna_reg|extrema_reg|insert_reg|locminmax_reg|numa1_reg|otsutest1|plottest|pta_reg|rotatefastalt|watershed_reg")

Can also see Fedora's workaround to always use -lm - https://src.fedoraproject.org/rpms/leptonica/blob/rawhide/f/leptonica_cmake.patch#_41


Many of these look like test programs, so perhaps putting them behind a CMake option so that users can build only the INSTALL_PROGS would be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions