Ticket #122 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Successfull build for rrdtool on AIX v5.3 ML with xlc v8 using gxlc & gxlc++

Reported by: human Owned by: oetiker
Priority: major Milestone:
Component: misc Version: 1.2.24
Keywords: Cc:

Description

Notes for rrdtool v1.2.24 build on AIX 5.3 ML6 with xlc v8 using command gxlc & gxlc++
Please be aware that i am not a programmer!

Notes: 1) The test of rrdtool with rrdtool graph was only successfull with the option

        --enable-mmap

without this option the build was still successfull but a

rrdtool graph ....

was stuck into a _fp_fpscrx_sc after reading the database file and rrdtool uses almost 100% CPU.

truss /usr/bin/rrdtool graph --start 1194882493 --end 1194886093 --
width 300 --height 75 \
             --title weight --color BACK#ffffff \
             - DEF:sum="/ganglia/rrds/p690/node1/
weight.rrd:sum:AVERAGE"  \
              AREA:sum#0000ff:"node1 last hour (now -1.00)"

......
sigprocmask(0, 0x00000000, 0x2000C2D4)          = 0
close(3)                                        = 0
_fp_fpscrx_sc(0x00000002, 0xA0000100, 0x0000000C, 0xD0D5C3A8,
0x00000000, 0x0000006B, 0xF0F768B8, 0x00000011) = 0xA0000100 

2) During the make process i have got the error:

 ..... "jmpbuf" is not a member of "struct png_struct_def"

I took a look at /opt/freeware/include/png.h and found that ifdef statement

$ /usr/bin/grep -p jmpbuf  /opt/freeware/include/png.h
struct png_struct_def
{
#ifdef PNG_SETJMP_SUPPORTED
   jmp_buf PNG_jmpbuf;            /* used in png_error */
#endif

After patching the pngsize.c

$ cat rrdtool-1.2.13-AIX-jmpbuf.patch
*** rrdtool-1.2.13/src/pngsize.c.orig   Tue Nov 13 17:45:24 2007
--- rrdtool-1.2.13/src/pngsize.c        Tue Nov 13 17:42:00 2007
***************
*** 29,35 ****
  #undef jmpbuf
  #endif

!   if (setjmp(png_read_ptr->jmpbuf)){
      png_destroy_read_struct(&png_read_ptr, &info_ptr, (png_infopp)NULL);
      return 0;
    }
--- 29,35 ----
  #undef jmpbuf
  #endif

!   if (setjmp(png_read_ptr->PNG_jmpbuf)){
      png_destroy_read_struct(&png_read_ptr, &info_ptr, (png_infopp)NULL);
      return 0;
    }

the make process succeeded without problems.

Build environment:
Version of installed RPM Packages

$ lslpp -L | egrep "libpng|libtool|libart|zlib|freetype2"
  freetype2                  2.1.7-5    C     R    A free and portable TrueType
  freetype2-devel            2.1.7-5    C     R    FreeType development headers
  libart_lgpl               2.3.17-4    C     R    Library of graphics routines
  libart_lgpl-devel         2.3.17-4    C     R    Libraries and headers for
                                                   libart_lgpl. (/bin/rpm)
  libpng                     1.2.1-6    C     R    A library of functions for
  libpng-devel               1.2.1-6    C     R    Development tools for programs
  libtool                    1.5.8-1    C     R    The GNU libtool, which
  zlib                       1.2.3-3    C     R    The zlib compression and
  zlib-devel                 1.2.3-3    C     R    Header files and libraries for
                                                   zlib. (/bin/rpm)

Build script:

#!/usr/bin/bash
export PATH=/usr/local/bin:/opt/freeware/bin:/usr/vacpp/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11
export APP=rrdtool-1.2.24
export OS=AIX
touch $APP.$OS.now

mkdir $OS 2>/dev/null
cd $OS && rm -rf ./$APP
tar -xvf ../${APP}.tar
cd $APP

# Start patch
patch -p1 < ../../rrdtool-1.2.13-AIX-jmpbuf.patch
# Start build

export CONFIG_SHELL=/opt/freeware/bin/bash
export CONFIGURE_ENV_ARGS=/opt/freeware/bin/bash
export CC=gxlc
export CXX=gxlc++
./configure                     \
        --prefix=/opt/freeware  \
        --enable-perl-site-install      \
        --disable-ruby          \
        --disable-tcl           \
        --disable-python        \
        --disable-rrdcgi        \
        --disable-static        \
        --enable-pthread        \
        --enable-mmap


gmake
gmake site-perl-install
gmake install

hth Hajo Ehlers

Change History

comment:1 Changed 4 years ago by oetiker

Hi Hajo,

cool I'm sure many AIX users will love you for this patch ... can you try this? it has the advantage that it should compile with older versions of png too:

===================================================================
--- pngsize.c   (revision 1219)
+++ pngsize.c   (working copy)
@@ -29,7 +29,11 @@
 #undef jmpbuf
 #endif
 
-  if (setjmp(png_read_ptr->jmpbuf)){
+#ifndef png_jmpbuf
+#  define png_jmpbuf(png_ptr)   ((png_ptr)->jmpbuf)
+#endif
+
+  if (setjmp(png_jmpbuf(png_read_ptr))){
     png_destroy_read_struct(&png_read_ptr, &info_ptr, (png_infopp)NULL);
     return 0;
   }

comment:2 follow-up: ↓ 3 Changed 4 years ago by oetiker

  • Status changed from new to closed
  • Resolution set to fixed

comment:3 in reply to: ↑ 2 Changed 4 years ago by human

  • Status changed from closed to reopened
  • Resolution fixed deleted

Hi Tobi I added the patch and the compilation worked. But is the following section still needed ?

* this is to make compile on aix work since they seem to define jmpbuf
   to be _jmpbuf which breaks compilation */

#ifdef jmpbuf
#undef jmpbuf
#endif

I would add a comment like: In case png_jmpbuf does not exist we will redefine jmpbuf

Note:
The build was also successfull with these compile options

...
export CC=cc_r
export CXX=xlC_r
./configure                     \
        --prefix=/opt/freeware  \
        --enable-perl-site-install      \
        --disable-ruby          \
        --disable-tcl           \
        --disable-python        \
        --disable-static        \
        --enable-rrdcgi         \
        --enable-pthread        \
        --enable-mmap
gmake
...

BTW: I will open a new ticket since the first test with rrdtool graph runs fine but another run with a differnet time (later ) frame will hang.

tia Hajo

comment:4 Changed 4 years ago by oetiker

it is in 1.2.25 like this ...

comment:5 Changed 4 years ago by oetiker

  • Status changed from reopened to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.

NOTE: The content of this website is accessible with any browser. The graphical design though relies completely on CSS2 styles. If you see this text, this means that your browser does not support CSS2. Consider upgrading to a standard conformant browser like Mozilla Firefox or Opera but also Apple's Safari or KDE's Konqueror for example. It may also be that you are looking at a mirror page which did not copy the CSS for this page. Or if some pictu res are missing, then the mirror may not have picked up the contents of the inc directory.