[R-sig-DB] using RMySQL with both 64-bit and 32-bit R on OSX
Craig Schmidt
cr@|g @end|ng |rom cr@|g@chm|dt@com
Thu Oct 15 20:33:07 CEST 2009
Hi There,
I'm trying to install RMySQL on OSX 10.5.8 with both the 64-bit and 32-
bit version of R.
I had the same problem that was mentioned in this unanswered post:
https://stat.ethz.ch/pipermail/r-sig-db/2009q1/000585.html
I've actually managed to get the 64-bit version working. I did the
following.
1. installed the 64-bit version of MySQL so I have a setup like this:
[cschmidt:/usr/local]$ ls -l
[...]
lrwxr-xr-x 1 root wheel 27 Oct 15 11:22 mysql ->
mysql-5.1.39-osx10.5-x86_64
drwxr-xr-x 17 root wheel 578 Apr 1 2009 mysql-5.1.34-
osx10.5-x86
drwxr-xr-x 17 root wheel 578 Sep 4 15:18 mysql-5.1.39-
osx10.5-x86_64
That is, the 64-bit version is in /usr/local/mysql, and the older 32
bit version is in /usr/local/mysql-5.1.34-osx10.5-x86
2. Downloaded the source of RMySQL_0.7-4.tar.gz from CRAN.
3. Typed the following
export PKG_CPPFLAGS="-I/usr/local/mysql/include"
export PKG_LIBS="-L/usr/local/mysql/lib -lmysqlclient"
R64 --arch x86_64 CMD INSTALL RMySQL_0.7-4.tar.gz
This gives my a good version of RMySQL for R64.
My question is if it is possible to also simultaneously use the 32-bit
version of R.
Following the suggestions from here http://www.matthewckeller.com/html/64_bit_r_on_mac.html
I tried to do this:
export PKG_CPPFLAGS="-I/usr/local/mysql-5.1.34-osx10.5-x86/include"
export PKG_LIBS="-L/usr/local/mysql-5.1.34-osx10.5-x86/lib -
lmysqlclient"
R --arch i386 CMD INSTALL --libs-only RMySQL_0.7-4.tar.gz
This seems to almost work. However, it is still trying to load the 64-
bit version of libmysqlclient.16.dylib
from /usr/local/mysql, rather than the 32-bit version in /usr/local/
mysql-5.1.34-osx10.5-x86. I get this error message:
> library(RMySQL)
Loading required package: DBI
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared library '/Library/Frameworks/R.framework/
Resources/library/RMySQL/libs/i386/RMySQL.so':
dlopen(/Library/Frameworks/R.framework/Resources/library/RMySQL/
libs/i386/RMySQL.so, 6): Library not loaded: /usr/local/mysql/lib/
libmysqlclient.16.dylib
Referenced from: /Library/Frameworks/R.framework/Resources/library/
RMySQL/libs/i386/RMySQL.so
Reason: no suitable image found. Did find:
/usr/local/mysql/lib/libmysqlclient.16.dylib: mach-o, but wrong
architecture
Error : .onLoad failed in 'loadNamespace' for 'RMySQL'
Error: package/namespace load failed for 'RMySQL'
Is this a bug in the makefile? How do I tell it to look in the
correct directory? Anyone have suggestions on how to fix it?
Thanks,
Craig Schmidt
[[alternative HTML version deleted]]
More information about the R-sig-DB
mailing list