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

 View Only
  • 1.  Adding Perl 5.30.3 (/opt/freeware/bin/perl) modules on AIX 7.3

    Posted Tue January 25, 2022 12:22 PM

    I'm trying to install the perl module XML::Parser for the current 64-bit /opt/freeware/bin/perl_64 (v5.30.3), but it fails to generate the Makefile. Also tried with 32-bit perl without avail.  I wonder, if the current version of gcc (v8.3.0) supports my attempt. Has someone already tried the same and can help me with this or do you know if its a bug?
    ---

    aixwm6tm13::root 52 => which perl
    /opt/freeware/bin/perl
    aixwm6tm13::root 53 => ls -l /opt/freeware/bin/perl
    lrwxrwxrwx 1 root system 7 Mar 31 2021 /opt/freeware/bin/perl -> perl_64*
    aixwm6tm13::root 54 => perl -v
    This is perl 5, version 30, subversion 3 (v5.30.3) built for ppc-aix-thread-multi-64all ...

    aixwm6tm13::root 55 => env|grep EXPAT
    EXPATLIBPATH=/opt/freeware/lib64
    EXPATINCPATH=/opt/freeware/include

    aixwm6tm13::root 56 => ls -l $EXPATLIBPATH/libexpat*
    -rwxr-xr-x 1 root system 1137182 Jun 24 2020 /opt/freeware/lib64/libexpat.a*
    aixwm6tm13::root 58 => ls -l $EXPATINCPATH/expat.h
    -rw-r--r-- 1 root system 41473 Jun 24 2020 /opt/freeware/include/expat.h

    aixwm6tm13::root 59 => gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    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)

    aixwm6tm13::root 60 => perl -MCPAN -eshell

    cpan shell -- CPAN exploration and modules installation (v2.29)
    Enter 'h' for help.

    cpan[1]> install XML::Parser
    Reading '/.cpan/Metadata'
    Database was generated on Tue, 25 Jan 2022 10:41:03 GMT
    Running install for module 'XML::Parser'
    Checksum for /.cpan/sources/authors/id/T/TO/TODDR/XML-Parser-2.46.tar.gz ok
    Scanning cache /.cpan/build for sizes
    ............................................................................DONE
    Configuring T/TO/TODDR/XML-Parser-2.46.tar.gz with Makefile.PL

    Expat must be installed prior to building XML::Parser and I can't find
    it in the standard library directories. Install 'expat-devel' (or
    'libexpat1-dev') package with your OS package manager. See 'README'.

    Or you can download expat from:

    http://sourceforge.net/projects/expat/

    If expat is installed, but in a non-standard directory, then use the
    following options to Makefile.PL:

    EXPATLIBPATH=... To set the directory in which to find libexpat

    EXPATINCPATH=... To set the directory in which to find expat.h

    For example:

    perl Makefile.PL EXPATLIBPATH=/home/me/lib EXPATINCPATH=/home/me/include

    Note that if you build against a shareable library in a non-standard location
    you may (on some platforms) also have to set your LD_LIBRARY_PATH environment
    variable at run time for perl to find the library.

    No 'Makefile' created TODDR/XML-Parser-2.46.tar.gz
    /opt/freeware/bin/perl Makefile.PL -- NOT OK
    Failed during this command:
    TODDR/XML-Parser-2.46.tar.gz : writemakefile NO -- No 'Makefile' created

    cpan[2]>


    I also tried to install Devel::Agent, which needs the gcc. This time it fails with prerequisite error (Perl 5.34.0 required):

    cpan[1]> install Devel::Agent
    Reading '/.cpan/Metadata'
    Database was generated on Tue, 25 Jan 2022 10:41:03 GMT
    Running install for module 'Devel::Agent'
    Checksum for /.cpan/sources/authors/id/A/AK/AKALINUX/Devel-Agent-0.007.tar.gz ok
    Scanning cache /.cpan/build for sizes
    ............................................................................DONE
    Configuring A/AK/AKALINUX/Devel-Agent-0.007.tar.gz with Makefile.PL
    Perl v5.34.0 required--this is only v5.30.3, stopped at Makefile.PL line 1.
    BEGIN failed--compilation aborted at Makefile.PL line 1.
    Warning: No success on command[/opt/freeware/bin/perl Makefile.PL]
    AKALINUX/Devel-Agent-0.007.tar.gz
    /opt/freeware/bin/perl Makefile.PL -- NOT OK
    Failed during this command:
    AKALINUX/Devel-Agent-0.007.tar.gz : writemakefile NO '/opt/freeware/bin/perl Makefile.PL' returned status 65280

    cpan[2]>



    ------------------------------
    Balthasar Nebel
    ------------------------------


  • 2.  RE: Adding Perl 5.30.3 (/opt/freeware/bin/perl) modules on AIX 7.3

    Posted Wed January 26, 2022 06:34 AM
    Edited by Balthasar Nebel Wed January 26, 2022 06:38 AM

    By the way, I just tried the same on AIX 7.1 and AIX 7.2 which worked. But back to AIX 7.3:

    I patched Makefile.PL to skip the CheckLib test in order to create a Makefile. While using this Makefile I see the following compile issue, which gets us closer to the root cause:

    aixwm6tm13::root 314 => make
    cp Parser/Encodings/x-euc-jp-unicode.enc blib/lib/XML/Parser/Encodings/x-euc-jp-unicode.enc
    cp Parser/Encodings/iso-8859-4.enc blib/lib/XML/Parser/Encodings/iso-8859-4.enc
    cp Parser/Style/Debug.pm blib/lib/XML/Parser/Style/Debug.pm
    cp Parser/Encodings/x-sjis-jisx0221.enc blib/lib/XML/Parser/Encodings/x-sjis-jisx0221.enc
    cp Parser/Encodings/Japanese_Encodings.msg blib/lib/XML/Parser/Encodings/Japanese_Encodings.msg
    cp Parser/Encodings/windows-1255.enc blib/lib/XML/Parser/Encodings/windows-1255.enc
    cp Parser/Encodings/x-euc-jp-jisx0221.enc blib/lib/XML/Parser/Encodings/x-euc-jp-jisx0221.enc
    cp Parser/Encodings/x-sjis-unicode.enc blib/lib/XML/Parser/Encodings/x-sjis-unicode.enc
    cp Parser/Encodings/iso-8859-15.enc blib/lib/XML/Parser/Encodings/iso-8859-15.enc
    cp Parser/Encodings/iso-8859-2.enc blib/lib/XML/Parser/Encodings/iso-8859-2.enc
    cp Parser/Style/Tree.pm blib/lib/XML/Parser/Style/Tree.pm
    cp m.pl blib/lib/XML/m.pl
    cp Parser/Encodings/windows-1252.enc blib/lib/XML/Parser/Encodings/windows-1252.enc
    cp Parser/Encodings/koi8-r.enc blib/lib/XML/Parser/Encodings/koi8-r.enc
    cp Parser/Encodings/windows-1250.enc blib/lib/XML/Parser/Encodings/windows-1250.enc
    cp Parser/Encodings/x-sjis-cp932.enc blib/lib/XML/Parser/Encodings/x-sjis-cp932.enc
    cp Parser/LWPExternEnt.pl blib/lib/XML/Parser/LWPExternEnt.pl
    cp Parser/Encodings/euc-kr.enc blib/lib/XML/Parser/Encodings/euc-kr.enc
    cp Parser/Encodings/x-sjis-jdk117.enc blib/lib/XML/Parser/Encodings/x-sjis-jdk117.enc
    cp Parser.pm blib/lib/XML/Parser.pm
    cp Parser/Encodings/iso-8859-7.enc blib/lib/XML/Parser/Encodings/iso-8859-7.enc
    cp Parser/Encodings/iso-8859-5.enc blib/lib/XML/Parser/Encodings/iso-8859-5.enc
    cp Parser/Encodings/big5.enc blib/lib/XML/Parser/Encodings/big5.enc
    cp Parser/Style/Stream.pm blib/lib/XML/Parser/Style/Stream.pm
    cp Parser/Encodings/iso-8859-3.enc blib/lib/XML/Parser/Encodings/iso-8859-3.enc
    cp Parser/Encodings/windows-1251.enc blib/lib/XML/Parser/Encodings/windows-1251.enc
    cp Parser/Style/Objects.pm blib/lib/XML/Parser/Style/Objects.pm
    cp Parser/Encodings/README blib/lib/XML/Parser/Encodings/README
    cp Parser/Encodings/iso-8859-8.enc blib/lib/XML/Parser/Encodings/iso-8859-8.enc
    cp Parser/Style/Subs.pm blib/lib/XML/Parser/Style/Subs.pm
    cp Parser/Encodings/ibm866.enc blib/lib/XML/Parser/Encodings/ibm866.enc
    cp Parser/Encodings/iso-8859-9.enc blib/lib/XML/Parser/Encodings/iso-8859-9.enc
    make[1]: Entering directory '/.cpan/build/XML-Parser-2.46-0/Expat'
    cp Expat.pm ../blib/lib/XML/Parser/Expat.pm
    Running Mkbootstrap for Expat ()
    chmod 644 "Expat.bs"
    "/opt/freeware/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Expat.bs ../blib/arch/auto/XML/Parser/Expat/Expat.bs 644
    "/opt/freeware/bin/perl" "/opt/freeware/share/perl5/5.30/ExtUtils/xsubpp" -noprototypes -typemap '/opt/freeware/share/perl5/5.30/ExtUtils/typemap' -typemap '/.cpan/build/XML-Parser-2.46-0/Expat/typemap' Expat.xs > Expat.xsc
    mv Expat.xsc Expat.c
    gcc -maix64 -c -I/opt/freeware/include -D_THREAD_SAFE -O2 -maix64 -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/opt/freeware/include -DNEED_PTHREAD_INIT -fwrapv -maix64 -DUSE_64_BIT_ALL -D_FORTIFY_SOURCE=2 -O -DVERSION=\"2.46\" -DXS_VERSION=\"2.46\" "-I/opt/freeware/lib64/perl5/5.30/CORE" Expat.c
    In file included from /opt/freeware/include/expat.h:36,
    from Expat.xs:12:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/stdlib.h:341:25: error: unknown type name 'exit'
    extern _NORETURN(void, exit)(int);
    ^~~~
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/stdlib.h:353:25: error: unknown type name 'quick_exit'
    extern _NORETURN(void, quick_exit)(int);
    ^~~~~~~~~~
    In file included from /usr/include/sys/resource.h:57,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/sys/wait.h:56,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/stdlib.h:411,
    from /opt/freeware/include/expat.h:36,
    from Expat.xs:12:
    /usr/include/sys/time.h:110:16: error: redefinition of 'struct sigset_t'
    typedef struct sigset_t {
    ^~~~~~~~
    In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/sys/wait.h:45,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/stdlib.h:411,
    from /opt/freeware/include/expat.h:36,
    from Expat.xs:12:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/sys/types.h:345:16: note: originally defined here
    typedef struct sigset_t {
    ^~~~~~~~
    In file included from /usr/include/sys/resource.h:57,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/sys/wait.h:56,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/stdlib.h:411,
    from /opt/freeware/include/expat.h:36,
    from Expat.xs:12:
    /usr/include/sys/time.h:126:3: error: conflicting types for 'sigset_t'
    } sigset_t;
    ^~~~~~~~
    In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/sys/wait.h:45,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/stdlib.h:411,
    from /opt/freeware/include/expat.h:36,
    from Expat.xs:12:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/sys/types.h:361:3: note: previous declaration of 'sigset_t' was here
    } sigset_t;
    ^~~~~~~~
    make[1]: *** [Makefile:320: Expat.o] Error 1
    make[1]: Leaving directory '/.cpan/build/XML-Parser-2.46-0/Expat'





    ------------------------------
    Balthasar Nebel
    ------------------------------



  • 3.  RE: Adding Perl 5.30.3 (/opt/freeware/bin/perl) modules on AIX 7.3

    Posted Wed January 26, 2022 10:11 AM
    Thank you reporting the issue. We will look into it.

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



  • 4.  RE: Adding Perl 5.30.3 (/opt/freeware/bin/perl) modules on AIX 7.3

    Posted Thu January 27, 2022 01:15 AM
    Hi Balthasar,

    What version of gcc rpm package you installed on AIX 7.3?
    Please provide the output of "rpm -qa | grep gcc".
    We provided gcc8 For AIX 7.3 as a beta for sometime only and now the latest default gcc version For AIX 7.3 is gcc10.



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



  • 5.  RE: Adding Perl 5.30.3 (/opt/freeware/bin/perl) modules on AIX 7.3

    Posted Thu January 27, 2022 02:28 AM

    Hi Sangamesh, thank you for checking this!

    My gcc rpms were these:
    $ rpm -q -a|grep gcc
    libgcc-8-1.ppc
    gcc-cpp-8-1.ppc
    gcc-8-1.ppc
    libgcc8-8.3.0-6.ppc
    gcc8-8.3.0-6.ppc
    gcc8-cpp-8.3.0-6.ppc

    FYI, AIX 7.3 got installed as update from 7.2. Whats best practice to upgrade the Open Source packages now, especially upgrade of gcc? I just tried this, but it wasnt successful yet:

    # dnf remove gcc
    # dnf install gcc
    Last metadata expiration check: 0:05:47 ago on Thu Jan 27 03:10:36 GET 2022.
    Error:
    Problem: cannot install the best candidate for the job
    - nothing provides AIX-rpm < 7.3.0.0 needed by gcc-1:8-1.ppc
    (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
    # rpm -q -a|grep gcc
    libgcc8-8.3.0-5.ppc
    libgcc-8-1.ppc



    ------------------------------
    Balthasar Nebel
    ------------------------------



  • 6.  RE: Adding Perl 5.30.3 (/opt/freeware/bin/perl) modules on AIX 7.3
    Best Answer

    Posted Thu January 27, 2022 02:42 AM
    Hi Balthasar,

    Please check this post https://community.ibm.com/community/user/power/blogs/sangamesh-mallayya1/2022/01/10/aix-migration-with-dnf?CommunityKey=10c1d831-47ee-4d92-a138-b03f7896f7c9&tab=recentcommunityblogsdashboard


    Since some of the steps in your case might have already run. 
    Now, you can verify if you have AIX 7.3 repository is enabled with "dnf repolist".
    If it doesn't list then you need to manually edit the /opt/freeware/etc/dnf/dnf.conf as mentioned in the post and then try to update gcc packages.

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



  • 7.  RE: Adding Perl 5.30.3 (/opt/freeware/bin/perl) modules on AIX 7.3

    Posted Thu January 27, 2022 05:47 AM

    I followed your post and it resolved the problem - Thanks a lot!

    FYI, these were the commands I used in my case:
    ./dnf_aixtoolbox.sh -y
    vi /opt/freeware/etc/dnf/dnf.conf
      -> added section for AIX 7.3 and disabled the same for AIX 7.2
    dnf repolist
    dnf update
    dnf check
    dnf erase libgcc8-8.3.0-5.ppc
    dnf check
    dnf install gcc
    su - root
      -> continues with csh and HOME set to /
    setenv EXPATLIBPATH /opt/freeware/lib64
    setenv EXPATINCPATH /opt/freeware/include
    /opt/freeware/bin/perl -MCPAN -eshell
    -> continued with installation or perl modules without any issue so far



    ------------------------------
    Balthasar Nebel
    ------------------------------