1

I tried to install CGI, DBI and DBD::Oracle and drivers in a 64-bit Solaris environment, but to little avail. The number of errors I have encountered is mind-boggling and the number of workaround solutions I have tried - from changing environment variables, changing directory references, moving and copying files, changing compilers, etc. - is even worse. And the worst part is that there is very little documentation for installing said modules in the newest version of Solaris.

Here are the initial steps we have been going through.

  1. First we go to http://search.cpan.org/. Then we download:

  2. Next we open up a terminal window, switch to root, then navigate to our "Downloads" folder.

  3. From here we decompress the previously downloaded files (no problems here):

    gunzip -c CGI.pm-3.59.tar.gz |tar xvf -
    gunzip -c DBI-1.621.tar.gz |tar xvf -
    gunzip -c DBD-Oracle-1.44.tar.gz |tar xvf -
    
  4. Then we archive the tar files in case we might need them later on.

    mkdir archive_tar
    mv *.gz $HOME/Downloads/archive_tar
    
  5. Here is where it gets slightly confusing, as we are not sure if these steps are completely necessary. Basically, we believe we need to set up the correct Perl (64-bit required for the newest Oracle, default Perl used is 32-bit).

    1. Type which perl in order to determine which current version of Perl you are using. It should indicate you are using the default version (or 32-bit).
    2. Verify that you have a 64-bit Perl installation available by doing the following: type file /opt/oracle/rdbms/perl/bin/perl
    3. You should see ELF 64-bit LSB executable AMD64 Version 1 [SSE2 SSE FXSR CMOV FPU], dynamically linked, not stripped<.
    4. Switch to using this version of Perl by adding it to the PATH variable: export PATH=/opt/oracle/rdbms/perl/bin:$PATH
    5. Type which perl. Verify that this now shows the Perl located at opt/oracle/rdbms/perl/bin/perl.
    6. Type perl -V, if it shows errors, set the variables below:

      export PERL5LIB=/opt/oracle/rdbms/perl/lib/5.10.0
      export PERLLIB=/opt/oracle/rdbms/perl/lib/5.10.0
      
  6. Now we set up cc (the compiler) to work so that we can install CGI/DBI/DBD-Oracle.

    1. Type cc --version to verify that it says cc is not found.
    2. Open up a browser and navigate to Solaris Studio. Here you will find a package which contains Sun's compiler.
    3. Download "Tarfile on Solaris SPARC" for the Solaris 11 OS Platform.
    4. In your terminal window, decompress the above file by typing: bzcat SolarisStudio12.3-solaris-sparc-bin.tar.bz2 | tar xf -
    5. Move the .bz2 file to our previously created archive folder: mv SolarisStudio12.3-solaris-sparc-bin.tar.bz2 $HOME/Downloads/archive_tar
    6. Now we want to add the new compiler to our path, we do this through: export PATH=$PATH:/home/oracle/Downloads/SolarisStudio12.3-solaris-sparc-bin/solarisstudio12.3/bin
    7. Type cc --version, this command shouldn't do anything (possibly throw a few warnings), but it won't say cc not found anymore.
  7. Here we begin to install the modules and the driver, starting with the CGI module:

    1. Navigate to $HOME/Downloads/CGI.pm-3.59
    2. Type perl Makefile.PL
    3. We need to change the make file to point to the correct location.

      1. Type vi Makefile
      2. :%s,../lib/site_perl/5.10.0,/opt/oracle/rdbms/perl/lib/site_perl/5.10.0,g
      3. :%s,../lib/5.10.0,/opt/oracle/rdbms/perl/lib/5.10.0,g
    4. Now type make

    5. Then type make install
    6. Next we move onto the DBI module. Navigate to $HOME/Downloads/DBI-1.621.
    7. Type perl Makefile.PL
    8. Again, we need to change this make file to point to the correct location.

      1. Type vi Makefile
      2. :%s,../lib/site_perl/5.10.0,/opt/oracle/rdbms/perl/lib/site_perl/5.10.0,g
      3. :%s,../lib/5.10.0,/opt/oracle/rdbms/perl/lib/5.10.0,g
    9. However, these change two lines that we don't want to change. So do a find for MAKEMAKER and XSUBPPDIR and set them back to the below values.

      MAKEMAKER = /opt/oracle/rdbms/perl/lib/5.10.0/ExtUtils/MakeMaker.pm
      XSUBPPDIR = /opt/oracle/rdbms/perl/lib/5.10.0/ExtUtils
      
    10. Now type make

    11. Then type make install
    12. Now navigate to $HOME/Downloads/DBD-Oracle-1.44
    13. Type perl Makefile.PL

And that is basically where we get a fatal error at line 21, use DBI 1.51; in the Makefile, and tracing up the stack indicates that @INC cannot locate DBI.pm. That is why I tried to move the binary library file. I can't access the Solaris box at this moment so I can't re-post the exact error code, I should be able to include that probably Tuesday (the earliest I can get back to the machine). Does anyone have any ideas to this point though?

