[Nagiosplug-help] Compile problem with Nagios-Plugins 1.4.2 onAIX

Jacob Laack JLaack at alegent.org
Mon Feb 20 06:59:03 CET 2006

I was compiling nagios-plugins-1.4.2 on AIX 5.1 ML9 with GNU gcc 3.3.2 and GNU make 3.80 found on this page http://www-03.ibm.com/servers/aix/products/aixos/linux/download.html  It turns out the floor function is used twice in the 1.4.2 version of check_swap.c but not in version 1.4.  After replacing all uses of "floor(x)" with "(double)(int)(x)", the check_swap plugin, along with the rest of them, compiled just fine.  There may be an incompatibility with AIX's linker and the floor function but anyone with more knowledge of compiling on AIX could probably tell us why.  However, the new check_swap plugin works just great!

It turns out practically everything you said was incorrect as well as mean spirited.  If you fully read my replies rather than harping on the few words you did bother to glimse, you'd see that I did try your tips both at the command line and inside the makefile with the same results.  However, if you had simply done "gcc --help" you'd see that one would have to pass "-bnoquiet", as well as all linker arguments, to gcc with the -Xlinker argument.

I wanted to thank you for the fragments of information I did get from your replies, however, your use of criticism, rudeness, and impatience have made this mailing list a hostile place to try to get information.  If you have knowledge that might benefit someone, please share it.  However, if all you have are scathing remarks that will make people feel foolish whiile building up your own self-image, please keep them to yourself.  You'll do yourself and the rest of the Nagios community a favor.


>>> Andreas Ericsson <ae at op5.se> 2/14/2006 2:31:50 PM >>>
Jacob Laack wrote:
> I did that and I get:
> gcc: `-b' must come at the start of the command line

So put it at the start of the command line then...

> Here are the differences between 1.4 and 1.4.2:
> # pwd
> /usr/local/nagios-plugins-1.4/plugins
> # rm check_swap
> # check_swap_LDFLAGS=-bloadmap make check_swap

.. and you forgot '-lmath', and you didn't edit the Makefile, you passed 
it from command-line (which I'm not sure AIX Make handles properly) ...

> gcc  -g -O2  -L. -o check_swap -bloadmap check_swap.o utils.o ../lib/libnagiosplug.a ../lib/libcoreutils.a popen.o ../intl/libintl.a -liconv

... meaning you should run

gcc -bloadmap -bnoquiet -L. check_swap.o utils.o ../lib/libnagiosplug.a 
../lib/libcoreutils.a popen.o ../intl/libintl.a -liconv -lmath

> gcc: `-b' must come at the start of the command line
> make: *** [check_swap] Error 1
> # make check_swap
> gcc  -g -O2  -L. -o check_swap  check_swap.o utils.o ../lib/libnagiosplug.a ../lib/libcoreutils.a popen.o ../intl/libintl.a -liconv
> # ls check_swap
> check_swap
> # cd ../../nagios-plugins-1.4.2/plugins
> # rm check_swap
> rm: check_swap: A file or directory in the path name does not exist.
> # check_swap_LDFLAGS=-bloadmap make check_swap
> gcc  -g -O2  -L. -o check_swap -bloadmap check_swap.o  utils.o ../lib/libnagiosplug.a ../lib/libcoreutils.a popen.o ../intl/libintl.a -liconv
> gcc: `-b' must come at the start of the command line
> make: *** [check_swap] Error 1
> # make check_swap
> gcc  -g -O2  -L. -o check_swap  check_swap.o  utils.o ../lib/libnagiosplug.a ../lib/libcoreutils.a popen.o ../intl/libintl.a -liconv
> ld: 0711-317 ERROR: Undefined symbol: .floor
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
> collect2: ld returned 8 exit status
> make: *** [check_swap] Error 1
> I'm guessing there's bug in check_swap.c or in the makefile for that plugin.

Could be, except that it builds just fine on just about all other unix 
systems. More likely there's either a bug in your linker, or you have 
non-standard libraries installed.

OTOH, you haven't, so far, tried a single thing I suggested, but rather 
a subset of it or in a manner different from what I asked you to do. If 
you want to try something different, then fine, but don't ask me why it 
doesn't work when you do, and don't ask me to provide more things to try 
that you can ignore.

Andreas Ericsson                   andreas.ericsson at op5.se 
OP5 AB                             www.op5.se 
Tel: +46 8-230225                  Fax: +46 8-230231

This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
Nagiosplug-help mailing list
Nagiosplug-help at lists.sourceforge.net 
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null

More information about the Help mailing list