From: Michael P. <mi...@pe...> - 2010-01-15 16:29:44
|
Hi Daniel, I gave this tar-ball a quick try and here is the outcome: I built it on my AIX 5.3 build host and you have to have the following RPMs installed as prereqs for Ganglia to compile (you can get all those from my website http://www.perzl.org/aix): Here are the versions I used: apr-1.3.9 and apr-devel-1.3.9 libconfuse-2.6 and libconfuse-devel-2.6 expat-2.0.1 and expat-devel-2.0.1 rrdtool-1.2.30 and rrdtool-devel 1.2.30 Please keep in mind that these RPMs again have prereqs which I am not listing here. Then I started the configure process as follows (using bash as shell): CC="xlc_r -U_AIX43" ./configure --prefix=/var/tmp/gg --enable-shared --disable-static --with-gmetad --disable-python --sysconfdir=/etc/ganglia which finished successfully. The compilation (just using "make") ran successfully until the gmond link step. The changed patch of BUG227 looks good to me, however now that "fabsf()" is required the link step fails as no "-lm" is specified for the gmond link step. Just adding "-lm" to the link step (see below) did it: /opt/freeware/bin/bash ../libtool --tag=CC --mode=link xlc_r -U_AIX43 -qlanglvl=extc99 -I../lib -I../include/ -I../libmetrics -D_LARGEFILE64_SOURCE -DSYSCONFDIR='"/etc/ganglia"' -qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include -D_ALL_SOURCE -DAIX -DHAVE_PERFSTAT -Wl,-bexpfull -L/opt/freeware/lib -L/opt/freeware/lib -o gmond gmond.o cmdline.o g25_config.o core_metrics.o ../libmetrics/libmetrics.la ../lib/libganglia.la ../lib/libgetopthelper.a -ldl -lperfstat -lcfg -lodm -lnsl -lnsl -lpcre -lexpat -lconfuse -lapr-1 -lpthreads -lpthread -lm The remaining compilation then runs without any errors until finished. So the GNU autotools guru need to figure out how to add an "-lm" to gmond/Makefile.am (please see the patch in a different content below). Some more comments on the libmetrics/aix/metrics file: Please note all patches are done on the Ganglia 3.1.2 version, so the line numbers might be slightly off for the 3.1.5 version. The following patch is absolutely required to get it working on AIX 6.1: *************** *** 814,822 **** */ /* * AIX > 4.2 uses bos.mp or bos.up */ getit = ODM_FIRST; ! while ((rc = (int)odm_get_obj(my_cl, "name like bos.?p", &productobj, getit)) != 0) { getit = ODM_NEXT; if (rc == -1) { --- 834,843 ---- */ /* * AIX > 4.2 uses bos.mp or bos.up + * AIX >= 6.1 uses bos.mp64 */ getit = ODM_FIRST; ! while ((rc = (int)odm_get_obj(my_cl, "name like bos.?p*", &productobj, getit)) != 0) { getit = ODM_NEXT; if (rc == -1) { The following patch is just cosmetics but nevertheless: *************** *** 832,838 **** } } /* ! * AIX < 4.2 uses bos.mp or bos.up */ if (!found) { getit = ODM_FIRST; --- 853,859 ---- } } /* ! * AIX < 4.2 uses bos.rte.mp or bos.rte.up */ if (!found) { getit = ODM_FIRST; Now the more serious issue with DSOs on AIX: In the current gmond compilation setup DSOs unfortunately don't work: ganglia-3.1.5.2236/gmond> ./gmond -m Cannot load /var/tmp/gg/lib/ganglia/modcpu.so metric module: 0509-022 Cannot load module /var/tmp/gg/lib/ganglia/modcpu.so. 0509-026 System error: A file or directory in the path name does not exist. Cannot load /var/tmp/gg/lib/ganglia/moddisk.so metric module: 0509-022 Cannot load module /var/tmp/gg/lib/ganglia/moddisk.so. 0509-026 System error: A file or directory in the path name does not exist. Cannot load /var/tmp/gg/lib/ganglia/modload.so metric module: 0509-022 Cannot load module /var/tmp/gg/lib/ganglia/modload.so. 0509-026 System error: A file or directory in the path name does not exist. Cannot load /var/tmp/gg/lib/ganglia/modmem.so metric module: 0509-022 Cannot load module /var/tmp/gg/lib/ganglia/modmem.so. 0509-026 System error: A file or directory in the path name does not exist. Cannot load /var/tmp/gg/lib/ganglia/modnet.so metric module: 0509-022 Cannot load module /var/tmp/gg/lib/ganglia/modnet.so. 0509-026 System error: A file or directory in the path name does not exist. Cannot load /var/tmp/gg/lib/ganglia/modproc.so metric module: 0509-022 Cannot load module /var/tmp/gg/lib/ganglia/modproc.so. 0509-026 System error: A file or directory in the path name does not exist. Cannot load /var/tmp/gg/lib/ganglia/modsys.so metric module: 0509-022 Cannot load module /var/tmp/gg/lib/ganglia/modsys.so. 0509-026 System error: A file or directory in the path name does not exist. Cannot load /var/tmp/gg/lib/ganglia/modibmpower.so metric module: 0509-022 Cannot load module /var/tmp/gg/lib/ganglia/modibmpower.so. 0509-026 System error: A file or directory in the path name does not exist. heartbeat Last heartbeat (module core_metrics) location Location of the machine (module core_metrics) gexec gexec available (module core_metrics) The following patch to gmond/Makefile.am is absolutely required to make DSOs work on AIX: *************** *** 13,20 **** endif else GCFLAGS = -D_LARGEFILE64_SOURCE ! GLDADD = ! GLDFLAGS = -export-dynamic endif INCLUDES = @APR_INCLUDES@ --- 14,21 ---- endif else GCFLAGS = -D_LARGEFILE64_SOURCE ! GLDADD = -lm ! GLDFLAGS = -Wl,-bexpfull endif INCLUDES = @APR_INCLUDES@ The reason behind is that "-export-dynamic" is then later expanded to the AIX linker option "-berok" (which allows a library to have unresolved symbols) but this is absolutely deadly - because you would have to let the linker know during the link step an import file of unknown symbols. To fix this on a general level for libtool is beyond my skills, therefore I always apply the following strategy: * Never use "-berok" for a linker flag but force all symbols to be resolved (via "-bernotok" linker flag) * Make sure all symbols are exported (via the "-Wl,-bexpfull" linker flag) I also had to apply the following patch to libmetrics/aclocal.m4 (essentially removing any "-berok" occurrences): *** libmetrics/aclocal.m4.ORIG Fri Feb 13 17:04:11 2009 --- libmetrics/aclocal.m4 Wed Feb 18 23:18:38 2009 *************** *** 2958,2964 **** if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. ! _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" --- 2958,2964 ---- if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. ! _LT_AC_TAGVAR(allow_undefined_flag, $1)='' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" *************** *** 2976,2982 **** # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' ! _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes --- 2976,2982 ---- # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' ! _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes *************** *** 5744,5750 **** if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. ! _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" --- 5744,5750 ---- if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. ! _LT_AC_TAGVAR(allow_undefined_flag, $1)='' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" *************** *** 5761,5767 **** # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' ! _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes --- 5761,5767 ---- # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' ! _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ' # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes By removing the "allow_undefined_flag" AIX will run into an immediate compile error and not produce broken libraries where you run into problems only at runtime.... Hope that helps.... Regards, Michael On 01/15/2010 12:34 PM, Daniel Pocock wrote: > > > I've created branches/monitor-core-3.1-aix and applied the following: > > BUG226: detect virtual IO server > > BUG227: I've modified the patch to try and selectively set the linker > flags for AIX and for fabsf on AIX < 5.2 > > I'd also like to test the effect the new autotools have on AIX > > Therefore, I've created a tarball of the branch, bootstrapped on > Debian 5. As I don't have an AIX box, is someone able to help test > this and provide feedback? > > It is at: > > http://www.pocock.com.au/ganglia/test/aix-branch > > I can also bootstrap on other environments if necessary to provide > something to compare with. > > |