alternative route using CPAN shell

  1. Open up a terminal window and install the following packages as the root user:

    pkg install system/header
    pkg install gcc-45
    pkg install developer/build/gnu-make
    pkg install archiver/gnu-tar
    
  2. Navigate to $oracle_home cd $oracle_home and:

    mkdir /apps
    mkdir /apps/twiki-root
    mkdir /apps/twiki-root/perlmodules
    
  3. Modify the PERL5LIB environment variable:

    • export PERL5LIB=/apps/twiki-root/perlmodules
    • Verify by typing: echo $PERL5LIB
  4. Open up the CPAN shell and update it:

    /usr/perl5/bin/perlgcc -MCPAN -e shell
    

    If this is the first time, press return to accept auto-configuration. And now enter the following commands to modify the mirror location for CPAN:

    o conf urllist shift
    o conf urllist
    o conf urllist unshift http://mirror.ox.ac.uk/sites/www.cpan.org/
    o conf urllist
    o conf commit
    install Bundle::CPAN
    reload cpan
    
  5. Open up the Config.pm file and modify it as described below:

    cd /usr/perl5/5.12/lib/CPAN/
    vi Config.pm
    

    Modify these values:

    'make' => q[/usr/sfw/bin/gmake],
    'make_install_make_command' => q[/usr/sfw/bin/gmake],
    'makepl_arg' => q[LIB=/apps/twiki-root/perlmodules PREFIX=/apps/twiki-root/perlmodules INSTALLMAN3DIR=/apps/twiki-root/perlmodules/man/man3],
    'mbuild_arg' => q[--install_base /apps/twiki-root/perlmodules],
    'mbuild_install_arg' => q[--install_base /apps/twiki-root/perlmodules],
    'mbuildpl_arg' => q[--install_base /apps/twiki-root/perlmodules],
    'prefs_dir' => q[~/.cpan/prefs],
    'tar' => q[/usr/sfw/bin/gtar],
    

    Write/save to the file and quit → :wq

  6. Make sure that your gcc is set:

    Verify by: which gcc

  7. Now once again open up the CPAN shell and begin to install the DBI module.

    /usr/perl5/bin/perlgcc -MCPAN -e shell
    install DBI
    

And this is where everything just goes to crap. Error:

Reading '/home/oracle/.cpan/Metadata'
Database was generated on Sun, 03 Jun 2012 22:27:03 GMT
Running install for module 'DBI'
Running make for T/TI/TIMB/DBI-1.621.tar.gz
Subroutine config redefined at /usr/perl5/5.12/lib/CPAN/LWP/UserAgent.pm line 12.
Subroutine get_basic_credentials redefined at /usr/perl5/5.12/lib/CPAN/LWP/UserAgent.pm line 23.
Subroutine no_proxy redefined at /usr/perl5/5.12/lib/CPAN/LWP/UserAgent.pm line 32.
Subroutine mirror redefined at /usr/perl5/5.12/lib/CPAN/LWP/UserAgent.pm line 67.
Fetching with HTTP::Tiny:
http://mirror.ox.ac.uk/sites/www.cpan.org/authors/id/T/TI/TIMB/DBI-1.621.tar.gz
Fetching with HTTP::Tiny:
http://mirror.ox.ac.uk/sites/www.cpan.org/authors/id/T/TI/TIMB/CHECKSUMS
Checksum for /home/oracle/.cpan/sources/authors/id/T/TI/TIMB/DBI-1.621.tar.gz ok
Scanning cache /home/oracle/.cpan/build for sizes
............................................................................DONE

CPAN.pm: Building T/TI/TIMB/DBI-1.621.tar.gz


*** Your LANG environment variable is set to 'en_US.UTF-8'
*** This may cause problems for some perl installations.
*** If you get test failures, please try again with LANG unset.
*** If that then works, please email dbi-dev@perl.org with details
*** including the output of 'perl -V'

