AIX Open Source

 View Only
  • 1.  Can't build iozone on AIX 7.3

    IBM Champion
    Posted Thu February 02, 2023 02:13 PM
    Has anyone built iozone on AIX recently? I recall this used to build without much fuss, but it's not working for me on AIX 7.3.

    Though there is a build target for AIX64-LF that uses gcc, the first error out of the gate is 'signalhandler_t' undeclared which is a pretty standard Linux function.

    I must be missing a library. Hoping someone has some notes on building this. I'm using gcc from the toolkit.

    Thanks,
    Mario

    ------------------------------
    Mario Stargard
    ------------------------------


  • 2.  RE: Can't build iozone on AIX 7.3

    Posted Fri February 03, 2023 06:22 AM

    Hi Mario,

     

    Looks like sighandler_t is Linux specific definition for signal handler and it is defined for gnu libc.

    AIX signal handler is also of same type but it is not defined explicitly as it is not a POSIX requirement.

    But if you can create same definition in a header for AIX then I think it will work.

     

    https://man7.org/linux/man-pages/man2/signal.2.html

     

     

    Thanks,

     

    Sanket Rathi

     






  • 3.  RE: Can't build iozone on AIX 7.3

    IBM Champion
    Posted Fri February 03, 2023 08:56 AM
    Thanks.

    There's an xlc target in the makefile and I see that Perzl is using that. That's another approach. Maybe his binary works.

    http://www.oss4aix.org/download/SPECS/iozone-3-490-1.spec

    Mario

    ------------------------------
    Mario Stargard
    ------------------------------



  • 4.  RE: Can't build iozone on AIX 7.3

    IBM Champion
    Posted Fri February 03, 2023 09:16 AM
    And to answer my own question, it does not. Segfaults on AIX 7.3 when you try to run a test.

    ------------------------------
    Mario Stargard
    ------------------------------



  • 5.  RE: Can't build iozone on AIX 7.3

    IBM Champion
    Posted Fri February 03, 2023 10:07 AM
    And I got it working.

    The Perzl rpm installs 4 binaries, one for each target, in /opt/freeware/bin and creates a symlink in /usr/bin/iozone to the AIX64-LF target. Some testing reveals that the 64bit targets won't work. It looks to me like they sigsegv when trying to set up threads. truss shows the last function __libc_sbrk.

    But the 32bit stuff works just fine AFAIK. So I just changed the symlink in /opt/freeware/bin/iozone to point to iozone_AIX-LF and we're off to the races.

    Fun fun. :-)


    ------------------------------
    Mario Stargard
    ------------------------------



  • 6.  RE: Can't build iozone on AIX 7.3

    Posted Wed May 08, 2024 11:34 AM

    Has anybody else gotten anywhere on this? Our security folks won't let me access Perzl's stuff, so I need to build this myself.


    The head of the output on the AIX build attempt (AIX 7.3 with xlC 16.1):

    Building iozone for AIX

    cc -c -O -D__AIX__ -D_NO_PROTO -Dunix -DHAVE_ANSIC_C  \
            -DNAME='"AIX"' -DSHARED_MEM   iozone.c -o iozone_AIX.o
    "iozone.c", line 1040.1: 1506-166 (S) Definition of function sighandler_t requires parentheses.
    "iozone.c", line 1040.14: 1506-276 (S) Syntax error: possible missing '{'?
    "iozone.c", line 1450.25: 1506-045 (S) Undeclared identifier write_perf_test.
    "iozone.c", line 1452.25: 1506-045 (S) Undeclared identifier random_perf_test.
    "iozone.c", line 1453.25: 1506-045 (S) Undeclared identifier reverse_perf_test.
    "iozone.c", line 1454.25: 1506-045 (S) Undeclared identifier rewriterec_perf_test.
    "iozone.c", line 1455.25: 1506-045 (S) Undeclared identifier read_stride_perf_test.
    "iozone.c", line 1456.25: 1506-045 (S) Undeclared identifier fwrite_perf_test.
    "iozone.c", line 1457.25: 1506-045 (S) Undeclared identifier fread_perf_test.

    ...

    There's a lot more. I'm only good enough at C to ruin stuff, but seems like a syntax error in the source is cascading through the rest of the compile. But this project is more complicated than my skills allow me to troubleshoot.

    This attempting to build the current iozone 3.506 version.

    The AIX64 gcc target complains about missing string.h. Adding an include for that at the top of iozone.c cleans up those messages and leaves us with this bit of explody aournd the sighandler_t functions:

    Building iozone for AIX64

    /opt/freeware/bin/gcc -maix64 -c -O3 -D__AIX__ -D_NO_PROTO -Dunix -DHAVE_ANSIC_C \
                  -DASYNC_IO -DNAME='"AIX64"' -DSHARED_MEM \
                   iozone.c -o iozone_AIX64.o
    iozone.c:1042:1: error: unknown type name 'sighandler_t'; did you mean 'rsethandle_t'?
     1042 | sighandler_t signal_handler(void); /* clean up if user interrupts us */
          | ^~~~~~~~~~~~
          | rsethandle_t
    iozone.c: In function 'main':
    iozone.c:1937:28: error: 'sighandler_t' undeclared (first use in this function); did you mean 'rsethandle_t'?
     1937 |      signal((int) SIGINT, (sighandler_t) signal_handler); /* handle user interrupt */
          |                            ^~~~~~~~~~~~
          |                            rsethandle_t

    ...




    ------------------------------
    Andrew Scott
    ------------------------------



  • 7.  RE: Can't build iozone on AIX 7.3

    Posted Wed May 08, 2024 02:38 PM

    And I have (sort-of) answered my own question.

    Iozone 3-405 will build using a mix of GCC and CC using the AIX64-LF target.
    It needs gcc for the compile but uses cc for the link. So you'll need xlc. I'm guessing (but did not test) the restricted version that comes on the AIX DVD should work since it only needs it for the link and not the compile.

    So, if anybody finds this and are trying to build iozone on AIX and it's barfing, back up a few versions until it works!




    ------------------------------
    Andrew Scott
    ------------------------------