[R-SIG-Mac] RMySQL problem

Parlamis Franklin fparlamis at mac.com
Thu Oct 27 00:59:35 CEST 2005


Hello all.  I am having a problem with packages DBI and RMySQL since  
upgrading to R 2.2.0.   I am running 2.2.0 on a PowerMac G5 dual proc  
2.7GHz, using build 1930 of R.app.

I posted this problem in the database SIG, but was directed here as  
the problem was deemed Mac-specific.  Since I get into RMySQL  
minutiae below, I have also cc-d the package maintainers.

When I install RMySQL and DBI from binaries, I get the following upon  
issuing 'library(RMySQL)' to R:

     Loading required package: DBI
     Warning message:
     RS-DBI driver warning: (MySQL mismatch between compiled version  
4.0.24 and runtime version 4.1.14)

In fact, I have MySQL version 5.0.5 installed on my computer now from  
latest binaries on the MySQL web site.  I used to have 4.1.14  
installed (but never 4.0.24) when I first installed these packages  
under the prior version of R.  Interestingly, both packages worked  
without any issues.

I was told on the database SIG that I needed to re-install RMySQL  
from sources, so I have attempted to do this.  Per the configuration  
instructions in the source package, if MySQL is not installed to  
either '/usr/local/lib/mysql' or '/usr/local/include/mysql', then it  
is necessary to specify to the configuration program where the  
program resides.
In fact it now appears to be the case that the default MySQL  
directory (at least when the 5.0.5 binary is used) is '/usr/local/ 
mysql', the include directory is '/usr/local/mysql/include' and the  
'lib' directory is '/usr/local/mysql/lib'.  So I tried both of the  
following in Terminal 1.5 (Bash):

---

(1) R CMD INSTALL --configure-args='--with-mysql-dir=/usr/local/mysql  
--with-mysql-inc=/usr/local/mysql/include --with-mysql-lib=/usr/local/ 
mysql/lib' ~/Desktop/RMySQL

     which led to:

* Installing *source* package 'RMySQL' ...
loading cache ./config.cache
checking how to run the C preprocessor... cc -E
checking for compress in -lz... yes
checking for getopt_long in -lc... yes
checking for mysql_init in -lmysqlclient... no
checking for mysql.h... no
updating cache ./config.cache
creating ./config.status
creating src/Makevars
** libs
gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/ 
include -I/usr/local/mysql/include -I/usr/local/include   -fno- 
common  -g -O2 -c RS-DBI.c -o RS-DBI.o
gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/ 
include -I/usr/local/mysql/include -I/usr/local/include   -fno- 
common  -g -O2 -c RS-MySQL.c -o RS-MySQL.o
gcc-3.3 -bundle -flat_namespace -undefined suppress -L/usr/local/lib - 
o RMySQL.so RS-DBI.o RS-MySQL.o -L/usr/local/mysql/lib -lmysqlclient - 
lz -lcc_dynamic -F/Library/Frameworks/R.framework/.. -framework R
ld: truncated or malformed archive: /usr/local/mysql/lib/ 
libmysqlclient.a (ranlib structures in table of contents extends past  
the end of the table of contents, can't load from it)
ld: warning multiple definitions of symbol _signgam
/Library/Frameworks/R.framework/../R.framework/R(lgamma.lo)  
definition of _signgam
/usr/lib/libSystem.dylib(gamma9.o) definition of _signgam
make: *** [RMySQL.so] Error 1
ERROR: compilation failed for package 'RMySQL'
** Removing '/Library/Frameworks/R.framework/Versions/2.2/Resources/ 
library/RMySQL'

----

(2)   export PKG_CPPFLAGS="-I/usr/local/mysql/include"
         export PKG_LIBS="-L/usr/local/mysql/lib -lmysqlclient"
         R CMD INSTALL ~/Desktop/RMySQL* Installing *source* package  
'RMySQL' ...

     which led to:

* Installing *source* package 'RMySQL' ...
loading cache ./config.cache
checking how to run the C preprocessor... (cached) cc -E
checking for compress in -lz... (cached) yes
checking for getopt_long in -lc... (cached) yes
checking for mysql_init in -lmysqlclient... (cached) no
checking for mysql.h... (cached) no
creating ./config.status
creating src/Makevars
** libs
gcc-3.3 -bundle -flat_namespace -undefined suppress -L/usr/local/lib - 
o RMySQL.so RS-DBI.o RS-MySQL.o -L/usr/local/mysql/lib -lmysqlclient - 
lz -lcc_dynamic -F/Library/Frameworks/R.framework/.. -framework R
ld: truncated or malformed archive: /usr/local/mysql/lib/ 
libmysqlclient.a (ranlib structures in table of contents extends past  
the end of the table of contents, can't load from it)
ld: warning multiple definitions of symbol _signgam
/Library/Frameworks/R.framework/../R.framework/R(lgamma.lo)  
definition of _signgam
/usr/lib/libSystem.dylib(gamma9.o) definition of _signgam
make: *** [RMySQL.so] Error 1
ERROR: compilation failed for package 'RMySQL'
** Removing '/Library/Frameworks/R.framework/Versions/2.2/Resources/ 
library/RMySQL'

---

The file '/usr/local/mysql/include/mysql.h' does exist on my system,  
so I am somewhat baffled by the "no" response in the configuration  
scripts check for that file.  However, I do not have a file called  
mysql_init, nor one called mysqlclient.  There is, however, a  
libmysqlclient.a in /usr/local/mysql/lib.

Help, please.  I am now out of the manual and beyond my  
understanding.  Thanks in advance.

Franklin Parlamis



More information about the R-SIG-Mac mailing list