Using Perl Modules with Cool Tools

We are having a problem trying to install a couple of Perl Modules (DBI:DBD

and DBD:mysql) to use in conjuction with CoolTools Perl and Mysql. We

have seen an article leading us to believe that the problem is because we are

using gcc whereas CoolTools was complied with Sun's compiler. So we

would like to know if others have seen this and is there a work around or fix.

THANKS...

[418 byte] By [Bill_Rowlanda] at [2007-11-26 17:57:10]
# 1
Which platform are you building on ? If on SPARC, I highly recommend that you use the Sun Studio compilers. Even on x86, we used Sun Studio 11 to build perl, as we ran into a bug with gcc.Shanti
shantiSa at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...
# 2

I'd like to know if anyone has built DBD::mysql (DBD-mysql-4.003) using cooltools also. Even with the sun compiler, all tests fail on it. Here is one example...

t/00base.............ok 1/5install_driver(mysql) failed: Can't load '/.cpan/build/DBD-mysql-4.003/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file /.cpan/build/DBD-mysql-4.003/blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_real_escape_string: referenced symbol not found at /opt/coolstack/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line 230.

As the original poster mentioned, the only solid source of the error seems to point to mysql and perl were built with two different compilers or machines. But that doesn't seem to be the case.

Bruce

Bruce_Langa at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...
# 3
I've the same issue, when I tried to install DBD::mysql with Coolstack 1.1 andSun Studio 11 cc compiler.Any help ?
tkk_deva at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...
# 4

I just downloaded and installed DBI and DBD::mysql successfully using the CoolStack version of perl.

All tests ran successfully on DBD::mysql

Here are the steps I followed :

. Added the following to my PATH : /opt/coolstack/mysql_32bit/bin:/opt/coolstack/bin

Make sure you have Sun Studio 11 compiler and /usr/ccs/bin in your PATH as well

. Downloaded DBI-1.54 and ran :

perl Makefile.PL; make; make test; make install

. Created a local mysql database and started the server :

cd /opt/coolstack/mysql/bin; ./mysql_install_db; ./mysqld_safe &

