AIX Open Source

 View Only
  • 1.  perl DBI module installation on AIX 7.2

    Posted Mon September 28, 2020 03:31 PM
    Hi Everyone,

        I wonder what is the simplest way to install the DBI perl module on AIX 7.2?  We had some older AIX5.3/Perl5.8 LPARs upgraded to AIX7.2/Perl 5.20, now the perl script which connects to DB2 server is broken.

    I wonder what is my best option to fix the perl script:
    1. Copy (or link) the old DBI.pm from the old perl 5.8 to new perl 5.20 directory
    2. Download the DBI module from MetaCPAN and install. Issues is that the Makefile points to AIX C compiler to compile from source code.
    3. I found a DBI module at perl-DBI    , but it was built for AIX 5.2. I wonder if that'll still work
    4. I saw some post mentioning ppm or
    perl -MCPAN -e 'install DBI'

    , I don't have internet access on the LPAR and I wonder if that'll work.

    Regards,
    Matthew



    ------------------------------
    Matthew Chan
    ------------------------------


  • 2.  RE: perl DBI module installation on AIX 7.2

    Posted Tue September 29, 2020 02:33 AM
    AIX Base perl fileset is built using XLC. So any perl module build using this perl needs xlc compiler. 
    You can manually download the source and run "/usr/bin/perl Makefile.PL" followed by make and make install. 

    Other option is to use Toolbox perl which uses gcc compiler ( "/opt/freeware/bin/perl Makefile.PL" ).

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



  • 3.  RE: perl DBI module installation on AIX 7.2

    Posted Tue September 29, 2020 04:06 PM
    Thanks for the reply. I decided to download the AIX XL Compiler trial version and it worked.
    After installing the DBI module I tried to install the DBD module but it seems to require some sql library header for compiling. Do you know where i can get them?

    INSTHOME=/home/db2clnt9
    DB2_HOME=${INST_DIR?}
    DB2LIB=${INST_DIR?}/lib
    export DB2_HOME
    export DB2LIB

    root:/tmp/perl-install/DBD-DB2-1.85> perl Makefile.PL

    Configuring DBD::DB2...
    Remember to actually read the README and CAVEATS files!

    Using DB2 in "/home/db2clnt9/sqllib"
    System: perl5.020001 DBI1.643 aix blade08 1 6 00003c3ad100 aix-thread-multi dl_aix.xs
    Compiler: xlc_r -q32 -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"/home/db2clnt9/sqllib/include" -I"/usr/opt/perl5/lib/site_perl/5.20.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/5.20.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/site_perl/5.20.1/aix-thread-multi/auto/DBI"
    Libraries: -L/home/db2clnt9/sqllib/lib -ldb2

    Generating a Unix-style Makefile
    Writing Makefile for DBD::DB2::Constants
    Writing MYMETA.yml and MYMETA.json
    Generating a Unix-style Makefile
    Writing Makefile for DBD::DB2
    Writing MYMETA.yml and MYMETA.json

    root:/tmp/perl-install/DBD-DB2-1.85> make
    Skip blib/lib/DBD/DB2.pod (unchanged)
    Skip blib/lib/Bundle/DBD/DB2.pm (unchanged)
    Skip blib/lib/DBD/DB2.pm (unchanged)
    Running Mkbootstrap for DBD::DB2 ()
    chmod 644 DB2.bs
    xlc_r -q32 -c -I"/home/db2clnt9/sqllib/include" -I"/usr/opt/perl5/lib/site_perl/5.20.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/5.20.1/aix-thread-multi/auto/DBI" -I"/usr/opt/perl5/lib/site_perl/5.20.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.20.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.20.1/aix-thread-multi/CORE/perl.h", line 4198.15: 1506-963 (W) The attribute "deprecated" is not a valid variable attribute and is ignored.
    "/usr/opt/perl5/lib/5.20.1/aix-thread-multi/CORE/perl.h", line 4200.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: The error code from the last command is 1.


    Stop.

    ------------------------------
    Matthew Chan
    ------------------------------



  • 4.  RE: perl DBI module installation on AIX 7.2

    Posted Wed September 30, 2020 02:12 AM
    https://metacpan.org/source/IBMTORDB2/DBD-DB2-1.85/README


       Ensure the following DB2 product is installed.
     
            DB2 Application Development Client v7.2 or later
                Included with the DB2 Personal Developer's Edition and the
                DB2 Universal Developer's Edition
     
        The Application Development Client can be downloaded here:
     


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