Netdata Failed to Build on MacOS 12.4 Monterey

Hello!

I am new to NetData. If anyone can advise and help is highly appreciated.

I’m trying to install and compile NetData agent on MacOS 12.4 Monterey using the script provided without success.

See error below:

libnetdata/clocks/clocks.c:192:19: error: implicit declaration of function 'clock_nanosleep' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    while( (ret = clock_nanosleep(clock, TIMER_ABSTIME, &req, NULL)) != 0 ) {
                  ^
libnetdata/clocks/clocks.c:192:19: note: did you mean 'clock_sleep'?
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach/mach.h:137:25: note: 'clock_sleep' declared here
extern kern_return_t    clock_sleep(mach_port_t,
                        ^
libnetdata/clocks/clocks.c:192:42: error: use of undeclared identifier 'TIMER_ABSTIME'
    while( (ret = clock_nanosleep(clock, TIMER_ABSTIME, &req, NULL)) != 0 ) {
                                         ^
libnetdata/clocks/clocks.c:347:21: error: implicit declaration of function 'clock_nanosleep' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    while ((errno = clock_nanosleep(CLOCK_REALTIME, 0, &req, &rem)) != 0) {
                    ^
3 errors generated.
make[2]: *** [libnetdata/clocks/clocks.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Any suggestions?

Thanks @renantea for bringing this up.

We follow up this ticket in this [Bug]: Failed to build/compile in MacOS 12.4 Monterey · Issue #12981 · netdata/netdata · GitHub GH issue

Thanks @Tasos_Katsoulas1 . This issue has been resolved.

1 Like

Thanks for the heads up, (Fix up patched in: Fix nanosleep on platforms other than Linux by vlvkobal · Pull Request #12991 · netdata/netdata · GitHub thanks to @vlvkobal )

Cheers!