Skip to content

Conversation

@Thireus
Copy link

@Thireus Thireus commented May 18, 2023

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".

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 Thireus changed the title -lrt required for some versions of ld models CMakeLists.txt with -lrt required for some versions of ld May 18, 2023
@skeskinen
Copy link
Owner

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants