Subject: | Compiling note for Perl-DBD-MySQL for RedHat AS 4.0 SP2 on IA64 machine |
Now we were trying to connect MySQL by Perl with Perl-DBD-MySQL and
encountered the compilation failure.
- The environment is:
Perl v5.8.5
DBI-1.40
DBD-mysql-3.0002
MySQL-pro-cert-5.7.17a
RedHat Linux AS 4.0 SP2
HP RX5670, Itanium CPU, IA64 arch
- compilation steps and error messge:
[root@rx5670-1 DBD-mysql-3.0002]# perl Makefile.PL
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/include/mysql -unroll2 -ip -
mp -restrict
embedded (mysql_config) =
libs (mysql_config) = -i-static -L/usr/lib/mysql -
lmysqlclient -lz -lcrypt -lnsl -lm
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testsocket (default ) =
testuser (default ) =
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
Checking if your kit is complete...
Looks good
Unrecognized argument in LIBS ignored: '-i-static'
Using DBI 1.40 (for perl 5.008005 on ia64-linux-thread-multi)
installed in /usr/lib/perl5/vendor_perl/5.8.5/ia64-linux-thread-
multi/auto/DBI
Writing Makefile for DBD::mysql
[root@rx5670-1 DBD-mysql-3.0002]# 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 -c -I/usr/lib/perl5/vendor_perl/5.8.5/ia64-linux-thread-
multi/auto/DBI -I/usr/include/mysql -unroll2 -ip -mp -restrict -g -
D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -
I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -
I/usr/include/gdbm -O2 -g -pipe -DVERSION=\"3.0002\" -
DXS_VERSION=\"3.0002\" -fPIC "-I/usr/lib/perl5/5.8.5/ia64-linux-thread-
multi/CORE" dbdimp.c
gcc: unrecognized option `-restrict'
cc1: error: unrecognized command line option "-ip"
cc1: error: invalid option `p'
make: *** [dbdimp.o] Error 1
- the problem is:
I think the problem encounterd on ia64 platform might come from the
gcc compiling options which have close relationship with MySQL.
According to the Makfile generated by "perl Makefile.PL", I found the
settings of cflags and libs on ia64 are different with that on i386
and x86_64. The default value of these settings comes from
mysql_config which is a MySQL command. It tells us what compiling
options were used for this binary MySQL. However, when I was compiling
DBD-mysql, the gcc was unable to understand these options. Thus the
DBD-mysql would fail to build links to MySQL library file(.so). So the
compiling process reported error and was forced to exit. I have
highlighed in red the unrecognized parts.
--cflags [-I/usr/include/mysql -unroll2 -ip -mp -
restrict]
--include [-I/usr/include/mysql]
--libs [-i-static -L/usr/lib/mysql -lmysqlclient -
lz -lcrypt -lnsl -lm]
--libs_r [-i-static -L/usr/lib/mysql -lmysqlclient_r -
lz -lpthread -lcrypt -lnsl -lm -lpthread]
--socket [/var/lib/mysql/mysql.sock]
--port [3306]
--version [5.0.17a]
--libmysqld-libs [-i-static -L/usr/lib/mysql -lmysqld -lz -
lpthread -lcrypt -lnsl -lm
- the solution is:
cp -f Makefile Makefile.origin
sed "s/\/usr\/lib\/mysql/\/usr\/lib/g" Makefile > Makefile.tmp
mv Makefile.tmp Makefile
sed "s/\-ip//g" Makefile > Makefile.tmp
mv Makefile.tmp Makefile
sed "s/\-mp//g" Makefile > Makefile.tmp
mv Makefile.tmp Makefile
sed "s/\-restrict//g" Makefile > Makefile.tmp
mv Makefile.tmp Makefile
sed "s/\-i\-static//g" Makefile > Makefile.tmp
mv Makefile.tmp Makefile
The complete Makefile and the log file is enclosed in the attachment.
I am not sure if the above issue affects other distro linux.
Subject: | make.log |
Message body not shown because it is not plain text.
Subject: | Makefile |
Message body is not shown because it is too large.