Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'malloc.h' file not found, use of undeclared identifier in common.c error #557

Closed
srgrj opened this issue Jun 14, 2016 · 3 comments
Closed

Comments

@srgrj
Copy link

srgrj commented Jun 14, 2016

Hello Guys,

I am having issue while installing netdata, Please see below the error

Making all in src
gcc -DHAVE_CONFIG_H -I. -I.. -DVARLIB_DIR=""/var/lib/netdata"" -DCACHE_DIR=""/var/cache/netdata"" -DCONFIG_DIR=""/etc/netdata"" -DLOG_DIR=""/var/log/netdata"" -DPLUGINS_DIR=""/usr/libexec/netdata/plugins.d"" -DRUN_DIR=""/var/run/netdata"" -DWEB_DIR=""/usr/share/netdata/web"" -O3 -D_THREAD_SAFE -pthread -MT apps_plugin.o -MD -MP -MF .deps/apps_plugin.Tpo -c -o apps_plugin.o apps_plugin.c
apps_plugin.c:27:10: fatal error: 'malloc.h' file not found

include <malloc.h>

     ^

1 error generated.
make[2]: *** [apps_plugin.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

i did check for malloc.h and it exists, PFB

XXXXXXXX-MacBook-Pro:netdata XXXXXX$ ls -lrth /usr/include/malloc/malloc.h
-rw-r--r-- 1 root wheel 13K Dec 10 2015 /usr/include/malloc/malloc.h

I am trying to install this on MacBook Pro with El Capitan 10.11.5

Please Help

@srgrj
Copy link
Author

srgrj commented Jun 14, 2016

Well, i could solve this issue by changing the #include <malloc.h> to #include <malloc/malloc.h> in src/procfile.c and src/apps_plugin.c file but, i am getting a different error now in common.c file PFB the error

Making all in src
gcc -DHAVE_CONFIG_H -I. -I.. -DVARLIB_DIR=""/var/lib/netdata"" -DCACHE_DIR=""/var/cache/netdata"" -DCONFIG_DIR=""/etc/netdata"" -DLOG_DIR=""/var/log/netdata"" -DPLUGINS_DIR=""/usr/libexec/netdata/plugins.d"" -DRUN_DIR=""/var/run/netdata"" -DWEB_DIR=""/usr/share/netdata/web"" -O3 -D_THREAD_SAFE -pthread -MT common.o -MD -MP -MF .deps/common.Tpo -c -o common.o common.c
common.c:683:37: error: use of undeclared identifier 'O_NOATIME'
fd = open(filename, O_RDWR|O_CREAT|O_NOATIME, 0664);
^
common.c:695:36: error: use of undeclared identifier 'MADV_DONTFORK'
int advise = MADV_SEQUENTIAL|MADV_DONTFORK;
^
common.c:754:44: error: use of undeclared identifier 'O_NOATIME'
int fd = open(tmpfilename, O_RDWR|O_CREAT|O_NOATIME, 0664);
^
3 errors generated.
make[2]: *** [common.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

@srgrj srgrj changed the title 'malloc.h' file not found 'malloc.h' file not found, use of undeclared identifier in common.c error Jun 14, 2016
@ktsaou
Copy link
Member

ktsaou commented Jun 14, 2016

This is probably a duplicate of #124

I am afraid it will not work. Check #112 and #187 that discuss FreeBSD support (that is very close to OS X).

Even if it compiles, there will not be much it can do, as it requires the Linux /proc filesystem for collecting data. There are a few suggestions for implementing more generic data collection, like #481 but no progress has been done towards this target (I need help - too many feature requests).

@ktsaou
Copy link
Member

ktsaou commented Jun 26, 2016

Cleaning up. Let's discuss non-Linux support on the issues mentioned above.

@ktsaou ktsaou closed this as completed Jun 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants