[collectd] Compilation errors

Sebastian Harl sh at tokkee.org
Fri Oct 26 12:13:01 CEST 2007

Hi Aleksandr,

On Fri, Oct 26, 2007 at 12:16:13PM +0300, a.shubnik at btis.by wrote:
>      I have some trouble with compilation process.
>      When i try to use option '--enable-iptables' 'with configure' script
> it finished OK, but when i then start 'make' i get follow errors:

You should not explicitly enable any plugins unless you have a very specific
reason for it. The configure script should only disable plugins which cannot
be build because of missing dependencies, so, usually, you will have to check
for those if a plugin does not get build automatically.

> if /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.  
> -I.    -Wall -Werror -g -O2 -MT iptables.lo -MD -MP -MF  
> ".deps/iptables.Tpo" -c -o iptables.lo iptables.c; \
> then mv -f ".deps/iptables.Tpo" ".deps/iptables.Plo"; else rm -f  
> ".deps/iptables.Tpo"; exit 1; fi
>   gcc -DHAVE_CONFIG_H -I. -I. -I. -Wall -Werror -g -O2 -MT iptables.lo -MD  
> -MP -MF .deps/iptables.Tpo -c iptables.c  -fPIC -DPIC -o .libs/iptables.o
> cc1: warnings being treated as errors
> iptables.c:198: warning: 'struct ipt_entry' declared inside parameter list

... in this case, you're missing the iptables headers (libiptc).

Florian, I think, we should remove all the HAVE_FOO_H checks from plugins that
require specific headers. This should provide more reasonable error messages
to the users when a build fails.

>     And second problem. On x86_64 system i can't compile 'collectd-4.1.3'  
> without use
> any specific options (all by default). 'configure' script finished without  
> errors but
> 'make' command finished with errors:
> ...
> gcc -shared  .libs/netlink_la-netlink.o  -lnetlink  -Wl,-soname  
> -Wl,netlink.so -o .libs/netlink.so
> /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld:  
> /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../lib64/libnetlink.a(libnetlink.o):  
> relocation R_X86_64_32 against `a local symbol' can not be used when  
> making a shared object; recompile with -fPIC

This is a common error on a lot of (mostly 64bit) architectures. You need a
version of the library (libnetlink in this case) which has been compiled with
-fPIC. See Debian bugs #358637 ([1]), #419684 ([2]) and #430933 ([3]) for more
details about this issue.

You'll have to nag your distributor to provide a suitable version of the
library (netlink and nut probably come up with the same issue) or compile it

Florian, I think this should be added to the FAQ as it appears quite
frequently. I will write an answer for it later and ping you on IRC.


[1] http://bugs.debian.org/358637
[2] http://bugs.debian.org/419684
[3] http://bugs.debian.org/430933

Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20071026/07aa370c/attachment.pgp 

More information about the collectd mailing list