(I'm skipping a couple of steps - see the README file in the mysql dir)

. Downloaded DBD-mysql-4.003 and ran

perl Makefile.PL; make; make test

You can double-check things by looking at the Makefile generated in both DBI and DBD-mysql. It should use the CoolStack versions of the perl and mysql libraries and compiler options.

Shanti

shantiSa at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...
# 5

Santi,

Thanks a lot for your help Santi.

In my environment I've installed from the coolstack 1.1 (Apache,mysql_32bit client) , mysql_64bit server and perl_64bit and the Sun Studio 11 C,C++ compilers.

In my PATH I had /opt/coolstack/mysql/bin (which is the path for mysql 64bit

server), so when I changed my PATH including in the begining the /opt/coolstack/mysql_32bit/bin everything done OK during the DBD::mysql compilation (the DBD::mysql needs the mysql_32bit client libmyclient.so which doesn't exists on the mysql_64bit server).

regards

Thanasis

PS : During the compilation/installation of DBI which is required from the DBD::mysql package, I received some warnings that the 64_bit perl of coolstack doesn't support ithreads.

Is that correct ?

Any ideas ?

tkk_deva at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...
# 6

>

> In my environment I've installed from the coolstack

> 1.1 (Apache,mysql_32bit client) , mysql_64bit server

> and perl_64bit and the Sun Studio 11 C,C++

> compilers.

>

We don't ship a 64bit perl - only 32bit. That's why you need to link it with the 32bit mysql client library.

> PS : During the compilation/installation of DBI which

> is required from the DBD::mysql package, I received

> some warnings that the 64_bit perl of coolstack

> doesn't support ithreads.

>

> Is that correct ?

>

Yes it's correct - but again it's a 32bit Perl.

> Any ideas ?

Shanti

shantiSa at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...
# 7

I followed ShantiS' instructions and was successful on the DBI install but the DBD install failed @

# make test

PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/ar

ch')" t/*.t

t/00base.............ok 1/5install_driver(mysql) failed: Can't load '/export/DBD-mysql-4.003/blib/ar

ch/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file /exp

ort/DBD-mysql-4.003/blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_real_escape_string: referenced s

ymbol not found at /opt/coolstack/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line 230.

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/00base.t line 38

t/00base.............dubious

Test returned status 2 (wstat 512, 0x200)

DIED. FAILED tests 4-5

Failed 2/5 tests, 60.00% okay

t/10dsnlist..........install_driver(mysql) failed: Can't load '/export/DBD-mysql-4.003/blib/arch/aut

o/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file /export/DB

D-mysql-4.003/blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_real_escape_string: referenced symbol

not found at /opt/coolstack/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line 230.

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/10dsnlist.t line 45

t/10dsnlist..........dubious

Test returned status 2 (wstat 512, 0x200)

DIED. FAILED tests 1-9

Failed 9/9 tests, 0.00% okay

t/20createdrop.......install_driver(mysql) failed: Can't load '/export/DBD-mysql-4.003/blib/arch/aut

o/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file /export/DB

D-mysql-4.003/blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_real_escape_string: referenced symbol

not found at /opt/coolstack/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line 230.

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/20createdrop.t line 45

t/20createdrop.......dubious

Test returned status 2 (wstat 512, 0x200)

DIED. FAILED tests 1-6

Failed 6/6 tests, 0.00% okay

t/30insertfetch......install_driver(mysql) failed: Can't load '/export/DBD-mysql-4.003/blib/arch/aut

o/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file /export/DB

D-mysql-4.003/blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_real_escape_string: referenced symbol

not found at /opt/coolstack/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line 230.

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/30insertfetch.t line 48

t/30insertfetch......dubious

Test returned status 2 (wstat 512, 0x200)

DIED. FAILED tests 1-11

Failed 11/11 tests, 0.00% okay

t/35limit............install_driver(mysql) failed: Can't load '/export/DBD-mysql-4.003/blib/arch/aut

o/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file /export/DB

D-mysql-4.003/blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_real_escape_string: referenced symbol

not found at /opt/coolstack/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line 230.

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/35limit.t line 50

t/35limit............dubious

Test returned status 2 (wstat 512, 0x200)

DIED. FAILED tests 1-113

Failed 113/113 tests, 0.00% okay

t/35prepare..........install_driver(mysql) failed: Can't load '/export/DBD-mysql-4.003/blib/arch/aut

o/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file /export/DB

D-mysql-4.003/blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_real_escape_string: referenced symbol

not found at /opt/coolstack/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line 230.

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/35prepare.t line 35

t/35prepare..........dubious

Test returned status 2 (wstat 512, 0x200)

DIED. FAILED tests 1-40

Failed 40/40 tests, 0.00% okay

t/40bindparam........install_driver(mysql) failed: Can't load '/export/DBD-mysql-4.003/blib/arch/aut

o/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file /export/DB

D-mysql-4.003/blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_real_escape_string: referenced symbol

not found at /opt/coolstack/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line 230.

at (eval 5) line 3

Compilation failed in require at (eval 5) line 3.

Perhaps a required shared library or dll isn't installed where expected

at t/40bindparam.t line 57

t/40bindparam........dubious

Test returned status 2 (wstat 512, 0x200)

t/40bindparam2.......install_driver(mysql) failed: Can't load '/export/DBD-mysql-4.003/blib/arch/aut

o/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file /export/DB

D-mysql-4.003/blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_real_escape_string: referenced symbol

not found at /opt/coolstack/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line 230.

at (eval 5) line 3

Compilation failed in require at (eval 5) line 3.

Perhaps a required shared library or dll isn't installed where expected

at t/40bindparam2.t line 64

t/40bindparam2.......dubious

Test returned status 2 (wstat 512, 0x200)

DIED. FAILED tests 1-13

Failed 13/13 tests, 0.00% okay

... I only included a portion of the results but I checked the files and they are in the proper locations. I have installed 02/07 solaris 10 on sparc with cooltools 1.1.

Any ideas why this is going awry?

imana at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...
# 8
Read the error messages carefully - it is using /usr/bin/perl not /opt/coolstack/bin/perl. Check your PATH - it should include /opt/coolstack/bin and /opt/coolstack/mysql_32bit/bin BEFORE /usr/bin.Shanti
shantiSa at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...
# 9
opt/coolstack/bin and /opt/coolstack/mysql_32bit/bin are BEFORE /usr/bin in my profile but once I log in they are prepended with /usr/sbin:/usr/bin:
imana at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...
# 10
Just so everybody knows, it's much easier to setup the 32bit mysql first, then update your perl with DBI, then DBD::mysql rather than setting up the 64bit first and trying it. Hopefully you read this before you go through what I went through to get this to work.
imana at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...
# 11

Dear Iman,

I run in exactly the same problems like you. I followed the instructions of this topic, but get errors for make test:

[root@venus DBD-mysql-4.004]# make test

PERL_DL_NONLAZY=1 /opt/coolstack/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t

t/00base.............ok 1/5install_driver(mysql) failed: Can't load '/opt/install/DBD-mysql-4.004/blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mysql: ld.so.1: perl: fatal: relocation error: file /opt/install/DBD-mysql-4.004/blib/arch/auto/DBD/mysql/mysql.so: symbol mysql_real_escape_string: referenced symbol not found at /opt/coolstack/lib/perl5/5.8.8/sun4-solaris/DynaLoader.pm line 230.

at (eval 6) line 3

Compilation failed in require at (eval 6) 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 2 (wstat 512, 0x200)

DIED. FAILED tests 4-5

Failed 2/5 tests, 60.00% okay

[...]

Could you please let me know how you solved this problem?

Thanks,

a?

aquadrahta at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...
# 12

I don't know if you ever solved this problem, but here is a possible solution:

I noticed that the library are in the wrong order:

mysql_config has sfw and coolstack the wrong way around:

# mysql_config --libs

-L/usr/sfw/lib -L/opt/coolstack/mysql_32bit/lib/mysql -lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm

# perl Makefile.PL

cflags(mysql_config) = -I/opt/coolstack/mysql_32bit/include/mysql -D_REENTRANT -fPIC

embedded(mysql_config) =

libs (mysql_config) = -L/usr/sfw/lib -L/opt/coolstack/mysql_32bit/lib/mysql -lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm

#

So I altered the order and added the test database

#

perl Makefile.PL--libs=" -L/opt/coolstack/mysql_32bit/lib/mysql -L/usr/sfw/lib -lmysqlclient -lz -lposix4 -lgen -lsocket -lnsl -lm" --testdb=test --testuser=test --testhost=localhost

then

# make; make test

All seems to work fine except for 1 error which I think can be ignored.

Let me know

birkbeck01a at 2007-7-9 5:10:24 > top of Java-index,Open Source Technologies,OpenSPARC...