[RESOLVED] DBD::mysql unresolved symbol _intel_fast_memcpy & mysql-standard-5.0.22-linux-i686-ic
am 30.08.2006 00:33:17 von beagle197Folks,
Some of you may have wanted to build and install the DBD::mysql
(DBD-mysql-3.0006) and use it with MySQL's v 5 DB server for Linux (non
RPM, Intel C/C++ compiled, glibc-2.3) downloads*, which is according to
Mysql**, "...the MySQL Community Server compiled with the Intel CC
compiler. Internal tests show that editions of the MySQL Community
Server compiled with the Intel CC compiler exhibit faster performance
on Intel hardware than those compiled with the standard gcc
compiler...."
However, there is one small dreaded show stopping error*** that is
reported when trying to run a perl script that uses the module (aka the
intel_fast_memcpy unresolved symbol), and here I post the specific
steps to resolve this. If you've searched around the web trying to find
the solution, you may have found misleading articles saying that you
needed to go out and buy the Intel=AE C++ Compiler 9.1 for Linux, which
is just not true because you can build it with gcc. The reason is that
the good folks at mysql provided a link for downloading the necessary
Intel libraries from their website**** (e.g. in my case these was
intel-icc9-libs-9.0-x86_64.tar.gz).
Also you may have felt that you needed to go out and buy MySQL
Enterprise support, which is not needed either in this case. Note these
steps were performed on an Intel dual Xeon server, Debian GNU/Linux
Sarge (3.1) OS. The trick here is to link the libraries in a very
special order, because this will make all the difference.
HTH,
BEA
* At time of writing the version I have is
mysql-standard-5.0.22-linux-i686-icc-glibc23
** See http://dev.mysql.com/downloads/mysql/5.0.html
*** "/usr/bin/perl: relocation error:
/usr/local/lib/perl/5.8.4/auto/DBD/mysql/mysql.so: undefined symbol:
_intel_fast_memcpy"
**** http://dev.mysql.com/downloads/os-linux.html
frag:~# dpkg -l | grep gcc
ii gcc 3.3.5-3 The GNU C compiler
ii gcc-3.3 3.3.5-13 The GNU C compiler
ii gcc-3.3-base 3.3.5-13 The GNU Compiler Collection (base
package)
ii gcc-3.3-doc 3.3.5-13 Documentation for the GNU compilers
(gcc, go
ii gcc-doc 3.3.5-3 Documentation for the GNU C compilers
(gcc,
ii libgcc1 3.4.3-13 GCC support library
frag:~# cc --version
cc (GCC) 3.3.5 (Debian 1:3.3.5-13)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
frag:~/.cpan/build/DBD-mysql-3.0006# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/ usr/local/bin
frag:~/.cpan/build/DBD-mysql-3.0006# perl Makefile.PL
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 76.
Cannot find the file 'mysql_config'! Your execution PATH doesn't seem
to contain the path to mysql_config. Resorting to guessed values!
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
Can't exec "mysql_config": No such file or directory at Makefile.PL
line 450.
I will use the following settings for compiling and testing:
cflags (guessed) =3D -I/usr/local/mysql/include
embedded (guessed) =3D
libs (guessed) =3D -L/usr/local/mysql/lib -lmysqlclient -lz
-lm -lcrypt -lnsl
mysql_config (guessed) =3D mysql_config
nocatchstderr (default) =3D 0
nofoundrows (default) =3D 0
ssl (guessed) =3D 0
testdb (default) =3D test
testhost (default) =3D
testpassword (default) =3D
testsocket (default) =3D
testuser (default) =3D
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Checking if your kit is complete...
Looks good
Using DBI 1.52 (for perl 5.008004 on i386-linux-thread-multi) installed
in /usr/local/lib/perl/5.8.4/auto/DBI/
Writing Makefile for DBD::mysql
frag:~/.cpan/build/DBD-mysql-3.0006# ls
/usr/local/mysql/bin/mysql_config
/usr/local/mysql/bin/mysql_config
frag:~/.cpan/build/DBD-mysql-3.0006# export
PATH=3D/usr/local/mysql/bin:$PATH
frag:~/.cpan/build/DBD-mysql-3.0006# perl Makefile.PL
I will use the following settings for compiling and testing:
cflags (mysql_config) =3D -I/usr/local/mysql/include -unroll2
-ip -mp -restrict
embedded (mysql_config) =3D
libs (mysql_config) =3D -static-libcxa -i-static
-L/usr/local/mysql/lib -lmysqlclient -lz -lcrypt -lnsl -lm
mysql_config (guessed ) =3D mysql_config
nocatchstderr (default ) =3D 0
nofoundrows (default ) =3D 0
ssl (guessed ) =3D 0
testdb (default ) =3D test
testhost (default ) =3D
testpassword (default ) =3D
testsocket (default ) =3D
testuser (default ) =3D
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Unrecognized argument in LIBS ignored: '-static-libcxa'
Unrecognized argument in LIBS ignored: '-i-static'
Using DBI 1.52 (for perl 5.008004 on i386-linux-thread-multi) installed
in /usr/local/lib/perl/5.8.4/auto/DBI/
Writing Makefile for DBD::mysql
frag:~/.cpan/build/DBD-mysql-3.0006# perl Makefile.PL
--cflags=3D'-I/usr/local/mysql/include' --libs=3D'-L/usr/local/mysql/lib
-lmysqlclient -lz -lcrypt -lnsl -lm'
I will use the following settings for compiling and testing:
cflags (User's choice) =3D -I/usr/local/mysql/include
embedded (mysql_config ) =3D
libs (User's choice) =3D -L/usr/local/mysql/lib -lmysqlclient
-lz -lcrypt -lnsl -lm
mysql_config (guessed ) =3D mysql_config
nocatchstderr (default ) =3D 0
nofoundrows (default ) =3D 0
ssl (guessed ) =3D 0
testdb (default ) =3D test
testhost (default ) =3D
testpassword (default ) =3D
testsocket (default ) =3D
testuser (default ) =3D
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Using DBI 1.52 (for perl 5.008004 on i386-linux-thread-multi) installed
in /usr/local/lib/perl/5.8.4/auto/DBI/
Writing Makefile for DBD::mysql
frag:~/.cpan/build/DBD-mysql-3.0006# 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
cc -c -I/usr/local/lib/perl/5.8.4/auto/DBI -I/usr/local/mysql/include
-DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -O2 -DVERSION=3D\"3.0006\"
-DXS_VERSION=3D\"3.0006\" -fPIC "-I/usr/lib/perl/5.8/CORE" dbdimp.c
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g"
/usr/local/lib/perl/5.8.4/auto/DBI/Driver.xst > mysql.xsi
/usr/bin/perl /usr/share/perl/5.8/ExtUtils/xsubpp -typemap
/usr/share/perl/5.8/ExtUtils/typemap mysql.xs > mysql.xsc && mv
mysql.xsc mysql.c
Warning: duplicate function definition 'do' detected in mysql.xs, line
224
Warning: duplicate function definition 'rows' detected in mysql.xs,
line 567
cc -c -I/usr/local/lib/perl/5.8.4/auto/DBI -I/usr/local/mysql/include
-DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -O2 -DVERSION=3D\"3.0006\"
-DXS_VERSION=3D\"3.0006\" -fPIC "-I/usr/lib/perl/5.8/CORE" mysql.c
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH=3D"" /usr/bin/perl myld cc -shared -L/usr/local/lib dbdimp.o
mysql.o -o blib/arch/auto/DBD/mysql/mysql.so -L/usr/local/mysql/lib
-lmysqlclient -lz -lcrypt -lnsl -lm
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.3pm
Manifying blib/man3/DBD::mysql::INSTALL.3pm
Manifying blib/man3/Mysql.3pm
Manifying blib/man3/Bundle::DBD::mysql.3pm
frag:~/.cpan/build/DBD-mysql-3.0006# make install
Installing /usr/local/lib/perl/5.8.4/auto/DBD/mysql/mysql.so
Files found in blib/arch: installing files in blib/lib into
architecture dependent library tree
Writing /usr/local/lib/perl/5.8.4/auto/DBD/mysql/.packlist
Appending installation info to /usr/local/lib/perl/5.8.4/perllocal.pod
frag:~/.cpan/build/DBD-mysql-3.0006# cat ~/test_db.pl
#!/usr/bin/perl
use DBI();
my ($dbh, $sth, $ref, $query);
$dbh =3D
DBI->connect("DBI:mysql:database=3Dtest;host=3Dlocalhost;mys ql_socket=3D/va=
r/run/mysqld/mysqld.sock",
"bea", "bea");
$dbh->disconnect();
frag:~/.cpan/build/DBD-mysql-3.0006# ~/test_db.pl
/usr/bin/perl: relocation error:
/usr/local/lib/perl/5.8.4/auto/DBD/mysql/mysql.so: undefined symbol:
_intel_fast_memcpy
frag:~/.cpan/build/DBD-mysql-3.0006# cd
frag:~# curl
http://mysql.osuosl.org/Downloads/Linux/intel-icc9-libs-9.0- x86_64.tar.gz
-o intel-icc9-libs-9.0-x86_64.tar.gz
frag:/usr/local/lib# tar xzvf ~/intel-icc9-libs-9.0-i386.tar.gz
intel-icc9-libs-9.0-i386/
intel-icc9-libs-9.0-i386/crtxi.o
intel-icc9-libs-9.0-i386/crtxn.o
intel-icc9-libs-9.0-i386/icrt.internal.map
intel-icc9-libs-9.0-i386/icrt.link
intel-icc9-libs-9.0-i386/libcprts.a
intel-icc9-libs-9.0-i386/libcprts.so
intel-icc9-libs-9.0-i386/libcprts.so.5
intel-icc9-libs-9.0-i386/libcxa.a
intel-icc9-libs-9.0-i386/libcxa.so
intel-icc9-libs-9.0-i386/libcxa.so.5
intel-icc9-libs-9.0-i386/libcxaguard.a
intel-icc9-libs-9.0-i386/libcxaguard.so
intel-icc9-libs-9.0-i386/libcxaguard.so.5
intel-icc9-libs-9.0-i386/libguide.a
intel-icc9-libs-9.0-i386/libguide.so
intel-icc9-libs-9.0-i386/libguide_stats.a
intel-icc9-libs-9.0-i386/libguide_stats.so
intel-icc9-libs-9.0-i386/libimf.a
intel-icc9-libs-9.0-i386/libimf.so
intel-icc9-libs-9.0-i386/libirc.a
intel-icc9-libs-9.0-i386/libirc_pic.a
intel-icc9-libs-9.0-i386/libirc_s.a
intel-icc9-libs-9.0-i386/libirc_s_pic.a
intel-icc9-libs-9.0-i386/libompstub.a
intel-icc9-libs-9.0-i386/libsvml.a
intel-icc9-libs-9.0-i386/libsvml.so
intel-icc9-libs-9.0-i386/libunwind.a
intel-icc9-libs-9.0-i386/libunwind.so
intel-icc9-libs-9.0-i386/libunwind.so.5
intel-icc9-libs-9.0-i386/clicense
intel-icc9-libs-9.0-i386/credist.txt
intel-icc9-libs-9.0-i386/list
frag:/usr/local/lib# ln -s intel-icc9-libs-9.0-i386 icc
frag:/usr/local/lib# ls
icc intel-icc9-libs-9.0-i386 perl
frag:/usr/local/lib# cd ~/.cpan/build/DBD-mysql-3.0006/
frag:~/.cpan/build/DBD-mysql-3.0006# perl Makefile.PL
--cflags=3D'-I/usr/local/mysql/include' --libs=3D'-L/usr/local/mysql/lib
-lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/local/lib/icc -lirc'
I will use the following settings for compiling and testing:
cflags (User's choice) =3D -I/usr/local/mysql/include
embedded (mysql_config ) =3D
libs (User's choice) =3D -L/usr/local/mysql/lib -lmysqlclient
-lz -lcrypt -lnsl -lm -L/usr/local/lib/icc -lirc
mysql_config (guessed ) =3D mysql_config
nocatchstderr (default ) =3D 0
nofoundrows (default ) =3D 0
ssl (guessed ) =3D 0
testdb (default ) =3D test
testhost (default ) =3D
testpassword (default ) =3D
testsocket (default ) =3D
testuser (default ) =3D
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Using DBI 1.52 (for perl 5.008004 on i386-linux-thread-multi) installed
in /usr/local/lib/perl/5.8.4/auto/DBI/
Writing Makefile for DBD::mysql
frag:~/.cpan/build/DBD-mysql-3.0006# make
cc -c -I/usr/local/lib/perl/5.8.4/auto/DBI -I/usr/local/mysql/include
-DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -O2 -DVERSION=3D\"3.0006\"
-DXS_VERSION=3D\"3.0006\" -fPIC "-I/usr/lib/perl/5.8/CORE" dbdimp.c
cc -c -I/usr/local/lib/perl/5.8.4/auto/DBI -I/usr/local/mysql/include
-DDBD_MYSQL_INSERT_ID_IS_GOOD -g -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=3D64 -O2 -DVERSION=3D\"3.0006\"
-DXS_VERSION=3D\"3.0006\" -fPIC "-I/usr/lib/perl/5.8/CORE" mysql.c
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH=3D"" /usr/bin/perl myld cc -shared -L/usr/local/lib dbdimp.o
mysql.o -o blib/arch/auto/DBD/mysql/mysql.so -L/usr/local/mysql/lib
-lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/local/lib/icc -lirc
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.3pm
Manifying blib/man3/DBD::mysql::INSTALL.3pm
Manifying blib/man3/Mysql.3pm
Manifying blib/man3/Bundle::DBD::mysql.3pm
frag:~/.cpan/build/DBD-mysql-3.0006# make install
Installing /usr/local/lib/perl/5.8.4/auto/DBD/mysql/mysql.so
Files found in blib/arch: installing files in blib/lib into
architecture dependent library tree
Writing /usr/local/lib/perl/5.8.4/auto/DBD/mysql/.packlist
Appending installation info to /usr/local/lib/perl/5.8.4/perllocal.pod
frag:~/.cpan/build/DBD-mysql-3.0006# ~/test_db.pl
frag:~/.cpan/build/DBD-mysql-3.0006#