Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  gcc compile errors on AIX 7.2

    Posted Fri June 17, 2022 02:58 PM
    I have gcc 8.3.0-6 installed on both an AIX 7.1 and AIX 7.2 system.  On the AIX 7.1 system everything compiles fine.  On the AIX 7.2 system, most things compile, but if a program is including <math.h> then I get compile errors like this:

    $ gmake
    g++ -o obj/adf_extract.o -fPIC -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -Isrc -I. -MMD -I ~db2dev/sqllib/include -O2 -funsigned-char -maix64 -c src/adf_extract.cpp
    In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/math.h:36,
    from src/InsertText.h:20,
    from src/MpUpdateRequests.h:10,
    from src/MergeElement.h:13,
    from src/MergeControl.h:12,
    from src/adf_extract.cpp:6:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/cmath:83:11: error: '::acos' has not been declared
    using ::acos;
    ^~~~
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/cmath:102:11: error: '::asin' has not been declared
    using ::asin;
    ^~~~
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/cmath:121:11: error: '::atan' has not been declared
    using ::atan;
    ^~~~

    and on and on.

    I compared the files /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/cmath and /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include/c++/cmath and they have the same checksum.  Same for /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/math.h.

    I compared the environments and don't see anything different.

    $ oslevel -s
    7100-05-02-1810
    $ g++ -v
    Using built-in specs.
    COLLECT_GCC=g++
    COLLECT_LTO_WRAPPER=/opt/freeware/libexec/gcc/powerpc-ibm-aix7.1.0.0/8/lto-wrapper
    Target: powerpc-ibm-aix7.1.0.0
    Configured with: ../gcc-8.3.0/configure --prefix=/opt/freeware --mandir=/opt/freeware/man --infodir=/opt/freeware/info --with-local-prefix=/opt/freeware --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran,go --enable-version-specific-runtime-libs --disable-nls --enable-decimal-float=dpd --disable-libstdcxx-pch --enable-__cxa_atexit --disable-werror --enable-libstdcxx-filesystem-ts --with-gcc-major-version-only --program-suffix=-8 --disable-rpath --host=powerpc-ibm-aix7.1.0.0
    Thread model: aix
    gcc version 8.3.0 (GCC)


    $ oslevel -s
    7200-05-03-2148
    $ g++ -v
    Using built-in specs.
    COLLECT_GCC=g++
    COLLECT_LTO_WRAPPER=/opt/freeware/libexec/gcc/powerpc-ibm-aix7.2.0.0/8/lto-wrapper
    Target: powerpc-ibm-aix7.2.0.0
    Configured with: ../gcc-8.3.0/configure --prefix=/opt/freeware --mandir=/opt/freeware/man --infodir=/opt/freeware/info --with-local-prefix=/opt/freeware --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-languages=c,c++,fortran,go --enable-version-specific-runtime-libs --disable-nls --enable-decimal-float=dpd --disable-libstdcxx-pch --enable-__cxa_atexit --disable-werror --enable-libstdcxx-filesystem-ts --with-gcc-major-version-only --program-suffix=-8 --disable-rpath --host=powerpc-ibm-aix7.2.0.0
    Thread model: aix
    gcc version 8.3.0 (GCC)


    Thanks,


    ------------------------------
    Adam Swartz
    ------------------------------

    #AIXOpenSource


  • 2.  RE: gcc compile errors on AIX 7.2
    Best Answer

    Posted Mon June 20, 2022 11:55 AM
    I found the problem.  I had to reinstall gcc8-8.3.0-6.ppc.  For some reason on the 7.2 machine this was listing as an incomplete file:

    270377 1 -rw-r--r-- 1 root system 458 Jun 16 11:54 /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/math.h

    on 7.1 it was: 

    201157 90 -rw-r--r-- 1 root system 91699 Jun 3 10:00 /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/8/include-fixed/math.h

    doing dnf reinstall gcc8-8.3.0-6.ppc resulted in the new size of:

    307477 109 -rw-r--r-- 1 root system 111007 Jun 20 09:51 /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/math.h

    And now things compile fine again.  I had tried reinstall on gcc, but I guess I needed to be more specific.

    ------------------------------
    Adam Swartz
    ------------------------------



  • 3.  RE: gcc compile errors on AIX 7.2

    Posted Wed June 22, 2022 02:00 AM
    Edited by SANKET RATHI Wed June 22, 2022 03:20 AM
    Thank you Adam for sharing the info and solution.

    ------------------------------
    SANKET RATHI
    ------------------------------