List, I am attempting to install RMySQL on a Kubuntu box. mysql and R were installed using the adept package manager: "apt-get install mysql-server" "apt-get install r-base" I can access mysql via the terminal and I can open R and perform various basic tasks. However, I cannot install the RMySQL package in R. I get the following error: * Installing *source* package 'RMySQL' ... creating 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 checking for mysql_init in -lmysqlclient... no checking for mysql_init in -lmysqlclient... no checking for mysql_init in -lmysqlclient... no checking for mysql_init in -lmysqlclient... no checking for mysql_init in -lmysqlclient... no checking for /usr/local/include/mysql/mysql.h... no checking for /usr/include/mysql/mysql.h... no checking for /usr/local/mysql/include/mysql/mysql.h... no checking for /opt/include/mysql/mysql.h... no checking for /include/mysql/mysql.h... no Configuration error: could not find the MySQL installation include and/or library directories. Manually specify the location of the MySQL libraries and the header files and re-run R CMD INSTALL. INSTRUCTIONS: 1. Define and export the 2 shell variables PKG_CPPFLAGS and PKG_LIBS to include the directory for header files (*.h) and libraries, for example (using Bourne shell syntax): export PKG_CPPFLAGS="-I<MySQL-include-dir>" export PKG_LIBS="-L<MySQL-lib-dir> -lmysqlclient" Re-run the R INSTALL command: R CMD INSTALL RMySQL_<version>.tar.gz 2. Alternatively, you may pass the configure arguments --with-mysql-dir=<base-dir> (distribution directory) or --with-mysql-inc=<base-inc> (where MySQL header files reside) --with-mysql-lib=<base-lib> (where MySQL libraries reside) in the call to R INSTALL --configure-args='...' R CMD INSTALL --configure-args='--with-mysql-dir=DIR' RMySQL_<version>.tar.gz ERROR: configuration failed for package 'RMySQL' ** Removing '/usr/local/lib/R/site-library/RMySQL' ** Restoring previous '/usr/local/lib/R/site-library/RMySQL' The downloaded packages are in /tmp/RtmpDS6tND/downloaded_packages Warning message: installation of package 'RMySQL' had non-zero exit status in: install.packages(" RMySQL") I cannot find mysql.h or mysql.so anywhere. It was apparently installed in /etc/mysql (that's where my.cnf is located, anyway) but I cannot figure out where these headers and libraries are supposed to be. Any help would be greatly appreciated. This is time critical! Never had any problems with R on redhat, but we have moved over to Kubuntu for some reason, and now of course issues come up when we need to use R to analyze data stored in the mysql database! Thanks in advance, Pete --------------------------------- [[alternative HTML version deleted]]
On 4 April 2006 at 19:04, Pete Cap wrote: | I am attempting to install RMySQL on a Kubuntu box. Try this: $ sudo apt-get install r-cran-rmysql According to 'apt-cache policy r-cran-rmysql' on my Kubuntu box, breezy has 0.5.5-2.1. Debian itself now has 0.5.7-1 in testing and unstable. | However, I cannot install the RMySQL package in R. I get the following | error: [...] | I cannot find mysql.h or mysql.so anywhere. You need the matching -dev package for the library. Typically, any libfoo will provide the shared library to _run_ apps, but libfoo-dev is needed to _compile and link_ those apps. We encode this via the so-called Build-Depends: in debian/control. Here, you get (indented for easier reading) Build-Depends: debhelper (>>4.1.0), cdbs, r-base-dev (>= 2.0.0), libmysqlclient15-dev, r-cran-dbi (>= 0.1.8) Apt can actually autobuild the package for you too if you add source entries to /etc/apt/sources. That's for another day... | Any help would be greatly appreciated. This is time critical! Feel free pay back your gratitude with a donation to the R Foundation, or to SPI (Debian's umbrella organization) ;-) Hope this helps, Dirk -- Hell, there are no rules here - we're trying to accomplish something. -- Thomas A. Edison