Creating test wrappers for DBD::Gofer:
t/zvg_01basics.t
t/zvg_02dbidrv.t
t/zvg_03handle.t
t/zvg_04mods.t
t/zvg_05concathash.t
t/zvg_06attrs.t
t/zvg_07kids.t
t/zvg_08keeperr.t
t/zvg_09trace.t
t/zvg_10examp.t
t/zvg_11fetch.t
t/zvg_12quote.t
t/zvg_13taint.t
t/zvg_14utf8.t
t/zvg_15array.t
t/zvg_16destroy.t
t/zvg_19fhtrace.t
t/zvg_20meta.t
t/zvg_30subclass.t
t/zvg_31methcache.t
t/zvg_35thrclone.t
t/zvg_40profile.t
t/zvg_41prof_dump.t
t/zvg_42prof_data.t
t/zvg_43prof_env.t
t/zvg_48dbi_dbd_sqlengine.t
t/zvg_49dbd_file.t
t/zvg_50dbm_simple.t
t/zvg_51dbm_file.t
t/zvg_52dbm_complex.t
t/zvg_60preparse.t
t/zvg_65transact.t
t/zvg_70callbacks.t
t/zvg_72childhandles.t
t/zvg_80proxy.t
t/zvg_85gofer.t
t/zvg_86gofer_fail.t
t/zvg_87gofer_cache.t
t/zvg_90sql_type_cast.t
Creating test wrappers for DBI::SQL::Nano:
t/zvn_48dbi_dbd_sqlengine.t
t/zvn_49dbd_file.t
t/zvn_50dbm_simple.t
t/zvn_51dbm_file.t
t/zvn_52dbm_complex.t
t/zvn_85gofer.t
Creating test wrappers for DBI::PurePerl:
t/zvp_01basics.t
t/zvp_02dbidrv.t
t/zvp_03handle.t
t/zvp_04mods.t
t/zvp_05concathash.t
t/zvp_06attrs.t
t/zvp_07kids.t
t/zvp_08keeperr.t
t/zvp_09trace.t
t/zvp_10examp.t
t/zvp_11fetch.t
t/zvp_12quote.t
t/zvp_13taint.t
t/zvp_14utf8.t
t/zvp_15array.t
t/zvp_16destroy.t
t/zvp_19fhtrace.t
t/zvp_20meta.t
t/zvp_30subclass.t
t/zvp_31methcache.t
t/zvp_35thrclone.t
t/zvp_40profile.t
t/zvp_41prof_dump.t
t/zvp_42prof_data.t
t/zvp_43prof_env.t
t/zvp_48dbi_dbd_sqlengine.t
t/zvp_49dbd_file.t
t/zvp_50dbm_simple.t
t/zvp_51dbm_file.t
t/zvp_52dbm_complex.t
t/zvp_60preparse.t
t/zvp_65transact.t
t/zvp_70callbacks.t
t/zvp_72childhandles.t
t/zvp_80proxy.t
t/zvp_85gofer.t
t/zvp_86gofer_fail.t
t/zvp_87gofer_cache.t
t/zvp_90sql_type_cast.t
Creating test wrappers for DBD::Gofer + DBI::SQL::Nano:
t/zvxgn_48dbi_dbd_sqlengine.t
t/zvxgn_49dbd_file.t
t/zvxgn_50dbm_simple.t
t/zvxgn_51dbm_file.t
t/zvxgn_52dbm_complex.t
t/zvxgn_85gofer.t
Creating test wrappers for DBD::Gofer + DBI::PurePerl:
t/zvxgp_01basics.t
t/zvxgp_02dbidrv.t
t/zvxgp_03handle.t
t/zvxgp_04mods.t
t/zvxgp_05concathash.t
t/zvxgp_06attrs.t
t/zvxgp_07kids.t
t/zvxgp_08keeperr.t
t/zvxgp_09trace.t
t/zvxgp_10examp.t
t/zvxgp_11fetch.t
t/zvxgp_12quote.t
t/zvxgp_13taint.t
t/zvxgp_14utf8.t
t/zvxgp_15array.t
t/zvxgp_16destroy.t
t/zvxgp_19fhtrace.t
t/zvxgp_20meta.t
t/zvxgp_30subclass.t
t/zvxgp_31methcache.t
t/zvxgp_35thrclone.t
t/zvxgp_40profile.t
t/zvxgp_41prof_dump.t
t/zvxgp_42prof_data.t
t/zvxgp_43prof_env.t
t/zvxgp_48dbi_dbd_sqlengine.t
t/zvxgp_49dbd_file.t
t/zvxgp_50dbm_simple.t
t/zvxgp_51dbm_file.t
t/zvxgp_52dbm_complex.t
t/zvxgp_60preparse.t
t/zvxgp_65transact.t
t/zvxgp_70callbacks.t
t/zvxgp_72childhandles.t
t/zvxgp_80proxy.t
t/zvxgp_85gofer.t
t/zvxgp_86gofer_fail.t
t/zvxgp_87gofer_cache.t
t/zvxgp_90sql_type_cast.t
Creating test wrappers for DBI::SQL::Nano + DBI::PurePerl:
t/zvxnp_48dbi_dbd_sqlengine.t
t/zvxnp_49dbd_file.t
t/zvxnp_50dbm_simple.t
t/zvxnp_51dbm_file.t
t/zvxnp_52dbm_complex.t
t/zvxnp_85gofer.t
Creating test wrappers for DBD::Gofer + DBI::SQL::Nano + DBI::PurePerl:
t/zvxgnp_48dbi_dbd_sqlengine.t
t/zvxgnp_49dbd_file.t
t/zvxgnp_50dbm_simple.t
t/zvxgnp_51dbm_file.t
t/zvxgnp_52dbm_complex.t
t/zvxgnp_85gofer.t
Checking if your kit is complete...
Looks good
Have /usr/perl5/5.12/lib/Sun/Solaris/PerlGcc
Want /usr/perl5/5.12/lib/i86pc-solaris-64int
Your perl and your Config.pm seem to have different ideas about the
architecture they are running on.
Perl thinks: [PerlGcc]
Config says: [i86pc-solaris-64int]
This may or may not cause problems. Please check your installation of perl
if you have problems building this extension.

    I see you're using perl 5.012003 on i86pc-solaris-64int, okay.
    Remember to actually *read* the README file!
    Use  'make' to build the software (dmake or nmake on Windows).
    Then 'make test' to execute self tests.
    Then 'make install' to install the DBI and then delete this working
    directory before unpacking and building any DBD::* drivers.

