LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   RMySQL: installing problems (https://www.linuxquestions.org/questions/suse-opensuse-60/rmysql-installing-problems-468344/)

PB0711 07-27-2006 04:46 PM

RMySQL: installing problems
 
Hi, Don't know if this is the right place but...

So I am trying to install RMysql, it's an R package to talk to MySQL. Well, when I try to install it from the source ie
Code:

R CMD INSTALL RMySQL.tar.gz
I get an error telling me that mysql cannot be found and that I should set the flags but I'm a little confused on exactly how to do it.

here is a link to my question submitted to the R forum.
http://www.nabble.com/RMySQL-Suse-10...-t1902434.html

jschiwal 07-29-2006 01:30 AM

Could you explain what an R package is? Is is the statistical analysis package or does it have something to do with ISDN?

I'm not familiar with the "R CMD INSTALL" command, but it might be looking for the mysql socket rather than the mysql command itself. Or it might be examining the /etc/my.cnf file.

Most likely, the R CMD INSTALL command untars the tarball, runs the configure program and then make && make install.
If that is the case, use the:
--with-mysql-dir=MYSQL_DIR specifies an existing MySQL base dir
--with-mysql-inc=MYSQL_INC specifies an existing MySQL include dir
--with-mysql-lib=MYSQL_LIB specifies an existing MySQL lib dir
options.

From the configure.in file:
Code:

dnl 2. We check for mysql.h and -lmysqlclient in system directories, and if
dnl    found, we use these (provide the user does not explicitly request
dnl    another version, see below).  Notice that the MySQL source distribution
dnl    installs by default to /usr/local/lib/mysql and /usr/local/include/mysql
dnl
dnl 3. Alternatively, if the user specifies explicitly a particular MySQL
dnl    installation we use that version. This can be requested through
dnl        --with-mysql-dir=DIR
dnl        --with-mysql-inc=<include-DIR>
dnl    or  --with-mysql-lib=<library-DIR>
dnl
dnl    (these are equivent to setting and exporting MYSQL_{DIR,INC,LIB})
dnl    In the first case, DIR is assumed to include the lib and include
dnl    subdirectories;  individual locations of these two may be
dnl    specified independently through <include-inc> and <library-dir>,
dnl    respectively.  If we found these, we exit.
dnl
dnl 4. We check for the GNU implementation of getopt_long and set the
dnl    C preprocessor macro HAVE_GETOPT_LONG accordingly.  On windows
dnl    (including MinGW) should be false.
dnl
dnl Global variables: The following variables may be set and exported
dnl prior to running configure:
dnl    PKG_CPPFLAGS, PKG_LIBS, MYSQL_DIR, MYSQL_INC, MYSQL_LIB

You could first enter:
Code:

MYSQL_LIB=/usr/lib/mysql    ( or /usr/lib64/mysql depending on your architecture )
MYSQL_DIR=/usr/bin          ( I think it should be the directory where the mysql* commands are located )
export MYSQL_LIB MYSQL_DIR

And then give your "R CMD INSTALL" command another whirl.

I don't know about MYSQL_INC, That one sounds like it would be from the mysql source.

PB0711 08-03-2006 02:21 PM

So an R package is just like a CPAN package for Perl. I guess I should call it a module/library. R being a statiscial programming language.

I tried the
Quote:

You could first enter:
Code:

MYSQL_LIB=/usr/lib/mysql
MYSQL_DIR=/usr/bin
export MYSQL_LIB MYSQL_DIR
However, I'm still getting the same install problem asking me to define the directory.
I am sorry I didn't get back earlier, I was away from the internet. :cry:

I don't know or see what I am doing wrong. I'm on a x86 and everything is standard so it should all work!?!?!?

PB0711 08-03-2006 02:25 PM

Umm maybe this will help?
Code:

dios:~ # R CMD INSTALL RMySQL_0.5-7.tar.gz
* 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 /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/lib/R/library/RMySQL'


PB0711 07-18-2010 11:18 AM

I love comming back to my old threads and seeing what I did wrong. Well if anyone stumbles across this and doesn't know what to do you probably didn't install the mysql dbi library. In ubuntu/debian this would be:

Code:

sudo apt-get install libdbd-mysql libmysqlclient16-dev
In suse just find the libdbd-mysql package in yum or YaST

ytbaum 12-14-2013 08:29 PM

Update on this-

installing libdbd-mysql and libmysqlclient-dev solved this problem for me.


All times are GMT -5. The time now is 08:33 PM.