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
Expand all | Collapse all

Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

  • 1.  Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

    Posted Wed October 27, 2021 10:16 PM
    Dear All,
     
                We moved from AIX 72-02-02 to 72-05-03 and had to rebuild our custom perl mods in our site libs
    but now user reports high cpu and memory running a perl script envoking FTP. We have upgraded Net::FTP
    and wonder if there are any known reports of increased resources.

    This led us to try to build the perl from the IBM Toolkit for Linux.
    Is there any list of prereq rpm packages to download with perl 5.30 on TBX or documentation for the TBX Perl Build '?
    or which compiler should we download when we install and compile custom perl mods with cpan ?
    Is using gcc an option for those that don't want to install/pay for licenses for the IBM xLC.

    * this post may be duplicated. Its the first time posting and i cant seem to find or see my original post earlier submitted.


    ------------------------------

    Brgds,

    Scott Richards
    ------------------------------


  • 2.  RE: Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

    Posted Thu October 28, 2021 01:25 PM
    Hi Scott,

    I don't know if simple FTP script would be able to recreate the issue.
    The file being uploaded/download is of a large size ?
    Please let me know the script If you already have  which i can try.

    Toolbox perl have a dependency on db, gdbm and libgcc.
    It would be easy to install if you already have setup the YUM/DNF.

    Building perl modules using Toolbox perl uses the gcc.
     
    I tried this sample script and it seems both toolbox perl and AIX perl seems consume same resource.
    Even Linux system also seems to consume some resource.

    use Net::FTP;
    $ftp = Net::FTP->new("public.dhe.ibm.com", Debug => 0)
    or die "Cannot connect to public.dhe.ibm.com: $@";

    $ftp->login("anonymous",'-anonymous@')
    or die "Cannot login ", $ftp->message;

    $ftp->cwd("aix/freeSoftware/aixtoolbox/RPMS/ppc-7.2/gcc8/")
    or die "Cannot change working directory ", $ftp->message;

    $ftp->get("gcc8-go-8.3.0-6.aix7.2.ppc.rpm")
    or die "get failed ", $ftp->message;

    $ftp->quit;



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



  • 3.  RE: Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

    Posted Thu October 28, 2021 07:09 PM

    Hi Sangamesh,

     

                I decided to compile perl 5.30 and install gcc8 from the tbx but cpan gets this gcc compile error.

    It seems to be an option to allow C stype comments is defined by default… Is this something you have

    seen before ?

     

    Brgds,

    Scott

     

    DB2.xs:427:13: warning: implicit declaration of function 'dbd_st_cancel'; did you mean 'dbd_st_fetch'? [-Wimplicit-function-declaration]

    gcc: error: unrecognized command line option '-qcpluscmt'

     

     

    root@nxboxapp3:/root/.cpan/build/DBD-DB2-1.89-0/Constants # grep cpluscmt *

    Makefile:#     DEFINE => q[ -qcpluscmt]

    Makefile:DEFINE =  -qcpluscmt

    Makefile:       PASTHRU_DEFINE=' -qcpluscmt $(PASTHRU_DEFINE)'\

    Makefile.PL:  $opts{DEFINE} .= ' -qcpluscmt';

     

     

    root@nxboxapp3:/home/srichs/cargolink # ./c.mkperlmods.perl530.sh DBD::DB2 | tee DBD::DB2.out2

     

    ----------------------

    COMPLILE DBD::DB2

    ----------------------

    Loading internal logger. Log::Log4perl recommended for better logging

    Reading '/root/.cpan/Metadata'

      Database was generated on Thu, 28 Oct 2021 22:29:03 GMT

    Running install for module 'DBD::DB2'

    Checksum for /root/.cpan/sources/authors/id/R/RO/ROCKETDB/DBD-DB2-1.89.tar.gz ok

    'YAML' not installed, will not store persistent state

    Configuring R/RO/ROCKETDB/DBD-DB2-1.89.tar.gz with Makefile.PL

     

    Configuring DBD::DB2...

    Remember to actually read the README and CAVEATS files!

     

    Using DB2 in "/home/db2inst1/sqllib"

    Using DBI 1.643 (for perl 5.030003 on ppc-aix-thread-multi-64all) installed in /opt/freeware/lib64/perl5/5.30/site_perl//auto/DBI/

    System: perl5.030003 DBI1.643 aix pokndd10 1 6 00f905e64c00 powerpc aix  ppc-aix-thread-multi-64all dl_aix.xs

    Compiler: gcc -maix64 -O -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

    Includes:  -I"/home/db2inst1/sqllib/include" -I"/opt/freeware/lib64/perl5/5.30/site_perl/auto/DBI"

    Libraries: -L/home/db2inst1/sqllib/lib64 -ldb2

     

    Checking if your kit is complete...

    Looks good

    Checking if your kit is complete...

    Looks good

    Writing MYMETA.yml and MYMETA.json

    Generating a Unix-style Makefile

    Writing Makefile for DBD::DB2

    Writing MYMETA.yml and MYMETA.json

      ROCKETDB/DBD-DB2-1.89.tar.gz

      /opt/freeware/bin/perl Makefile.PL -- OK

    Running make for R/RO/ROCKETDB/DBD-DB2-1.89.tar.gz

    cp lib/Bundle/DBD/DB2.pm blib/lib/Bundle/DBD/DB2.pm

    cp DB2.pm blib/lib/DBD/DB2.pm

    cp DB2.pod blib/lib/DBD/DB2.pod

    Running Mkbootstrap for DB2 ()

            chmod 644 "DB2.bs"

             "/opt/freeware/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB2.bs blib/arch/auto/DBD/DB2/DB2.bs 644

            "/opt/freeware/bin/perl" "/opt/freeware/share/perl5/5.30/ExtUtils/xsubpp"  -typemap '/opt/freeware/share/perl5/5.30/ExtUtils/typemap'  DB2.xs > DB2.xsc

            mv DB2.xsc DB2.c

            gcc -maix64 -c  -I"/home/db2inst1/sqllib/include" -I"/opt/freeware/lib64/perl5/5.30/site_perl/auto/DBI"  -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=\"1.89\"  -DXS_VERSION=\"1.89\"  "-I/opt/freeware/lib64/perl5/5.30/CORE"  -DDB2_CACHE_FIX  DB2.c

     

    DB2.xs: In function 'XS_DBD__DB2__st_cancel':

    DB2.xs:427:13: warning: implicit declaration of function 'dbd_st_cancel'; did you mean 'dbd_st_fetch'? [-Wimplicit-function-declaration]

         ST(0) = dbd_st_cancel(sth,imp_sth) ? &PL_sv_yes : &PL_sv_no;

                 ^~~~~~~~~~~~~

                 dbd_st_fetch

     

            gcc -maix64 -c  -I"/home/db2inst1/sqllib/include" -I"/opt/freeware/lib64/perl5/5.30/site_perl/auto/DBI"  -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=\"1.89\"  -DXS_VERSION=\"1.89\"  "-I/opt/freeware/lib64/perl5/5.30/CORE"  -DDB2_CACHE_FIX  dbdimp.c

            "/opt/freeware/bin/perl" -MExtUtils::Mksymlists  -e "Mksymlists('NAME'=>\"DBD::DB2\", 'DLBASE' => 'DB2', 'DL_FUNCS' => {  }, 'FUNCLIST' => [], 'IMPORTS' => {  }, 'DL_VARS' => []);"

            rm -f blib/arch/auto/DBD/DB2/DB2.so

            gcc -maix64  -Wl,-b64 -Wl,-bhalt:4 -Wl,-G -Wl,-bI:/opt/freeware/lib64/perl5/5.30/CORE/perl.exp  -Wl,-bnoentry -lpthreads -lc -lm -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -L/usr/local/lib -Wl,-bE:DB2.exp DB2.o  dbdimp.o   -o blib/arch/auto/DBD/DB2/DB2.so    -L/home/db2inst1/sqllib/lib64 -ldb2

            chmod 755 blib/arch/auto/DBD/DB2/DB2.so

    cp Constants.pm ../blib/lib/DBD/DB2/Constants.pm

    AutoSplitting ../blib/lib/DBD/DB2/Constants.pm (../blib/lib/auto/DBD/DB2/Constants)

    Running Mkbootstrap for Constants ()

            chmod 644 "Constants.bs"

             "/opt/freeware/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Constants.bs ../blib/arch/auto/DBD/DB2/Constants/Constants.bs 644

            "/opt/freeware/bin/perl" "/opt/freeware/share/perl5/5.30/ExtUtils/xsubpp"  -typemap '/opt/freeware/share/perl5/5.30/ExtUtils/typemap'  Constants.xs > Constants.xsc

            mv Constants.xsc Constants.c

            gcc -maix64 -c -I"/home/db2inst1/sqllib/include" -I"/opt/freeware/lib64/perl5/5.30/site_perl/auto/DBI"  -I"/home/db2inst1/sqllib/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=\"1.89\"  -DXS_VERSION=\"1.89\"  "-I/opt/freeware/lib64/perl5/5.30/CORE" -DDB2_CACHE_FIX   -qcpluscmt Constants.c

     

    gcc: error: unrecognized command line option '-qcpluscmt'

     

    make: 1254-004 The error code from the last command is 1.

     

     

    Stop.

    make: 1254-004 The error code from the last command is 2.

     

     

    Stop.

      ROCKETDB/DBD-DB2-1.89.tar.gz

      /usr/bin/make -- NOT OK



    https://www.ibm.com/docs/en/xl-c-aix/13.1.2?topic=descriptions-qcpluscmt

    ------------------------------
    Scott Richards
    ------------------------------



  • 4.  RE: Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

    Posted Fri October 29, 2021 09:36 AM
    Hi Sangamesh,
    ​                 Regarding the cpan gcc compile error on DBD:DB2, maybe i don't have the right gcc rpms to compile with gcc  ?

    I thought this might be helpful.

    I have been asked to build the new perl 5.30 gcc distro to compare to the IBM 5.28.4.
    I agree there are a lot more factors involved in any perf issue. I tried to install yum but got stuck so i downloaded the gcc and perl 5.30 prereqs manually.

    Brgds,
    Scott

    srichs@nxboxapp3:/home/srichs # oslevel -s
    7200-05-02-2114
    srichs@nxboxapp3:/home/srichs # rpm -qa
    emacs-nox-20.7-3.ppc
    glib2-2.28.6-1.ppc
    expat-2.0.1-3.ppc
    less-358-4.ppc
    tar-1.13-4.ppc
    pci.df1080f9-1-81x3.noarch
    readline-7.0-5.ppc
    python-2.7.13-1.ppc
    bash-4.2-3.ppc
    AIX-rpm-7.2.5.1-10.ppc
    zlib-1.2.11-2.ppc
    libgcc8-8.3.0-6.ppc
    libstdc++8-8.3.0-6.ppc
    gmp-6.1.2-1.ppc
    libmpc-1.1.0-1.ppc
    ncurses-6.2-3.ppc
    libgomp-8-1.ppc
    libiconv-1.16-1.ppc
    info-6.7-1.ppc
    gcc8-cpp-8.3.0-6.ppc
    gcc-cpp-8-1.ppc
    db-5.3.28-1.ppc

    perl-5.30.3-2.ppc

    flex-2.5.4a-5.ppc
    lsof-4.61-4.ppc
    libdbi-0.8.4-1.ppc
    mtools-3.9.7-4.ppc
    emacs-20.7-3.ppc
    screen-3.9.10-2.ppc
    rsync-3.0.6-1.ppc
    sqlite-3.15.2-1.ppc
    bash-doc-4.2-2.ppc
    gzip-1.10-1.ppc
    libgcc-8-1.ppc
    libstdc++-8-1.ppc
    mpfr-4.0.2-2.ppc
    libffi-3.2.1-3.ppc
    libgomp8-8.3.0-6.ppc
    xz-libs-5.2.5-1.ppc
    gettext-0.20.2-1.ppc
    sed-4.8-1.ppc
    gcc8-8.3.0-6.ppc
    gcc-8-1.ppc
    gdbm-1.19-1.ppc
    srichs@nxboxapp3:/home/srichs #

    ------------------------------
    Scott Richards
    ------------------------------



  • 5.  RE: Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

    Posted Fri October 29, 2021 11:22 AM
    Hi Scott,

    The flat -qcpluscmt is specific to xlc compiler. 
    You can try removing that flag and see if it works.
    Not sure if somebody is successfully able to compile DB2 using gcc before.


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



  • 6.  RE: Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

    Posted Fri October 29, 2021 02:08 PM
    Edited by Scott Richards Fri October 29, 2021 04:34 PM
    ​Hi Sangmesh,

               Is it possible or advised to compile perl 5.30 with gcc, and add/compile custom perl mods like DB2::DBI version using xlc...
    I thought we needed to compile all perl mods with the same compiler used to build perl.

    It looks like download DBD::DB2 from the perl/cpan from the TBX, that's built from gcc, it contain makefiles referencing CC= gcc... not xlc_r.

    root@nxboxapp3:/root/.cpan.ibm.before.gcc/build/DBD-DB2-1.85-HRGQyS # grep CC * |grep Makefile     downloaded w cpan using IBM perl
    Makefile:CC = xlc_r -q32

    root@nxboxapp3:/root/.cpan/build/DBD-DB2-1.89-0 # grep CC * |grep Makefile                                           downloaded w cpan from tbx perl 5.30
    Makefile:CC = gcc -maix64

    Brgds,
    Scott



    .

    ------------------------------
    Scott Richards
    ------------------------------



  • 7.  RE: Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

    Posted Tue November 02, 2021 05:04 PM
    Hi Sangamesh,

              Here is the script and an email that explains how to use it. The ftp program in production sends a load of files and when we upgraded from 72TL2 / 5.20 perl  to 72-TL5-3 / 5.28
    the application perl scripts were throwing out of memory errors and had to be restarted. We upgraded net::ftp from 3.11 to 3.13 but still used more memory and resources when fully upgraded verses running under 5.20 with aix 72-02. This was a simple test with less load, but still simple test shows the increase utilization.

    Can i send you the graphic image sent to me of the tests at another email ? since ii cant include them here?

    Brgds,
    Scott

    So after upgrade of perl on original OS and still perl 5.20 – but FTP module upgraded 3.13:

    * Memory allocation doubled ☹

    * but there is still (almost) NO memory leak 😊

    * CPU consumption went up by 200% ☹

    Net::FTP 3.13seems somehow the culprit in memory and cpu increase.

    While in combination with AIX OS 7.2.5 or Perl 5.28 or IO-modules we have the memory leak.



    The user made a small test perl script that transfers a single file forth and back a number of times using same technique as production perl scripts.

     It takes the following required 7 arguments:

     

    1. Localfile

    Local file to transfer

    1. Count

    Number of times to transfer file.

    For every transfer:

    1. Local file is 'put' from local to remote (.tmp suffix)

    2. Remote file .ftp deleted

    3. Remote file renamed from .tmp to.ftp

    3. File is 'get' from remote to local (.tmp suffix)

    4. Local renamed from .tmp to .ftp

    1. Connects

    How many transfers before reconnecting (10 = every 10 time)

    1. Server

    Server name to FTP connect (using default FTP port)

    1. User

    User name

    1. Password

    Password

    1. Path

    Remote path (. = home)

     

    Sample:

     

    testftp.pl /home/bjso/test 10000 100 clfiles_test.cargolink.dsv.com grit.app.clftpnext "hj#Jkp#" .

     The script will display progress for every connect and transfer.

      

    SCRIPT :   ./testftp.pl

    #!/usr/bin/perl -w

    use strict;

    use warnings;

    use Time::HiRes 'gettimeofday', 'tv_interval';

    use File::Basename;

     use Net::FTP;

    my $localfile = $ARGV[0];;

    my $count     = $ARGV[1];

    my $connects  = $ARGV[2];

    my $server    = $ARGV[3];

    my $user      = $ARGV[4];

    my $password  = $ARGV[5];

    my $path      = $ARGV[6];

     

    my $ftp;

    my $file;

     

    {

            if( scalar @ARGV != 7 ) {

                    print "testftp.pl @ARGV\n";

                    print "Syntax: testftp.pl <localfile> <count> <connects> <server> <user> <password> <remotepath>\n";

                    print "Sample: testftp.pl myfile 100 5 myserver myuser mypasswd .\n";

                    exit;

            }

            main();

            exit;

    }

     

    sub main {

     

            print "----------------------\n";

            print "FTP transferring file: '$localfile' to $user\@$server:$path $count times ...\n";

            print "FTP version:". $Net::FTP::VERSION ."\n";

            my $start = [ gettimeofday() ];

            my $number=0;

            $file = basename($localfile);

            $path =~ s|/$||;

     

            connect_and_login();

            for (0..$count - 1) {

                    if ( $number > 0 && $number % $connects == 0 ) {

                            disconnect();

                            connect_and_login();

                    }

                    $number++;

                    print "# $number ...\n";

                    put_file();

                    get_file();

            }

            disconnect();

            my $total_secs = tv_interval($start);

            print "----------------------\n";

            print "Stats:\n";

            my @cmd = ("ps","-p $$","-o user,pid,comm,vsz,time");

            #my @cmd = ("ps","u", $$);

            system( @cmd );

            print "    Elapsed: $total_secs secs.\n";

     

        #print "\nSleeping 10 min before terminating ...\n";

            #sleep 600;

    }

     

    sub put_file {

     

            $ftp->put( "$localfile", "$file.tmp" ) or  die( $ftp->message );

            $ftp->delete( "$file.ftp" );

            $ftp->rename( "$file.tmp", "$file.ftp" ) or die( $ftp->message );

            print "Put and renamed to $server:$path/$file.ftp.\n";

    }

     

    sub get_file {

     

            $ftp->get( "$file.ftp", "$localfile.tmp" ) or  die( $ftp->message );

            my @cmd = ("mv","$localfile.tmp","$localfile.ftp");

            system( @cmd ) == 0 or die "local rename failed.";

            print "Get and renamed to (local):$localfile.ftp.\n";

    }

     

    sub connect_and_login {

     

            my $port='';

            $ftp = Net::FTP->new( "$server", Port => "$port" ) or die "Error connecting to: $server";

            $ftp->login("$user", "$password" ) or die "Cannot login:", $ftp->message;

            $ftp->cwd( "$path" ) or die "Cannot change dir", $ftp->message;

            print "Connected.\n";

    }

     

    sub disconnect {

     

            if ( $ftp ) {

                    $ftp->quit() or die( $ftp->message );

            }

            print "Disconnected.\n";

     

    }




    TESTING
    -------------

    Ran new test set (named 0.5):

     

    So after upgrade of perl on original OS and still perl 5.20 – but FTP module upgraded 3.13:

    * Memory allocation doubled ☹

    * but there is still (almost) NO memory leak 😊

    * CPU consumption went up by 200% ☹

    * Elapse times still no notifiable change 😊

    Net::FTP 3.13seems somehow the culprit in memory and cpu increase.

    While in combination with AIX OS 7.2.5 or Perl 5.28 or IO-modules we have the memory leak.

     ​

    ------------------------------
    Scott Richards
    ------------------------------



  • 8.  RE: Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

    Posted Tue November 02, 2021 08:07 PM
    Hi Scott
    I went through the steps of building the DB late last year, and stored those instructions.
    This did use xlC, but since it was a very tedious exercise, I wanted to share all those steps while I still had the info in my notes :-)
    This was perl 5.28. and maybe this will not be helpful to you if you need GCC, but at least I can verify these steps and versions at the time of the success!


    # perl Makefile.PL
    <...>
    Generating a Unix-style Makefile
    Writing Makefile for DBI
    Writing MYMETA.yml and MYMETA.json

    # make
    <...>
    Running Mkbootstrap for DBI ()
    chmod 644 "DBI.bs"
    "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DBI.bs blib/arch/auto/DBI/DBI.bs 644
    xlc_r -c -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -O -DVERSION=\"1.643\" -DXS_VERSION=\"1.643\" "-I/usr/opt/perl5/lib/5.28.1/aix-thread-multi/CORE" DBI.c
    "/usr/opt/perl5/lib/5.28.1/aix-thread-multi/CORE/perl.h", line 4401.15: 1506-963 (W) The attribute "deprecated" is not a valid variable attribute and is ignored.
    rm -f blib/arch/auto/DBI/DBI.so
    ld -bhalt:4 -G -bI:/usr/opt/perl5/lib/5.28.1/aix-thread-multi/CORE/perl.exp -bnoentry -lpthreads -lc -lm -bE:DBI.exp DBI.o -o blib/arch/auto/DBI/DBI.so
    chmod 755 blib/arch/auto/DBI/DBI.so
    "/usr/bin/perl" "-Iblib/arch" "-Iblib/lib" dbilogstrip.PL dbilogstrip
    Extracted dbilogstrip from dbilogstrip.PL with variable substitutions.
    "/usr/bin/perl" "-Iblib/arch" "-Iblib/lib" dbiprof.PL dbiprof
    Extracted dbiprof from dbiprof.PL with variable substitutions.
    "/usr/bin/perl" "-Iblib/arch" "-Iblib/lib" dbiproxy.PL dbiproxy
    Extracted dbiproxy from dbiproxy.PL with variable substitutions.
    cp dbilogstrip blib/script/dbilogstrip
    "/usr/bin/perl" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/dbilogstrip
    cp dbiprof blib/script/dbiprof
    "/usr/bin/perl" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/dbiprof
    cp dbiproxy blib/script/dbiproxy
    "/usr/bin/perl" -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/dbiproxy
    Manifying 3 pod documents
    Manifying 49 pod documents

    # make test
    <...>
    All tests successful.
    Files=202, Tests=9379, 230 wallclock secs ( 1.70 usr 0.31 sys + 76.27 cusr 17.30 csys = 95.58 CPU)
    Result: PASS

    # make install
    <...>
    "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DBI.bs blib/arch/auto/DBI/DBI.bs 644
    Manifying 3 pod documents
    Manifying 49 pod documents
    Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
    Installing /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/DBI/DBI.so
    Appending installation info to /usr/opt/perl5/lib/5.28.1/aix-thread-multi/perllocal.pod


    3) BUILD AND INSTALL DBD::DB2

    # cd /tmp/perl/DBD-DB2-1.86

    # export DB2_HOME=/tmp/perl/odbc_cli_32/clidriver
    # export PERL5LIB=/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/:/tmp/perl/DBD/DBD-DB2-1.86/tests:/tmp/perl/DBD/DBD-DB2-1.86/Constants

    # perl Makefile.PL
    <...>
    Using DB2 in "/tmp/perl/odbc_cli_32/clidriver"
    System: perl5.028001 DBI1.643 aix fvt-p7a2-lp2 1 7 0000668a7a00 aix-thread-multi dl_aix.xs
    Compiler: xlc_r -O -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES
    Includes: -I"/tmp/perl/odbc_cli_32/clidriver/include" -I"/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/5.28.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/DBI"
    Libraries: -L/tmp/perl/odbc_cli_32/clidriver/lib -ldb2
    Checking if your kit is complete...
    Looks good
    Checking if your kit is complete...
    Looks good
    Writing MYMETA.yml and MYMETA.json
    Generating a Unix-style Makefile
    Writing Makefile for DBD::DB2
    Writing MYMETA.yml and MYMETA.json

    # make
    <...>
    xlc_r -c -I"/tmp/perl/odbc_cli_32/clidriver/include" -I"/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/5.28.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/DBI" -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -O -DVERSION=\"1.85\" -DXS_VERSION=\"1.85\" "-I/usr/opt/perl5/lib/5.28.1/aix-thread-multi/CORE" -DDB2_CACHE_FIX DB2.c
    "DB2.h", line 11.10: 1506-296 (S) #include file <sqlcli.h> not found.
    "DB2.h", line 13.10: 1506-296 (S) #include file <sqlcli1.h> not found.
    "DB2.h", line 14.10: 1506-296 (S) #include file <sqlext.h> not found.
    "DB2.h", line 16.10: 1506-296 (S) #include file <sqlstate.h> not found.
    "/usr/opt/perl5/lib/5.28.1/aix-thread-multi/CORE/perl.h", line 4401.15: 1506-963 (W) The attribute "deprecated" is not a valid variable attribute and is ignored.
    "dbdimp.h", line 33.9: 1506-046 (S) Syntax error.
    "dbdimp.h", line 41.9: 1506-046 (S) Syntax error.
    "dbdimp.h", line 50.9: 1506-046 (S) Syntax error.
    "dbdimp.h", line 80.9: 1506-046 (S) Syntax error.
    "dbdimp.h", line 92.9: 1506-046 (S) Syntax error.
    make: 1254-004 The error code from the last command is 1.

    I located APPLICATION_DEVELOPMENT_TOOLS_10.5.0.11_aix64_ppc.tar.gz (part of v10.5fp11_aix64_client.tar) and extracted the include directory to /tmp/perl/clidriver, then tried make again:

    # make
    <...>
    "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB2.bs blib/arch/auto/DBD/DB2/DB2.bs 644
    xlc_r -c -I"/tmp/perl/odbc_cli_32/clidriver/include" -I"/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/5.28.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/DBI" -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -O -DVERSION=\"1.85\" -DXS_VERSION=\"1.85\" "-I/usr/opt/perl5/lib/5.28.1/aix-thread-multi/CORE" -DDB2_CACHE_FIX DB2.c
    "/usr/opt/perl5/lib/5.28.1/aix-thread-multi/CORE/perl.h", line 4401.15: 1506-963 (W) The attribute "deprecated" is not a valid variable attribute and is ignored.
    xlc_r -c -I"/tmp/perl/odbc_cli_32/clidriver/include" -I"/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/5.28.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/DBI" -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -O -DVERSION=\"1.85\" -DXS_VERSION=\"1.85\" "-I/usr/opt/perl5/lib/5.28.1/aix-thread-multi/CORE" -DDB2_CACHE_FIX dbdimp.c
    "/usr/opt/perl5/lib/5.28.1/aix-thread-multi/CORE/perl.h", line 4401.15: 1506-963 (W) The attribute "deprecated" is not a valid variable attribute and is ignored.
    rm -f blib/arch/auto/DBD/DB2/DB2.so
    ld -bhalt:4 -G -bI:/usr/opt/perl5/lib/5.28.1/aix-thread-multi/CORE/perl.exp -bnoentry -lpthreads -lc -lm -bE:DB2.exp DB2.o dbdimp.o -o blib/arch/auto/DBD/DB2/DB2.so -L/tmp/perl/odbc_cli_32/clidriver/lib -ldb2
    chmod 755 blib/arch/auto/DBD/DB2/DB2.so
    "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Constants.bs ../blib/arch/auto/DBD/DB2/Constants/Constants.bs 644
    Manifying 2 pod documents
    Target "default_target" is up to date.

    # make test
    <...>
    All tests successful.
    Files=2, Tests=6, 1 wallclock secs ( 0.03 usr 0.00 sys + 0.07 cusr 0.02 csys = 0.12 CPU)
    Result: PASS

    # make install
    <...>
    "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- DB2.bs blib/arch/auto/DBD/DB2/DB2.bs 644
    "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Constants.bs ../blib/arch/auto/DBD/DB2/Constants/Constants.bs 644
    Manifying 2 pod documents
    Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
    Installing /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/DBD/DB2/DB2.so
    Installing /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/DBD/DB2/Constants/Constants.so
    Appending installation info to /usr/opt/perl5/lib/5.28.1/aix-thread-multi/perllocal.pod

    In summary, I was able to build and install the modules, with the following versions of filesets/files:

    AIX: xlccmp.13.1.3
    AIX: perl.rte 5.28.1.3
    DB2: v10.5fp11_aix64_odbc_cli_32.tar
    DB2: v10.5fp11_aix64_client.tar
    CPAN: DBI DBI-1.643.tar
    CPAN: DBD-DB2-1.86.tar

    ------------------------------
    Jan Harris
    ------------------------------



  • 9.  RE: Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

    Posted Wed November 03, 2021 05:11 PM
    ​Hi Jan,

          Thanks so much for your post. Can you help me understand our options a bit more. Forgive my assumptions, for starters, can you clarify if local perl mods like DB2:DBI
    must be compiled with the same compiler used for TBX Perl ? It's hard for me to know the options if i don't know the general rules of the road, and your time is valuable.
    What is the best practice ?  Can we safely just Tar up an old AIX system perl and untar it elsewhere for our "legacy application" to use ??

    We too can compile DB2::DBI with xlC, even after going from 5.20/AIX 72-02 to 5.28.4/AIX 72-05-03, but after the upgrade a longer running perl script got "out of memory"
    errors and higher cpu usage. I posted a test net::ftp script that shows the climb. 
     
    Maybe Sangamesh or your self can try the test script above on AIX 72-05-03 and notice climbing memory and cpu as well. 

    Ran new test set (named 0.5):

     

    So after upgrade of perl on original OS and still perl 5.20 – but FTP module upgraded 3.13:

    * Memory allocation doubled ☹

    * but there is still (almost) NO memory leak 😊

    * CPU consumption went up by 200% ☹

    * Elapse times still no notifiable change 😊


    Net::FTP 3.13 may somehow the culprit in memory and cpu increase.

    While in combination with AIX OS 7.2.5 or Perl 5.28 or IO-modules we have the memory leak.

     

    Simultaneously we installed gcc and tbx perl (built with gcc), to have a separate Perl installed for applications but DB2::DBI failed when the "make"
    set CC=gcc causing gcc to error out when it found a xlC compiler option below for some reason, producing this error.

    DB2:DBI package error :
          gcc: error: unrecognized command line option '-qcpluscmt'  (isn't this an xlc option ?)

    Sangamesh said he didn't know of anyone who successfully compiled DB2::DBI with GCC, so i wonder where that leaves us.

    If we can't solve the PERL 5.28.4 out of memory error we saw after upgrading to the current AIX 72-05-03, and can't use TBX Perl because it needs GCC
    which causes DB2::DBI compiles to fail, what are our options.


    Bgrds,
    Scott Richards

    ------------------------------
    Scott Richards
    ------------------------------



  • 10.  RE: Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

    Posted Wed November 03, 2021 07:34 PM
    Hi Scott
    I will need to defer to the AIX OSS regarding your latest questions, but I have reached out to the contacts I worked with last year to get this compiled, to see if they are aware of gcc success.  I will let you know what I find out!

    ------------------------------
    Jan Harris
    ------------------------------



  • 11.  RE: Has anyone installed Perl from the AIX Toolbox on AIX 72-05-03 ?

    Posted Tue November 16, 2021 02:18 PM
    Hi Jan,
               Thanks for ​reaching out to AIX OSS. Are there any updates from your contacts so I can get back to the customer.
    If we can get gcc to compile db2:dbi great, but if not, as a workaround, we hope they bless tarring up the older 5.10 IBM
    version ie. /usr/opt/perl5 and copy it to a separate application directory..

    That way we have 2 separate perls, the one AIX uses,  and an older one that the old application scripts like and we can
    still compile with xlC.  Having no toolbox gcc dependent perl versions if we must.

    Brgds,
    Scott

    ------------------------------
    Scott Richards
    ------------------------------