4 messages in com.mysql.lists.perlRe: MySQL, Solaris 9 and DBD::mysql| From | Sent On | Attachments |
|---|---|---|
| Sakshale eQuorian | 08 Dec 2004 11:36 | |
| Jochen Wiedmann | 08 Dec 2004 13:23 | |
| Sakshale eQuorian | 08 Dec 2004 14:20 | |
| Jochen Wiedmann | 08 Dec 2004 23:43 |
| Subject: | Re: MySQL, Solaris 9 and DBD::mysql![]() |
|---|---|
| From: | Sakshale eQuorian (saks...@equoria.net) |
| Date: | 12/08/2004 02:20:00 PM |
| List: | com.mysql.lists.perl |
Sakshale eQuorian wrote:
Ref: http://forums.mysql.com/read.php?11,7767,7767#msg-7767
Your problem is most probably related to the use of shared libraries (libmysqlclient.so). Try using static libraries as follows:
- Create a new, empty directory. I assume /tmp/mysql-static. - Copy the shared libraries (libmysqlclient.a, and perhaps others) to that directory - Use the "perl Makefile.PL" switch --libs for overriding "myqsl_config --libs". (You need the same flags, but replace the default lib directory with your new directory. In your case, this might be
perl Makefile.PL --libs=" -L/tmp/mysql-static -lmysqlclient -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lz"
Jochen
Thank you for responding.
Unfortunately, that was one of the solutions I had found that did not work in my instance.... I remember reading a note somewhere about Solaris not supporting static libraries without some optional package from Sun.
(notice the use of /usr/ccs in the path)
[src]# cd /usr/local/mysql/lib/mysql/ [mysql]# ls libdbug.a libmyisam.a libmysqlclient.la* libmystrings.a libvio.a libheap.a libmyisammrg.a libmysqlclient_r.a libmysys.a libmerge.a libmysqlclient.a libmysqlclient_r.la* libnisam.a [mysql]# mkdir /tmp/mysql-static [mysql]# cp -p *.a /tmp/mysql-static [mysql]# cd /root/.cpan/build/DBD-mysql-2.9004 [DBD-mysql-2.9004]# make clean rm -rf mysql.c *.xsi ./blib Makefile.aperl blib/arch/auto/DBD/mysql/extralibs.all blib/arch/auto/DBD/mysql/extralibs.ld perlmain.c tmon.out mon.out so_locations pm_to_blib *.o *.a perl.exe perl perl mysql.bs mysql.bso mysql.def libmysql.def mysql.exp mysql.x core core.*perl.*.? *perl.core core.[0-9] core.[0-9][0-9] core.[0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9][0-9] mv Makefile Makefile.old > /dev/null 2>&1 [DBD-mysql-2.9004]#
[DBD-mysql-2.9004]# perl Makefile.PL --libs=" -L/tmp/mysql-static -lmysqlclient -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lz" I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/local/mysql/include/mysql -fno-omit-frame-pointer libs (Users choice) = -L/tmp/mysql-static -lmysqlclient -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lz nocatchstderr (default ) = 0 nofoundrows (default ) = 0 ssl (guessed ) = 0 testdb (default ) = test testhost (default ) = testpassword (default ) = testuser (default ) =
To change these settings, see 'perl Makefile.PL --help' and 'perldoc INSTALL'.
Checking if your kit is complete... Looks good Using DBI 1.46 (for perl 5.008005 on sun4-solaris) installed in /usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBI/ Writing Makefile for DBD::mysql [root@palsrv12 DBD-mysql-2.9004]# make cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm cp lib/Mysql.pm blib/lib/Mysql.pm cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod cp lib/Mysql/Statement.pm blib/lib/Mysql/Statement.pm cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm gcc -B/usr/ccs/bin/ -c -I/usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBI/ -I/usr/local/mysql/include/mysql -fno-omit-frame-pointer -fno-strict-aliasing -pipe -I/usr/local/include -I/opt/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"2.9004\" -DXS_VERSION=\"2.9004\" -fPIC "-I/usr/local/lib/perl5/5.8.5/sun4-solaris/CORE" dbdimp.c /usr/local/bin/perl -p -e "s/~DRIVER~/mysql/g" /usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBI//Driver.xst > mysql.xsi /usr/local/bin/perl /usr/local/lib/perl5/5.8.5/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.8.5/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c Warning: duplicate function definition 'do' detected in mysql.xs, line 196 Warning: duplicate function definition 'rows' detected in mysql.xs, line 294 gcc -B/usr/ccs/bin/ -c -I/usr/local/lib/perl5/site_perl/5.8.5/sun4-solaris/auto/DBI/ -I/usr/local/mysql/include/mysql -fno-omit-frame-pointer -fno-strict-aliasing -pipe -I/usr/local/include -I/opt/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"2.9004\" -DXS_VERSION=\"2.9004\" -fPIC "-I/usr/local/lib/perl5/5.8.5/sun4-solaris/CORE" mysql.c Running Mkbootstrap for DBD::mysql () chmod 644 mysql.bs rm -f blib/arch/auto/DBD/mysql/mysql.so LD_RUN_PATH="/usr/lib:/usr/local/lib" /usr/local/bin/perl myld gcc -B/usr/ccs/bin/ -G -L/usr/local/lib -L/opt/gnu/lib dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.so -L/tmp/mysql-static -lmysqlclient -lposix4 -lcrypt -lgen -lsocket -lnsl -lm -lz chmod 755 blib/arch/auto/DBD/mysql/mysql.so cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs chmod 644 blib/arch/auto/DBD/mysql/mysql.bs Manifying blib/man3/DBD::mysql.3 Manifying blib/man3/DBD::mysql::INSTALL.3 Manifying blib/man3/Mysql.3 Manifying blib/man3/Bundle::DBD::mysql.3 [DBD-mysql-2.9004]#
[DBD-mysql-2.9004]# 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 '/root/.cpan/build/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: /usr/local/bin/perl: fatal: relocation error: file /root/.cpan/build/DBD-mysql-2.9004/blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_get_parameters: referenced symbol not found at /usr/local/lib/perl5/5.8.5/sun4-solaris/DynaLoader.pm line 230. 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
[snip]
Failed 17/18 test scripts, 5.56% okay. 727/730 subtests failed, 0.41% okay. make: *** [test_dynamic] Error 2 [DBD-mysql-2.9004]#




