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


#Servers
#Opensource
 View Only
  • 1.  AIX 7.3 - Needs advice for compiling C++ app

    Posted 07/11/23 05:18 AM

    Hello,

    I need to compile a C++ application on AIX7.3. This application was previously built on AIX 6.1.0.0 by using autotools and xlC compiler.

    I moved all sources to AIX7.3 and tried  to launch  the chain ./configure, make. The configure script checked for xlC_r, ibm-clang++_r, g++ and found g++ was the compiler to use (ibm-clang++_r is installed but not selected by configure).

    I ran make and then got a fatal error     #include <bits/c++config.h>  not found, effectively it does exist on my AIX.

    So, autotools being quite old ( is CMake the solution ?) I tried to install CMake on AIX7.3 but only found packages for 7.2, so i downloaded code sources from official CMake 3.26.4 website and followed the build guideline  with ./boostrap make. I got the same issue. g++ is the selected compiler and it complains <bis/c++config.h> is not found.

    It seems i have an issue with my gcc/g++ installations (missing <bits/c++config.h> ?   

    Why ibm-clang++_r is not selected. 

    Is CMake compatible with AIX7.3 at this time? if no, will it be ?

    It will be nice if you could give me advice

    Thanks

    best regards



    ------------------------------
    Laurent GUEDJ
    ------------------------------

    #AIXOpenSource



  • 2.  RE: AIX 7.3 - Needs advice for compiling C++ app

    Posted 07/12/23 03:36 AM

    Hi Laurent,

    is the application you're trying to compile an open source application? Can you point to the repository?

    Regarding CMake on AIX 7.3. It works and can be installed from AIX Toolbox:

    # oslevel
    7.3.0.0
    # dnf search cmake
    Last metadata expiration check: 0:00:35 ago on Wed Jul 12 09:30:35 2023.
    ========================================== Name Exactly Matched: cmake ==========================================
    cmake.ppc : Cross-platform, open-source build system
    ========================================= Name & Summary Matched: cmake =========================================
    cmake-data.ppc : Common data-files for cmake
    # dnf info cmake
    Last metadata expiration check: 0:00:40 ago on Wed Jul 12 09:30:35 2023.
    Available Packages
    Name         : cmake
    Version      : 3.22.0
    Release      : 1
    Architecture : ppc
    Size         : 26 M
    Source       : cmake-3.22.0-1.src.rpm
    Repository   : AIX_Toolbox
    Summary      : Cross-platform, open-source build system
    URL          : http://www.cmake.org
    License      : BSD
    Description  : CMake is used to control the software compilation process using simple
                 : platform and compiler independent configuration files. CMake generates
                 : native makefiles and workspaces that can be used in the compiler
                 : environment of your choice. CMake is quite sophisticated: it is possible
                 : to support complex environments requiring system configuration, pre-processor
                 : generation, code generation, and template instantiation.
                 : 
                 : Behavior of CMake on AIX has been changed in 3.14 to obey to AIX rules.
                 : See /opt/freeware/share/cmake-3.16/Modules/readme_aix.txt for more informations.
    
    
    

    c++config.h is also there after a fresh GCC installation:

    # find /opt/freeware -name 'c++config*' 
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.3.0.0/10/include/c++/powerpc-ibm-aix7.3.0.0/bits/c++config.h
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.3.0.0/10/include/c++/powerpc-ibm-aix7.3.0.0/ppc64/bits/c++config.h
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.3.0.0/10/include/c++/powerpc-ibm-aix7.3.0.0/pthread/bits/c++config.h
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.3.0.0/10/include/c++/powerpc-ibm-aix7.3.0.0/pthread/ppc64/bits/c++config.h
    

    afaiu the usual cause for the problem is that you upgraded the system after GCC installation. You can reinstall GCC packages or you can execute the post-install script from GCC RPM package:

    # Regen include-fixed directory to avoid getting wrong headers being used.
    # Export LIBPATH for sed
    export LIBPATH=/opt/freeware/lib:/usr/lib:/lib
    //opt/freeware/libexec/gcc/powerpc-ibm-aix7.3.0.0/10/install-tools/mkheaders
    



    ------------------------------
    Andrey Klyachkin

    https://www.power-devops.com
    ------------------------------