Writing Makefile for DBI
Writing MYMETA.yml and MYMETA.json
/usr/perl5/5.12/bin/perl -MExtUtils::Command -e 'mkpath' -- blib/lib/DBI
rm -f blib/lib/DBI/Changes.pm
cp Changes blib/lib/DBI/Changes.pm
cp Driver_xst.h blib/arch/auto/DBI/Driver_xst.h
cp lib/DBI/Gofer/Response.pm blib/lib/DBI/Gofer/Response.pm
cp lib/DBD/Proxy.pm blib/lib/DBD/Proxy.pm
cp lib/DBI/Util/_accessor.pm blib/lib/DBI/Util/_accessor.pm
cp lib/DBI/Gofer/Transport/Base.pm blib/lib/DBI/Gofer/Transport/Base.pm
cp lib/DBD/DBM.pm blib/lib/DBD/DBM.pm
cp DBIXS.h blib/arch/auto/DBI/DBIXS.h
cp dbixs_rev.pl blib/lib/dbixs_rev.pl
cp lib/DBI/Const/GetInfoType.pm blib/lib/DBI/Const/GetInfoType.pm
cp lib/DBI/Gofer/Serializer/DataDumper.pm blib/lib/DBI/Gofer/Serializer/DataDumper.pm
cp lib/DBI/DBD/Metadata.pm blib/lib/DBI/DBD/Metadata.pm
cp lib/DBI/Const/GetInfo/ODBC.pm blib/lib/DBI/Const/GetInfo/ODBC.pm
cp lib/DBD/Gofer/Transport/pipeone.pm blib/lib/DBD/Gofer/Transport/pipeone.pm
cp lib/DBI/ProfileDumper/Apache.pm blib/lib/DBI/ProfileDumper/Apache.pm
cp lib/DBD/File.pm blib/lib/DBD/File.pm
cp Driver.xst blib/arch/auto/DBI/Driver.xst
cp lib/DBD/File/Roadmap.pod blib/lib/DBD/File/Roadmap.pod
cp lib/DBI/Util/CacheMemory.pm blib/lib/DBI/Util/CacheMemory.pm
cp lib/DBI/ProfileSubs.pm blib/lib/DBI/ProfileSubs.pm
cp lib/DBD/NullP.pm blib/lib/DBD/NullP.pm
cp dbi_sql.h blib/arch/auto/DBI/dbi_sql.h
cp lib/DBD/Gofer.pm blib/lib/DBD/Gofer.pm
cp lib/DBD/File/HowTo.pod blib/lib/DBD/File/HowTo.pod
cp dbd_xsh.h blib/arch/auto/DBI/dbd_xsh.h
cp dbivport.h blib/arch/auto/DBI/dbivport.h
cp lib/DBI/DBD/SqlEngine/HowTo.pod blib/lib/DBI/DBD/SqlEngine/HowTo.pod
cp dbixs_rev.h blib/arch/auto/DBI/dbixs_rev.h
cp lib/DBD/Gofer/Transport/corostream.pm blib/lib/DBD/Gofer/Transport/corostream.pm
cp lib/DBD/Gofer/Transport/Base.pm blib/lib/DBD/Gofer/Transport/Base.pm
cp lib/DBI/FAQ.pm blib/lib/DBI/FAQ.pm
cp lib/DBD/Gofer/Policy/rush.pm blib/lib/DBD/Gofer/Policy/rush.pm
cp lib/DBI/SQL/Nano.pm blib/lib/DBI/SQL/Nano.pm
cp lib/DBI/Gofer/Request.pm blib/lib/DBI/Gofer/Request.pm
cp lib/DBI/Const/GetInfo/ANSI.pm blib/lib/DBI/Const/GetInfo/ANSI.pm
cp lib/DBD/Gofer/Transport/stream.pm blib/lib/DBD/Gofer/Transport/stream.pm
cp lib/DBD/Gofer/Policy/classic.pm blib/lib/DBD/Gofer/Policy/classic.pm
cp lib/DBI/Gofer/Transport/stream.pm blib/lib/DBI/Gofer/Transport/stream.pm
cp lib/DBI/Const/GetInfoReturn.pm blib/lib/DBI/Const/GetInfoReturn.pm
cp DBI.pm blib/lib/DBI.pm
cp lib/DBI/Gofer/Serializer/Storable.pm blib/lib/DBI/Gofer/Serializer/Storable.pm
cp lib/DBD/Gofer/Policy/Base.pm blib/lib/DBD/Gofer/Policy/Base.pm
cp lib/DBD/Sponge.pm blib/lib/DBD/Sponge.pm
cp lib/DBD/Gofer/Policy/pedantic.pm blib/lib/DBD/Gofer/Policy/pedantic.pm
cp lib/DBI/Gofer/Transport/pipeone.pm blib/lib/DBI/Gofer/Transport/pipeone.pm
cp lib/DBI/DBD/SqlEngine/Developers.pod blib/lib/DBI/DBD/SqlEngine/Developers.pod
cp lib/DBI/W32ODBC.pm blib/lib/DBI/W32ODBC.pm
cp lib/DBD/Gofer/Transport/null.pm blib/lib/DBD/Gofer/Transport/null.pm
cp lib/Bundle/DBI.pm blib/lib/Bundle/DBI.pm
cp lib/DBD/File/Developers.pod blib/lib/DBD/File/Developers.pod
cp lib/DBI/Profile.pm blib/lib/DBI/Profile.pm
cp lib/DBI/ProfileDumper.pm blib/lib/DBI/ProfileDumper.pm
cp lib/DBI/Gofer/Serializer/Base.pm blib/lib/DBI/Gofer/Serializer/Base.pm
cp lib/DBI/ProxyServer.pm blib/lib/DBI/ProxyServer.pm
cp dbipport.h blib/arch/auto/DBI/dbipport.h
cp lib/DBI/Gofer/Execute.pm blib/lib/DBI/Gofer/Execute.pm
cp lib/DBI/DBD.pm blib/lib/DBI/DBD.pm
cp lib/Win32/DBIODBC.pm blib/lib/Win32/DBIODBC.pm
cp lib/DBI/DBD/SqlEngine.pm blib/lib/DBI/DBD/SqlEngine.pm
cp lib/DBI/PurePerl.pm blib/lib/DBI/PurePerl.pm
cp lib/DBD/ExampleP.pm blib/lib/DBD/ExampleP.pm
cp lib/DBI/ProfileData.pm blib/lib/DBI/ProfileData.pm
/usr/perl5/5.12/bin/perl -p -e "s/~DRIVER~/Perl/g" ./Driver.xst > Perl.xsi
/usr/perl5/5.12/bin/perl /usr/perl5/5.12/lib/ExtUtils/xsubpp  -typemap /usr/perl5/5.12/lib/ExtUtils/typemap -typemap typemap  Perl.xs > Perl.xsc && mv Perl.xsc Perl.c
gcc -c   -DPTR_IS_LONG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -xO4   -DVERSION=\"1.621\" -DXS_VERSION=\"1.621\" -KPIC "-I/usr/perl5/5.12/lib/i86pc-solaris-64int/CORE"  -DDBI_NO_THREADS Perl.c
gcc: unrecognized option '-KPIC'
gcc: language O4 not recognized
gcc: language O4 not recognized
gcc: Perl.c: linker input file unused because linking not done
/usr/perl5/5.12/bin/perl /usr/perl5/5.12/lib/ExtUtils/xsubpp  -typemap /usr/perl5/5.12/lib/ExtUtils/typemap -typemap typemap  DBI.xs > DBI.xsc && mv DBI.xsc DBI.c
gcc -c   -DPTR_IS_LONG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -xO4   -DVERSION=\"1.621\" -DXS_VERSION=\"1.621\" -KPIC "-I/usr/perl5/5.12/lib/i86pc-solaris-64int/CORE"  -DDBI_NO_THREADS DBI.c
gcc: unrecognized option '-KPIC'
gcc: language O4 not recognized
gcc: language O4 not recognized
gcc: DBI.c: linker input file unused because linking not done
Running Mkbootstrap for DBI ()
chmod 644 DBI.bs
rm -f blib/arch/auto/DBI/DBI.so
cc  -G -L/usr/lib -L/usr/ccs/lib  -L/lib -L/usr/gnu/lib DBI.o  -o blib/arch/auto/DBI/DBI.so     \
            \

