AIX Open Source

AIX Open Source

Share your experiences and connect with fellow developers to discover how to build and manage open source software for the AIX operating system


#Operatingsystems
#Opensource
#AIX
#AIX Open Source
 View Only
  • 1.  Compiling mrtg on AIX 7.2 fails because of gd

    Posted Wed March 09, 2022 05:22 AM
    Edited by Dieter Mosbach Wed March 09, 2022 05:47 AM
    Because there is no rpm package for mrtg I tried to compile mrtg-2.17.10.

    configure works fine:

    cd /tmp/mrtg-2.17.10 && ./configure


    checking for gdImageGif in -lgd... yes
    checking for gdImagePng in -lgd... yes
    checking for gdImagePng_jpg in -lgd... no
    checking for gdImagePng_jpg_ft in -lgd... no
    checking gd.h usability... yes
    checking gd.h presence... yes
    checking for gd.h... yes


    but make fails:

    root@sps:/tmp/mrtg-2.17.10# cd /tmp/mrtg-2.17.10 && make
    gcc -mtune=power8 -mcpu=power8 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_ALL_SOURCE -DFUNCPROTO=15 -Wno-overlength-strings -Wno-implicit-function-declaration -O -I/opt/freeware/include -I/opt/freeware/include/python2.7 -L/opt/freeware/lib -Wall -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline -W -DHAVE_CONFIG_H -c ./src/rateup.c -o bin/rateup.o
    gcc bin/rateup.o -o bin/rateup -L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000 -lgd -lpng -lz -lm
    ld: 0711-317 ERROR: Undefined symbol: .gdImageCreate
    ld: 0711-317 ERROR: Undefined symbol: .gdImageColorAllocate
    ld: 0711-317 ERROR: Undefined symbol: .gdImageInterlace
    ld: 0711-317 ERROR: Undefined symbol: .gdImageColorTransparent
    ld: 0711-317 ERROR: Undefined symbol: .gdImageLine
    ld: 0711-317 ERROR: Undefined symbol: gdFontSmall
    ld: 0711-317 ERROR: Undefined symbol: .gdImageString
    ld: 0711-317 ERROR: Undefined symbol: .gdImageRectangle
    ld: 0711-317 ERROR: Undefined symbol: .gdImageSetStyle
    ld: 0711-317 ERROR: Undefined symbol: .gdImageStringUp
    ld: 0711-317 ERROR: Undefined symbol: .gdImageSetBrush
    ld: 0711-317 ERROR: Undefined symbol: .gdImagePng
    ld: 0711-317 ERROR: Undefined symbol: .gdImageDestroy
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    collect2: error: ld returned 8 exit status
    make: 1254-004 The error code from the last command is 1.


    Stop.


    root@sps:/root# oslevel -s
    7200-05-03-2148

    root@sps:/root# rpm -q libgd libgd-devel gcc gcc8
    libgd-2.2.5-3.ppc
    libgd-devel-2.2.5-3.ppc
    gcc-8-1.ppc
    gcc8-8.3.0-6.ppc


    root@sps:/root# more .profile
    export CONFIG_SHELL=/opt/freeware/bin/bash
    export CONFIG_ENV_ARGS=/opt/freeware/bin/bash

    export CC=gcc
    export CFLAGS="\
    -mtune=power8 -mcpu=power8 \
    -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_ALL_SOURCE -DFUNCPROTO=15 \
    -Wno-overlength-strings -Wno-implicit-function-declaration \
    -O -I/opt/freeware/include -I/opt/freeware/include/python2.7 \
    -L/opt/freeware/lib"

    export LD=ld
    export LDFLAGS="\
    -L/opt/freeware/lib64 -L/opt/freeware/lib \
    -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib \
    -Wl,-bmaxdata:0x80000000"



    Any help would  be appreciated.

    ------------------------------
    Dieter Mosbach
    ------------------------------


  • 2.  RE: Compiling mrtg on AIX 7.2 fails because of gd

    Posted Wed March 09, 2022 06:12 AM
    You are doing a 32bit build. So your LDFLAGS should not have "-L/opt/freeware/lib64".

    ------------------------------
    Ayappan P
    ------------------------------



  • 3.  RE: Compiling mrtg on AIX 7.2 fails because of gd

    Posted Wed March 09, 2022 07:10 AM
    Thank you very much!

    I removed L/opt/freeware/lib64 from LDFLAGS in .profile
    and now I can compile mrtg and build rpm.

    ------------------------------
    Dieter Mosbach
    ------------------------------



  • 4.  RE: Compiling mrtg on AIX 7.2 fails because of gd

    Posted Wed March 09, 2022 09:10 AM
    Another question:

    is gcc8 too old for POWER9?

    gcc -mtune=power9 -mcpu=power9 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_ALL_SOURCE -DFUNCPROTO=15 -Wno-overlength-strings -Wno-implicit-function-declaration -O -I/opt/freeware/include -I/opt/freeware/include/python2.7 -L/opt/freeware/lib -Wall -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline -W -DHAVE_CONFIG_H -c ./src/rateup.c -o bin/rateup.o
    cc1: warning: will not generate 'power9' instructions because assembler lacks 'power9' support

    Should I update to gcc10?

    ------------------------------
    Dieter Mosbach
    ------------------------------



  • 5.  RE: Compiling mrtg on AIX 7.2 fails because of gd

    Posted Wed March 09, 2022 11:04 AM
    I found:

    "GNU compilers : default is gcc-4.8.5 which does not support -mcpu=power9
    gcc/6.4.0 and gcc/8.1.0 have good power9 support"

    seems that  gcc8-8.3.0-6.ppc should be new enough...

    root@sps:/root# find /opt -name cc1 -ls
    147522 26835 -rwxr-xr-x 1 root system 27478134 Aug 15 2021 /opt/freeware/libexec/gcc/powerpc-ibm-aix7.2.0.0/8/cc1

    root@sps:/root# rpm -qf /opt/freeware/libexec/gcc/powerpc-ibm-aix7.2.0.0/8/cc1
    gcc8-cpp-8.3.0-6.ppc

    ------------------------------
    Dieter Mosbach
    ------------------------------



  • 6.  RE: Compiling mrtg on AIX 7.2 fails because of gd

    Posted Wed March 09, 2022 11:42 AM
    Hi Mosbach

    gcc10 has better power9 support than gcc8 hence it's better to move to gcc10.

    ------------------------------
    SANGAMESH
    ------------------------------



  • 7.  RE: Compiling mrtg on AIX 7.2 fails because of gd

    Posted Wed March 09, 2022 12:06 PM
    How can I migrate from gcc8 to gcc10?

    Adding all gcc10-rpms seems not to be enough..

    ------------------------------
    Dieter Mosbach
    ------------------------------



  • 8.  RE: Compiling mrtg on AIX 7.2 fails because of gd

    Posted Thu March 10, 2022 02:33 AM
    As of now the default gcc is still gcc8.
    To use gcc10 you need to set the CC & CXX flags to gcc-10 & g++-10

    ------------------------------
    SANGAMESH
    ------------------------------



  • 9.  RE: Compiling mrtg on AIX 7.2 fails because of gd

    Posted Thu March 10, 2022 08:41 AM
    ok, thanks.

    Works now:

    + gmake
    gcc-10 -mtune=power9 -mcpu=power9 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_ALL_SOURCE -DFUNCPROTO=15 -Wno-overlength-strings -Wno-implicit-function-declaration -O -I/opt/freeware/include -I/opt/freeware/include/python2.7 -L/opt/freeware/lib -Wall -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline -W -DHAVE_CONFIG_H -c ./src/rateup.c -o bin/rateup.o


    ------------------------------
    Dieter Mosbach
    ------------------------------