Install Sybase Perl module in Solaris 10

Installing Perl modules in Sun Solaris is not as straight forward but is not very difficult as well.  Perl module installations in Sun Solaris needs GNU Make rather than the default make tool installed. And, requires using perlgcc to build the Makefile.PL than the default perl binary.

Installing Sybase Perl Module requires the following preinstalled

1. Sybase Server/Client already installed on your server
2. GNU Make

Install GNU Make

Assuming you have already installed Sybase Server/Client on your system, lets download and install GNU Make.

GNU Make package can be downloaded from sunfreeware.com website. At the time of writing, the version available for download is Make 3.81

Download GNU Make for Solaris 10 (SPARC)

Download Make for Solaris 10 (x86)

Unzip and Install GNU Make

From the directory where the file is downloaded

# gunzip make-3.81-sol10-x86-local.gz
# pkgadd -d make-3.81-sol10-x86-local

This should install “make” under /usr/local/bin

# which make
/usr/local/bin/make

Download Perl Modules from www.cpan.org. The modules we are interested in are

1. DBI (Database Independent Interface for Perl)

2. DBD::Sybase (Sybase database Driver for the DBI module)

NOTE: I find in Solaris 10 Update 6, DBI module is already installed which means we only need to install DBD::Sybase module.

To verify either of the modules is already installed on the system,

For DBI, file DBI.pm should exist under

x86

/usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int/DBI.pm

SPARC

/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/DBI.pm

For DBD::Sybase

x86

/usr/perl5/site_perl/5.8.4/i86pc-solaris-64int/DBD/Sybase.pm

SPARC

/usr/perl5/site_perl/5.8.4/sun4-solaris-64int/DBD/Sybase.pm

Now, assuming both these modules are not installed

Install Perl DBI Module

Download the DBI Module from here

From the download directory,

# gunzip DBI-1.609.tar.gz
# tar -xvf DBI-1.609.tar
# cd DBI-1.609

The above steps should (g)unzip, untar the downloaded source files.

Export $SYBASE & $LD_LIBRARY_PATH environment variables. We have the Sybase client installed under

/opt/sybase/oc15.0-EBF16084/OCS-15_0

which means the libraries exist under

/opt/sybase/oc15.0-EBF16084/OCS-15_0/lib

# export SYBASE=/opt/sybase/oc15.0-EBF16084/OCS-15_0
# export LD_LIBRARY_PATH=/opt/sybase/oc15.0-EBF16084/OCS-15_0/lib:$LD_LIBRARY_PATH

If this step is skipped, the following error comes up in the next step:

Can’t find the lib directory under /export/home/sybase! at Makefile.PL line 118, <IN> line 44.

Now comes the tricky bit, use /usr/perl5/bin/perlgcc instead of default perl as follows:

# /usr/perl5/bin/perlgcc Makefile.PL

Let’s now compile and install using GNU Make from source directory

# /usr/local/bin/make
# /usr/local/bin/make test
# /usr/local/bin/make install

To make sure the install compelted successfully. Check if the DBI.pm file exists as shown earlier.

Install Perl DBD::Sybase module

Download DBD::Sybase perl module from here.

From the downloaded directory:

# gunzip DBD-Sybase-1.09.tar.gz
# tar -xvf DBD-Sybase-1.09.tar
# cd DBD-Sybase-1.09

The above should (g)unzip, untar the downloaded file and change into the source directory.

Export the $SYBASE & $LD_LIBRARY_PATH environment variables if you have already not done so.

# export SYBASE=/opt/sybase/oc15.0-EBF16084/OCS-15_0
# export LD_LIBRARY_PATH=/opt/sybase/oc15.0-EBF16084/OCS-15_0/lib:$LD_LIBRARY_PATH

Run perlgcc against the Makefile.PL as follows:

# /usr/perl5/bin/perlgcc Makefile.PL

Select the default CHAIN mode or modify as required, then enter the Sybase Server, a Sybase Username and password and a Database as and when promted. This will allow the installation test connection. Make sure this DB connection is updated in the Sybase “interfaces” file.

NOTE: Once the installation is completed. Either the PWD file created by this procedure or the entire Source directory should be deleted as the PWD file will contain these DB access details. Also, it is advisable to provide a test DB access detail rather than a live environment.

Let’s now compile and install using GNU Make from source directory

# /usr/local/bin/make

Now, re-export $SYBASE as follows:

# export SYBASE=/opt/sybase/oc15.0-EBF16084

[NOTE: This may vary in your environment]

# /usr/local/bin/make test
# /usr/local/bin/make install

This should install the Sybase Perl module. To confirm the installation was successful, look for Sybase.pm as explained earlier.

2 thoughts on “Install Sybase Perl module in Solaris 10”

Leave a Comment

Your email address will not be published. Required fields are marked *