gmake: cc: Command not found
gmake: *** [blib/arch/auto/DBI/DBI.so] Error 127
TIMB/DBI-1.621.tar.gz
/usr/sfw/bin/gmake -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
TIMB/DBI-1.621.tar.gz                        : make NO

Sorry I took so long to edit this and put up the error, got a little busy along the way. Anyone have any ideas what this gigantic error means? I figure it's something related to the compiler, just not sure what.

NEW EDIT

So after I found the workaround, it went through the installation process (which took surprisingly long) and finally came out with this...

Test Summary Report
-------------------
../cpan/CGI/t/tmpdir.t                                          (Wstat: 0 Tests: 9 Failed: 0)
  TODO passed:   3, 6, 8
../cpan/Socket/t/getnameinfo.t                                  (Wstat: 256 Tests: 14 Failed: 1)
  Failed test:  10
  Non-zero exit status: 1
Files=2334, Tests=522101, 1212 wallclock secs (90.50 usr 58.34 sys + 533.70 cusr 288.26 csys = 970.80 CPU)
Result: FAIL
*** Error code 1
make: Fatal error: Command failed for target `test_harness'
Installed /home/oracle/perl5/perlbrew/build/perl-5.16.0 as perl-5.16.0 successfully. Run the following command to switch to it.

  perlbrew switch perl-5.16.0

Just based on that, I went ahead and did /home/oracle/perl5/perlbrew/bin/perlbrew switch perl-5.16.0 but it returned, perl-5.16.0 is not installed


:/

I just went ahead and tried to look for an instance of perl-5.16.0 and did...

root@dr-solaris11:~/perl5/perlbrew/build# cd /home/oracle/perl5/perlbrew/build/perl-5.16.0
root@dr-solaris11:~/perl5/perlbrew/build/perl-5.16.0# ls
Artistic                 MANIFEST                 README.cn
AUTHORS                  mathoms.c                README.cygwin
autodoc.pl               mathoms.o                README.dgux
av.c                     META.yml                 README.dos
av.h                     metaconfig.h             README.epoc
av.o                     metaconfig.SH            README.freebsd
beos                     mg_data.h                README.haiku
bitcount.h               mg_names.c               README.hpux
cflags                   mg_raw.h                 README.hurd
cflags.SH                mg_vtable.h              README.irix
Changes                  mg.c                     README.jp
charclass_invlists.h     mg.h                     README.ko
config_h.SH              mg.o                     README.linux
config.h                 minimod.pl               README.macos
config.over              miniperl                 README.macosx
config.sh                miniperlmain.c           README.micro
configpm                 miniperlmain.o           README.mpeix
Configure                mkppport                 README.netware
configure.com            mkppport.lst             README.openbsd
configure.gnu            mpeix                    README.os2
cop.h                    mro.c                    README.os390
Copying                  mro.o                    README.os400
cpan                     myconfig                 README.plan9
Cross                    myconfig.SH              README.qnx
cv.h                     mydtrace.h               README.riscos
cygwin                   NetWare                  README.solaris
deb.c                    nostdio.h                README.symbian
deb.o                    numeric.c                README.tru64
dist                     numeric.o                README.tw
djgpp                    op_reg_common.h          README.uts
doio.c                   op.c                     README.vmesa
doio.o                   op.h                     README.vms
doop.c                   op.o                     README.vos
doop.o                   opcode.h                 README.win32
dosish.h                 opmini.c                 realclean.sh
dquote_static.c          opmini.o                 reentr.c
dump.c                   opnames.h                reentr.h
dump.o                   os2                      reentr.o
DynaLoader.o             overload.c               regcharclass.h
embed.fnc                overload.h               regcomp.c
embed.h                  pad.c                    regcomp.h
embedvar.h               pad.h                    regcomp.o
epoc                     pad.o                    regcomp.sym
ext                      parser.h                 regen
ext.libs                 patchlevel.h             regen_perly.pl
EXTERN.h                 perl                     regen.pl
extra.pods               perl.c                   regexec.c
fakesdio.h               perl.h                   regexec.o
fakethr.h                perl.o                   regexp.h
feature.h                perlapi.c                regnodes.h
form.h                   perlapi.h                run.c
generate_uudmap          perlapi.o                run.o
generate_uudmap.c        perldtrace.d             runtests
generate_uudmap.o        perlio.c                 runtests.SH
genpacksizetables.pl     perlio.h                 scope.c
git_version.h            perlio.o                 scope.h
globals.c                perlio.sym               scope.o
globals.o                perliol.h                sv.c
globvar.sym              perlmain.c               sv.h
gv.c                     perlmain.o               sv.o
gv.h                     perlmini.c               symbian
gv.o                     perlmini.o               t
h2pl                     perlsdio.h               taint.c
haiku                    perlsfio.h               taint.o
handy.h                  perlsh                   TestInit.pm
hints                    perlvars.h               thread.h
hv.c                     perly.act                time64_config.h
hv.h                     perly.c                  time64.c
hv.o                     perly.h                  time64.h
INSTALL                  perly.o                  toke.c
install_lib.pl           perly.tab                toke.o
installhtml              perly.y                  uconfig.h
installman               plan9                    uconfig.sh
installperl              pod                      uconfig64.sh
INTERN.h                 Policy_sh.SH             universal.c
intrpvar.h               Policy.sh                universal.o
iperlsys.h               Porting                  unixish.h
keywords.c               pp_ctl.c                 utf8.c
keywords.h               pp_ctl.o                 utf8.h
keywords.o               pp_hot.c                 utf8.o
l1_char_class_tab.h      pp_hot.o                 utfebcdic.h
lib                      pp_pack.c                util.c
libperl.a                pp_pack.o                util.h
locale.c                 pp_proto.h               util.o
locale.o                 pp_sort.c                utils
mad                      pp_sort.o                utils.lst
madly.c                  pp_sys.c                 uts
make_ext.pl              pp_sys.o                 uudmap.h
make_patchnum.pl         pp.c                     veryclean.sh
makedef.pl               pp.h                     vmesa
makedepend               pp.o                     vms
makedepend.SH            proto.h                  vos
makefile                 qnx                      warnings.h
Makefile                 README                   win32
Makefile.micro           README.aix               write_buildcustomize.pl
makefile.old             README.amiga             x2p
Makefile.SH              README.beos              XSUB.h
malloc_ctl.h             README.bs2000
malloc.c                 README.ce

Then I tried, /home/oracle/perl5/perlbrew/bin/perlbrew switch /home/oracle/perl5/perlbrew/build/perl-5.16.0 and I still got: /home/oracle/perl5/perlbrew/build/perl-5.16.0 is not installed

:/

This 0ne Pr0grammer
  • 2,632
  • 14
  • 57
  • 81
  • 1
    If you could provide some specific error messages on install, that would be a good start. – oalders May 24 '12 at 21:17
  • Well it has been a variety of errors, and when an error is corrected, it has just led to another error, so we are not sure if we are making progress or just running in circles. Our most recent error has dealt with the Makefile.pl on the DBD 1.621 driver that indicated that @INC cannot find DBI.pm. I found the binary library for DBI.pm and moved that file over to the location of perl and all the other files, but we still receive the same error. So we're at a loss right now. – This 0ne Pr0grammer May 24 '12 at 21:29
  • 3
    CGI is a pure-Perl module. You shouldn't have any problems whatsoever installing it! – ikegami May 24 '12 at 23:13
  • 1
    To your ***extremely*** general question, all I can suggest is perhaps you would have better luck building your own Perl instead of messing with the system Perl. On linux, this is dead easy using [`perlbrew`](http://search.cpan.org/perldoc?perlbrew), and it might be just as easy on Solaris. Messing with the files in the library directories was a bad idea. – ikegami May 24 '12 at 23:17
  • 1
    We've got absolutely nothing to work on here. Start with DBI. Download the latest tar.gz from CPAN, untar it, cd into created dir and run perl Makefile.PL them make. What is the output? – bohica May 25 '12 at 08:34
  • @ikegami No problems installing CGI or DBI (I don't believe), the big problem comes when trying to install the DBD driver. – This 0ne Pr0grammer May 25 '12 at 16:08
  • 1
    Install your own perl and use the cpan command line tool instead of downloading the tar-balls yourself – Cfreak May 25 '12 at 16:09
  • @bohica Just updated the main post, I'll try and post the exact error code lines as soon as I can. But do you have any idea based on what I have down so far? – This 0ne Pr0grammer May 25 '12 at 16:09
  • @Cfreak, I was thinking about doing that, but what difference do you think that would make (using the CPAN shell)? – This 0ne Pr0grammer May 25 '12 at 16:11
  • 1
    @This0nePr0grammer you'll still need to make sure you have the compiler ready but otherwise it will figure out the dependencies for you. As long as you use the cpan shell for the correct perl version it will ensure that everything is compiled against that version. – Cfreak May 25 '12 at 16:13
  • @Cfreak Ah, I really wish I could get to the Solaris box right now. But I'll try that out the next chance I get and let you know what happens. – This 0ne Pr0grammer May 25 '12 at 16:15
  • Also of interest may be [Perl on Solaris](https://community.oracle.com/thread/1915569), which walks you though using the Perl that is installed on Solaris to add modules like `HTTP::Request::Common` and `LWP::UserAgent`. – jww Mar 10 '19 at 04:06
  • And also of interest may be [OpenCSW](https://www.opencsw.org/). OpenCSW is a Solaris-specific package manager like MacPorts on OS X. – jww Mar 10 '19 at 04:26

3 Answers3

3
  1. Undo everything, keep the GNU compiler toolchain (gnu-make, gcc-45).
  2. Follow the instructions at http://perlbrew.pl/ to install perlbrew. (Mind to set the environment variable PERLBREW_ROOT first if you want to store perlbrew's files in a non-default directory.) At the end of its installation, it tells you to add shell commands to your login shell configuration and log in again, don't neglect those steps.
  3. Use perlbrew to install a supported Perl:

    perlbrew -v install perl-5.16.0 -Dcc=gcc
    perlbrew switch perl-5.16.0
    perlbrew install-cpanm
    
  4. cpanm is a replacement for cpan, no further configuration necessary.

    cpanm -v CGI
    cpanm -v DBI
    cpanm -v DBD::Oracle
    
daxim
  • 39,270
  • 4
  • 65
  • 132
  • Hey, so I am trying to go this route using perlbrew, but I'm a little confused what you mean by the part, "it tells you to add shell commands to your login shell configuration and log in again". I am assuming this is the same as the part in the install where it says "Append the following piece of code to the end of your ~/.bash_profile and start a new shell, perlbrew should be up and fully functional from there: source ~/perl5/perlbrew/etc/bashrc". I'm just not sure where exactly to find the login shell configuration? – This 0ne Pr0grammer Jun 06 '12 at 14:46
  • Actually I went ahead and did a little research and people were saying that .profile is the same as .bash_profile and if I couldn't find .bash_profile, I could just add the piece of code to the .profile file. I went ahead and did that, saved the changes, then closed the terminal window. I then started a new terminal window, logged in as root user, and entered the command "perlbrew -v install perl-5.16.0 -Dcc=gcc". However, it returned: "bash: perlbrew: command not found". Not sure what I may have done wrong? – This 0ne Pr0grammer Jun 06 '12 at 15:19
  • 1
    I find it curious that when your `bash` starts, it does not pick up `.profile`. Then simply create `.bash_profile`, add that `source` statement there, and log in again. The command `type perlbrew` should show you that perlbrew is a shell function eventually calling on the real perlbrew file at `$PERLBREW_ROOT/bin/perlbrew`. – daxim Jun 06 '12 at 15:36
  • I went ahead and created a new ".bash_profile" by just doing a **vi ~/.bash_profile**. I then added **source ~/perl5/perlbrew/etc/bashrc** to the file, saved the changes and closed out the file. I then closed the terminal and started a new one, logged in as root and tried running **perlbrew -v install perl-5.16.0 -Dcc=gcc**, but still got the same output as last time. – This 0ne Pr0grammer Jun 06 '12 at 16:12
  • Did I have to change some environment variable in there somewhere? What ended up working was doing **/home/oracle/perl5/perlbrew/bin/perlbrew -v install perl-5.16.0 -Dcc=gcc**. It's going through the installation process right now, I'll let you know what happens. – This 0ne Pr0grammer Jun 06 '12 at 16:18
  • 1
    I cannot solve that problem, perhaps [open a new question](http://stackoverflow.com/questions/ask) for this. Simple work-around so you can continue: whenever you open a new shell, first execute `source ~/perl5/perlbrew/etc/bashrc` manually. – daxim Jun 06 '12 at 16:20
  • The install just finished. The results are posted in the edit to the OP. Any ideas on that one? – This 0ne Pr0grammer Jun 06 '12 at 16:59
  • 1
    You never said whether sourcing the file manually worked for you. - `perlbrew switch` is not strictly necessary, either, if you keep using full paths. Your newly installed `perl` is at `$PERLBREW_ROOT/perls/perl-5.16.0/bin/perl`, ignore both the small test failures and the build directory you found. `perlbrew` is at `$PERLBREW_ROOT/bin/perlbrew`. Run `$PERLBREW_ROOT/bin/perlbrew install-cpanm` to get `cpanm`. `cpanm` will be `$PERLBREW_ROOT/bin/cpanm`. Instead of just `cpanm ………`, run `$PERLBREW_ROOT/perls/perl-5.16.0/bin/perl $PERLBREW_ROOT/bin/cpanm ………`. – daxim Jun 06 '12 at 17:39
  • Just tried manually sourcing, and it seems to have worked. Was able to execute 'perlbrew -v install perl-5.16.0 -Dcc=gcc'. It's going through the entire installation again - hesitant to stop it as I don't want to mess anything up. The installation just now finished. Just tried `perlbrew switch perl-5.16.0` and it returned `ERROR: The installation "perl-5.16.0" is unknown.` Since you said it's not strictly necessary, I went ahead and did `$PERLBREW_ROOT/bin/perlbrew install-cpanm` it asked to override the original install, and I said yes. – This 0ne Pr0grammer Jun 06 '12 at 18:34
  • Then it returned: `cpanm is installed to /home/oracle/perl5/perlbrew/bin/cpanm`. So I figure that means it's installed properly. I then did `$PERLBREW_ROOT/perls/perl-5.16.0/bin/perl $PERLBREW_ROOT/bin/cpanm -v CGI' and it returned: `bash: /home/oracle/perl5/perlbrew/perls/perl-5.16.0/bin/perl: No such file or directory`. So I went ahead and did an `echo $PERLBREW_ROOT` and found that equals `/home/oracle/perl5/perlbrew`. Next I tried `ls $PERLBREW_ROOT` and found it contains a **bin, build, build.log, Config.pm, dists, etc,** and **perls**. But when I do `ls $PERLBREW_ROOT/perls` I get nada. – This 0ne Pr0grammer Jun 06 '12 at 18:41
  • 1
    `$PERLBREW_ROOT` isn't set? Doesn't matter, resolve the paths yourself. Look in the `perls` directory, this contains the installed perl-5.16.0 directory. `/home/oracle/perl5/perlbrew/perls/perl-5.16.0/bin/perl` is the path to your new perl binary. `/home/oracle/perl5/perlbrew/bin` is the base path to `perlbrew` and `cpanm`. Use full paths, as I said above. - I'm going away for today, you can get live help in channel `#perl-help` on [irc.perl.org](http://irc.perl.org) . – daxim Jun 06 '12 at 18:49
  • `PERLBREW_ROOT` is set; it is set to `/home/oracle/perl5/perlbrew`. What I was saying was when I looked in the perls directory within `/home/oracle/perl5/perlbrew/perls`, I didn't find anything (such as perl-5.16.0). The only instance of that I saw was in the build directory under `/home/oracle/perl5/perlbrew/`. Thanks for all your help so far though. Really appreciate it. I'll try looking into that link you gave me and hopefully I can get this figured out. :) – This 0ne Pr0grammer Jun 06 '12 at 18:59
  • Hey, just to give you an update I was able to install both the CGI and DBI modules (the DBI with a little bit of trouble, i.e. with a force install), however I could not get the DBD driver to install. This was because the oracle client we were using was 64 bit and we needed the 32 bit binaries to install the DBD module (or at least that is what we deciphered). However, you still had the best/most helpful response and I just wanted to say thank you for all your help! – This 0ne Pr0grammer Jun 11 '12 at 15:05
