bert.cpp icon indicating copy to clipboard operation
bert.cpp copied to clipboard

models CMakeLists.txt with -lrt required for some versions of ld

Open Thireus opened this issue 2 years ago • 1 comments

Some versions of ld are causing the following issue: undefined reference to `clock_gettime'

https://stackoverflow.com/questions/2418157/c-error-undefined-reference-to-clock-gettime-and-clock-settime

Can be replicated with "conda install -c conda-forge gxx_linux-64", which uses "GNU ld (GNU Binutils) 2.39".

Thireus avatar May 18 '23 17:05 Thireus

Hi, thanks for the PR and bringing this issue up. Any idea if this is going to cause issues on systems without lib rt? E.g. https://stackoverflow.com/questions/49268901/issue-when-linking-with-lrt-on-mac-osx

I'm really bad at cmake, but would something like this work?

if (UNIX)
  link_libraries("-lrt")
endif()

skeskinen avatar May 19 '23 09:05 skeskinen