BrunoLevy / geogram

a programming library with geometric algorithms
Other
1.8k stars 122 forks source link

error: ‘CLOCK_REALTIME’ undeclared #75

Closed dforero0896 closed 1 year ago

dforero0896 commented 1 year ago

Hi, I've just tried to compile geogram on a cluster and I got the following error. After googling a bit, I tried switching sys/time.h to time.h to no avail.

geogram/src/lib/third_party/glfw/src/posix_time.c: In function ‘_glfwPlatformInitTimer’:
geogram/src/lib/third_party/glfw/src/posix_time.c:44:31: error: ‘CLOCK_REALTIME’ undeclared (first use in this function)

Thanks in advance for any help!

dforero0896 commented 1 year ago

Sorry, 2 more minutes of google led me here https://stackoverflow.com/questions/71294793/gcc-clock-realtime-is-undeclared. The solution seems to be defining #define _GNU_SOURCE and #define _POSIX_C_SOURCE 1999309L.

BrunoLevy commented 1 year ago

If you are on a cluster, you probably don't need graphics and GUI, you can deactivate them by creating a file CMakeOptions.txt in geogram sources directory with the following line: set(GEOGRAM_LIB_ONLY ON)