Re: problem with install DBD::mysql

Michael Stassen <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <[email protected]>
I have to disagree.  By default, the Solaris runtime linker only looks in 
/usr/lib (or /usr/lib64).  Whether you leave the mysql client library where 
it is, neatly organized with the rest of the mysql install, or move it to 
/usr/local/lib, you'll still have to tell the runtime linker where to look. 
  (I would definitely recommend against putting anything in /usr/lib that 
Solaris didn't put there, unless you want to complicate things like OS 
upgrades.)  When building an app on Solaris, just as you use -L to tell ld 
where to find libraries at link time, you need to use -R to specify where to 
find dynamic libraries at run time.  In other words, you need to add

   -R /path/to/mysql/libraries

to your LDFLAGS when you build DBD::mysql.  This works in any version of 
Solaris.

Starting with Solaris 8, you could instead add /path/to/mysql/libraries to 
the list automatically searched by the run time linker using the Solaris 
tool crle (configure runtime linking environment).  You could also do this 
with LD_LIBRARY_PATH, but that is not recommended.

Some references:
man ld <http://docs.sun.com/app/docs/doc/816-0210/6m6nb7mcs?a=view>
ld.so.1 <http://docs.sun.com/app/docs/doc/816-0210/6m6nb7md6?a=view>
<http://docs.sun.com/app/docs/doc/816-1386/6m7qcobkh?a=view#chapter2-84569>
<http://docs.sun.com/app/docs/doc/816-1386/6m7qcobko?a=view#chapter3-32>
man crle <http://docs.sun.com/app/docs/doc/816-0210/6m6nb7m6t?a=view>
<http://www.linuxmafia.com/faq/Admin/ld-lib-path.html>

Michael

Peter P. Benac wrote:
> Solaris by default looks in /usr/lib and /usr/local/lib for shared
> libraries.  Either move the MySQL client libraries to one of these two paths
> or export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/mysql/libraries
> optionally you can tell the Make where the libraries are, but in the long
> run it is best to install them in either /usr/local/lib or /usr/lib
> 
> Regards,
> Pete
> ----
> Peter P. Benac, CCNA
> Celtic Spirit Network Solutions
> Providing Network and Systems Project Management and Installation and Web
> Hosting.
> Phone: 919-618-2557
> Web: http://www.emacolet.com
> Need quick reliable Systems or Network Management advice visit
> http://www.nmsusers.org
> 
> To have principles...
>              First have courage.. With principles comes integrity!!!
> 
> -----Original Message-----
> From: Jorge Vivaldi Palatresi [mailto:[email protected]] 
> Sent: Tuesday, November 16, 2004 11:02 AM
> To: [email protected]
> Subject: problem with install DBD::mysql
> 
> 
> Hi all,
> 
> I am trying to install the Perl module DBD::mysql on a Sun SPARC running
> Solaris 9. I succesfully installed mysql  (version 4.0.21), DBI-1.45 but
> failed to install DBD::mysql. As a matter of fact, I run succesfully
> - perl Makefile.PL
> - make
> but failed to "make test". Perl version is 5.8.0 and gcc is version 3.3.
> Mysql seems to run ok. It seems that the client library is not loaded but I
> can't figure out the reason. Any help is very welcomed.
> 
> Jorge Vivaldi
> 
> 
> # make test
> PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e"
> "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
> t/00base...........install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/00base.t line 38
> t/00base...........dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 4-5
>         Failed 2/5 tests, 60.00% okay
> t/10dsnlist........install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/10dsnlist.t line
> 45 t/10dsnlist........dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-9
>         Failed 9/9 tests, 0.00% okay
> t/20createdrop.....install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/20createdrop.t
> line 45 t/20createdrop.....dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-5
>         Failed 5/5 tests, 0.00% okay
> t/30insertfetch....install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/30insertfetch.t
> line 48 t/30insertfetch....dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-11
>         Failed 11/11 tests, 0.00% okay
> t/40bindparam......install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 3)
> line 3 Compilation failed in require at (eval 3) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/40bindparam.t
> line 64 t/40bindparam......dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-28
>         Failed 28/28 tests, 0.00% okay
> t/40blobs..........install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/40blobs.t line 68
> t/40blobs..........dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-11
>         Failed 11/11 tests, 0.00% okay
> t/40listfields.....install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/40listfields.t
> line 57 t/40listfields.....dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-18
>         Failed 18/18 tests, 0.00% okay
> t/40nulls..........install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/40nulls.t line 50
> t/40nulls..........dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-11
>         Failed 11/11 tests, 0.00% okay
> t/40numrows........install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/40numrows.t line
> 59 t/40numrows........dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-25
>         Failed 25/25 tests, 0.00% okay
> t/50chopblanks.....install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/50chopblanks.t
> line 57 t/50chopblanks.....dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-35
>         Failed 35/35 tests, 0.00% okay
> t/50commit.........install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/50commit.t line
> 64 t/50commit.........dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-30
>         Failed 30/30 tests, 0.00% okay t/60leaks..........skipped
>         all skipped: $ENV{SLOW_TESTS} is not set or Proc::ProcessTable not
> installed
> t/ak-dbd...........install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/ak-dbd.t line 59
> t/ak-dbd...........dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-90
>         Failed 90/90 tests, 0.00% okay
> t/akmisc...........Had to create DBD::mysql::dr::imp_data_size unexpectedly
> at /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/DBI.pm line 1077. Can't
> locate object method "connect" via package "Mysql" at
> /usr2/iula/vivaldi/DBD-mysql-2.9004/blib/lib/Mysql.pm line 71.
> t/akmisc...........dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-351
>         Failed 351/351 tests, 0.00% okay
> t/dbdadmin.........install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/dbdadmin.t line
> 74 t/dbdadmin.........dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-21
>         Failed 21/21 tests, 0.00% okay
> t/insertid.........install_driver(mysql) failed: Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at (eval 1)
> line 3 Compilation failed in require at (eval 1) line 3. Perhaps a required
> shared library or dll isn't installed where expected  at t/insertid.t line
> 13 t/insertid.........dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-12
>         Failed 12/12 tests, 0.00% okay
> t/mysql............Can't load
> '/usr2/iula/vivaldi/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for
> module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal:
> libmysqlclient.so.12: open failed: No such file or directory at
> /usr/local/lib/perl5/5.8.0/sun4-solaris/DynaLoader.pm line 229.  at
> /usr2/iula/vivaldi/DBD-mysql-2.9004/blib/lib/Mysql.pm line 13 Compilation
> failed in require at /usr2/iula/vivaldi/DBD-mysql-2.9004/blib/lib/Mysql.pm
> line 13. Compilation failed in require at t/mysql.t line 34. BEGIN
> failed--compilation aborted at t/mysql.t line 34. t/mysql............dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-68
>         Failed 68/68 tests, 0.00% okay
> t/mysql2...........Had to create DBD::mysql::dr::imp_data_size unexpectedly
> at /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/DBI.pm line 1077. Use
> of uninitialized value in subroutine entry at
> /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris/DBI.pm line 1077. Can't
> locate object method "connect" via package "Mysql" at
> /usr2/iula/vivaldi/DBD-mysql-2.9004/blib/lib/Mysql.pm line 71.
> t/mysql2...........dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> Failed Test       Stat Wstat Total Fail  Failed  List of Failed
> ----------------------------------------------------------------------------
> ---
> t/00base.t         255 65280     5    2  40.00%  4-5
> t/10dsnlist.t      255 65280     9    9 100.00%  1-9
> t/20createdrop.t   255 65280     5    5 100.00%  1-5
> t/30insertfetch.t  255 65280    11   11 100.00%  1-11
> t/40bindparam.t    255 65280    28   28 100.00%  1-28
> t/40blobs.t        255 65280    11   11 100.00%  1-11
> t/40listfields.t   255 65280    18   18 100.00%  1-18
> t/40nulls.t        255 65280    11   11 100.00%  1-11
> t/40numrows.t      255 65280    25   25 100.00%  1-25
> t/50chopblanks.t   255 65280    35   35 100.00%  1-35
> t/50commit.t       255 65280    30   30 100.00%  1-30
> t/ak-dbd.t         255 65280    90   90 100.00%  1-90
> t/akmisc.t         255 65280   351  351 100.00%  1-351
> t/dbdadmin.t       255 65280    21   21 100.00%  1-21
> t/insertid.t       255 65280    12   12 100.00%  1-12
> t/mysql.t          255 65280    68   68 100.00%  1-68
> t/mysql2.t         255 65280    ??   ??       %  ??
> 1 test skipped.
> Failed 17/18 test scripts, 5.56% okay. 727/730 subtests failed, 0.41% okay.
> make: *** [test_dynamic] Error 2

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.