Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

DBD-Sybase Sybase.so vs. DynaLoader.pm

by steve98177 (Initiate)
on Feb 19, 2012 at 18:02 UTC ( [id://954895]=perlquestion: print w/replies, xml ) Need Help??

steve98177 has asked for the wisdom of the Perl Monks concerning the following question:

Hello! I've installed Freetds (0.91) and DBD::Sybase (1.14) in my Perl 5.8.8 CentOS 5.7 environment without error after a major battle.

Unhappily, though, when I run my perl script, Dynaloader.pm croaks like this:

Install_driver(Sybase) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/auto/DBD/Sybase/Sybase.so' for module DBD::Sybase: libct.so.4: ...Perhaps a required shared library or dll isn't installed where expected

Yet libct.so.4 lives here:

/usr/local/lib/libct.so.4
/usr/local/lib/libct.so.4.0.0

How can I fix this? Do I need to hack LD_LIBRARY_PATH? Thanks

Replies are listed 'Best First'.
Re: DBD-Sybase Sybase.so vs. DynaLoader.pm
by Eliya (Vicar) on Feb 19, 2012 at 18:09 UTC
    Do I need to hack LD_LIBRARY_PATH?

    Yes, that would be one way to fix the problem.  But note that you typically have to set it before the script is executed. I.e., setting LD_LIBRARY_PATH from within a BEGIN block may not be enough.  Either set it in a shell wrapper that then execs the Perl script, or re-exec the Perl script from within the BEGIN block (see (tye)Re: programatically setting the LD_LIBRARY_PATH).

Re: DBD-Sybase Sybase.so vs. DynaLoader.pm
by Sewi (Friar) on Feb 19, 2012 at 20:25 UTC

    FreeTDS has major drawbacks, it's usually better to download the free ASE Express Edition which includes the Sybase Client libs.

    You may need to set the SYBASE environment variable (and maybe even others). ASE creates a ASE150.sh file during installation which sets all required variables.

      Would you care to elaborate on major drawbacks? I've used freetds quite successfully for both perl and ruby projects and have yet to run into any real issues (but then again maybe my problem domain is not very taxing). Also, rather than mucking with LD_LIBRARY_PATH, most *nix distributions use something like ldconfig to set where the loader finds it's libs. If being a sybase client is the core functionality of the box, I would use ldconfig before I started wrapping every client app in a LD_LIBRARY_PATH wrapper.

      -derby

        I'm not using the current version, but it doesn't have placeholder support, can't use varchar or text columns longer than ~255 chars and it feels like error messages are clearer using OpenClient.

Re: DBD-Sybase Sybase.so vs. DynaLoader.pm
by steve98177 (Initiate) on Feb 19, 2012 at 18:41 UTC

    Thanks, and excuse the double post.

    The problem vanished after adding this to /etc/profile:

    export LD_LIBRARY_PATH=/usr/local/lib

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://954895]
Approved by Eliya
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-23 09:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found