2

Going back to your installation:

Step 1-5 is fine. Don't export the PERL5LIB or PERLLIB not sure what the point of that is.

Step 6) compile DBI

cd DBI-1.621

since you want to use a different perl do the following:

/opt/oracle/rdbms/perl/bin/perl Makefile.PL

This should pickup the compiler option and perl libraries location of that perl (I assume you are trying to use the perl from oracle installation, not sure if that is wise). Run make in the DBI-1.621 and then make install.

Step 7) Compile DBD:Oracle and once again use your /opt/oracle/rdbms/perl/bin/perl on the Makefile.PL to create the makefile, don't edit the Makefile.PL. Make sure you have ORACLE_HOME set and ORACLE_USERID if you want to do make test. You may have to also set the LD_LIBRARY_PATH to include $ORACLE_HOME/lib if its not there already. Run make and install as you did with DBI.

Step 8) Compile CGI, as before use /opt/oracle/rdbms/perl/bin/perl on the Makefile.PL to generate the proper makefile and then run make and install.

Alternate method would be:

do step1-5
export ORACLE_HOME="enter oracle home"
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/lib

/opt/oracle/rdbms/perl/bin/perl -MCPAN -e 'shell'
cpan>install DBI
cpan>install DBD::Oracle
cpan>install CGI

MichaelN
  • 1,734
  • 11
  • 6
1
  1. I'm not sure why you're changing where the distribution is being installed, but to do so use

    perl Makefile.PL PREFIX=/opt/oracle/rdbms
    

    or some such. Don't edit Makefile.

  2. You change where the module is installed, but it's not clear that you tell Perl where it is installed. For the above command, you'd need something of the sort:

    export PERL5LIB=/opt/oracle/rdbms/lib/site_perl
    

    If you still can't get it to work, please provide the full error message -- it should specify where Perl looked -- and the full patch to the directory is DBI.pm located after install. (Using the above settings, it might be found in something like /opt/oracle/rdbms/lib/site_perl/5.16.0/x86_64-linux-thread-multi/DBI.pm.)

ikegami
  • 367,544
  • 15
  • 269
  • 518