Hi, I have some problem to install RMySQL package. Could you help me? I set up the path. [root at ep2 library]# export PKG_CPPFLAGS="-I/var/lib/mysql" [root at ep2 library]# export PKG_LIBS="-L/var/lib/mysql - lmysqlclient" [root at ep2 library]# R CMD INSTALL /home/younko/RMySQL_0.5- 5.tar.gz I got this bunch of error message. Please help me. * 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 updating cache ./config.cache creating ./config.status creating src/Makevars ** libs gcc -I/usr/local/lib/R/include -I/var/lib/mysql - I/usr/local/include -fPIC -g -O2 -c RS-DBI.c -o RS-DBI.o gcc -I/usr/local/lib/R/include -I/var/lib/mysql - I/usr/local/include -fPIC -g -O2 -c RS-MySQL.c -o RS- MySQL.o In file included from RS-MySQL.c:22: RS-MySQL.h:40:19: mysql.h: No such file or directory RS-MySQL.h:41:27: mysql_version.h: No such file or directory RS-MySQL.h:42:23: mysql_com.h: No such file or directory In file included from RS-MySQL.c:22: RS-MySQL.h:109: `FIELD_TYPE_DECIMAL' undeclared here (not in a function) RS-MySQL.h:109: initializer element is not constant RS-MySQL.h:109: (near initialization for `RS_MySQL_dataTypes [0].typeId') RS-MySQL.h:109: initializer element is not constant RS-MySQL.h:109: (near initialization for `RS_MySQL_dataTypes [0]') RS-MySQL.h:110: `FIELD_TYPE_TINY' undeclared here (not in a function) RS-MySQL.h:110: initializer element is not constant RS-MySQL.h:110: (near initialization for `RS_MySQL_dataTypes [1].typeId') RS-MySQL.h:110: initializer element is not constant RS-MySQL.h:110: (near initialization for `RS_MySQL_dataTypes [1]') RS-MySQL.h:111: `FIELD_TYPE_SHORT' undeclared here (not in a function) RS-MySQL.h:111: initializer element is not constant RS-MySQL.h:111: (near initialization for `RS_MySQL_dataTypes [2].typeId') RS-MySQL.h:111: initializer element is not constant RS-MySQL.h:111: (near initialization for `RS_MySQL_dataTypes [2]') RS-MySQL.h:112: `FIELD_TYPE_LONG' undeclared here (not in a function) RS-MySQL.h:112: initializer element is not constant RS-MySQL.h:112: (near initialization for `RS_MySQL_dataTypes [3].typeId') RS-MySQL.h:112: initializer element is not constant RS-MySQL.h:112: (near initialization for `RS_MySQL_dataTypes [3]') RS-MySQL.h:113: `FIELD_TYPE_FLOAT' undeclared here (not in a function) RS-MySQL.h:113: initializer element is not constant RS-MySQL.h:113: (near initialization for `RS_MySQL_dataTypes [4].typeId') RS-MySQL.h:113: initializer element is not constant RS-MySQL.h:113: (near initialization for `RS_MySQL_dataTypes [4]') RS-MySQL.h:114: `FIELD_TYPE_DOUBLE' undeclared here (not in a function) RS-MySQL.h:114: initializer element is not constant RS-MySQL.h:114: (near initialization for `RS_MySQL_dataTypes [5].typeId') RS-MySQL.h:114: initializer element is not constant RS-MySQL.h:114: (near initialization for `RS_MySQL_dataTypes [5]') RS-MySQL.h:115: `FIELD_TYPE_NULL' undeclared here (not in a function) RS-MySQL.h:115: initializer element is not constant RS-MySQL.h:115: (near initialization for `RS_MySQL_dataTypes [6].typeId') RS-MySQL.h:115: initializer element is not constant RS-MySQL.h:115: (near initialization for `RS_MySQL_dataTypes [6]') RS-MySQL.h:116: `FIELD_TYPE_TIMESTAMP' undeclared here (not in a function) RS-MySQL.h:116: initializer element is not constant RS-MySQL.h:116: (near initialization for `RS_MySQL_dataTypes [7].typeId') RS-MySQL.h:116: initializer element is not constant RS-MySQL.h:116: (near initialization for `RS_MySQL_dataTypes [7]') RS-MySQL.h:117: `FIELD_TYPE_LONGLONG' undeclared here (not in a function) RS-MySQL.h:117: initializer element is not constant RS-MySQL.h:117: (near initialization for `RS_MySQL_dataTypes [8].typeId') RS-MySQL.h:117: initializer element is not constant RS-MySQL.h:117: (near initialization for `RS_MySQL_dataTypes [8]') RS-MySQL.h:118: `FIELD_TYPE_INT24' undeclared here (not in a function) RS-MySQL.h:118: initializer element is not constant RS-MySQL.h:118: (near initialization for `RS_MySQL_dataTypes [9].typeId') RS-MySQL.h:118: initializer element is not constant RS-MySQL.h:118: (near initialization for `RS_MySQL_dataTypes [9]') RS-MySQL.h:119: `FIELD_TYPE_DATE' undeclared here (not in a function) RS-MySQL.h:119: initializer element is not constant RS-MySQL.h:119: (near initialization for `RS_MySQL_dataTypes [10].typeId') RS-MySQL.h:119: initializer element is not constant RS-MySQL.h:119: (near initialization for `RS_MySQL_dataTypes [10]') RS-MySQL.h:120: `FIELD_TYPE_TIME' undeclared here (not in a function) RS-MySQL.h:120: initializer element is not constant RS-MySQL.h:120: (near initialization for `RS_MySQL_dataTypes [11].typeId') RS-MySQL.h:120: initializer element is not constant RS-MySQL.h:120: (near initialization for `RS_MySQL_dataTypes [11]') RS-MySQL.h:121: `FIELD_TYPE_DATETIME' undeclared here (not in a function) RS-MySQL.h:121: initializer element is not constant RS-MySQL.h:121: (near initialization for `RS_MySQL_dataTypes [12].typeId') RS-MySQL.h:121: initializer element is not constant RS-MySQL.h:121: (near initialization for `RS_MySQL_dataTypes [12]') RS-MySQL.h:122: `FIELD_TYPE_YEAR' undeclared here (not in a function) RS-MySQL.h:122: initializer element is not constant RS-MySQL.h:122: (near initialization for `RS_MySQL_dataTypes [13].typeId') RS-MySQL.h:122: initializer element is not constant RS-MySQL.h:122: (near initialization for `RS_MySQL_dataTypes [13]') RS-MySQL.h:123: `FIELD_TYPE_NEWDATE' undeclared here (not in a function) RS-MySQL.h:123: initializer element is not constant RS-MySQL.h:123: (near initialization for `RS_MySQL_dataTypes [14].typeId') RS-MySQL.h:123: initializer element is not constant RS-MySQL.h:123: (near initialization for `RS_MySQL_dataTypes [14]') RS-MySQL.h:124: `FIELD_TYPE_ENUM' undeclared here (not in a function) RS-MySQL.h:124: initializer element is not constant RS-MySQL.h:124: (near initialization for `RS_MySQL_dataTypes [15].typeId') RS-MySQL.h:124: initializer element is not constant RS-MySQL.h:124: (near initialization for `RS_MySQL_dataTypes [15]') RS-MySQL.h:125: `FIELD_TYPE_SET' undeclared here (not in a function) RS-MySQL.h:125: initializer element is not constant RS-MySQL.h:125: (near initialization for `RS_MySQL_dataTypes [16].typeId') RS-MySQL.h:125: initializer element is not constant RS-MySQL.h:125: (near initialization for `RS_MySQL_dataTypes [16]') RS-MySQL.h:126: `FIELD_TYPE_TINY_BLOB' undeclared here (not in a function) RS-MySQL.h:126: initializer element is not constant RS-MySQL.h:126: (near initialization for `RS_MySQL_dataTypes [17].typeId') RS-MySQL.h:126: initializer element is not constant RS-MySQL.h:126: (near initialization for `RS_MySQL_dataTypes [17]') RS-MySQL.h:127: `FIELD_TYPE_MEDIUM_BLOB' undeclared here (not in a function) RS-MySQL.h:127: initializer element is not constant RS-MySQL.h:127: (near initialization for `RS_MySQL_dataTypes [18].typeId') RS-MySQL.h:127: initializer element is not constant RS-MySQL.h:127: (near initialization for `RS_MySQL_dataTypes [18]') RS-MySQL.h:128: `FIELD_TYPE_LONG_BLOB' undeclared here (not in a function) RS-MySQL.h:128: initializer element is not constant RS-MySQL.h:128: (near initialization for `RS_MySQL_dataTypes [19].typeId') RS-MySQL.h:128: initializer element is not constant RS-MySQL.h:128: (near initialization for `RS_MySQL_dataTypes [19]') RS-MySQL.h:129: `FIELD_TYPE_BLOB' undeclared here (not in a function) RS-MySQL.h:129: initializer element is not constant RS-MySQL.h:129: (near initialization for `RS_MySQL_dataTypes [20].typeId') RS-MySQL.h:129: initializer element is not constant RS-MySQL.h:129: (near initialization for `RS_MySQL_dataTypes [20]') RS-MySQL.h:130: `FIELD_TYPE_VAR_STRING' undeclared here (not in a function) RS-MySQL.h:130: initializer element is not constant RS-MySQL.h:130: (near initialization for `RS_MySQL_dataTypes [21].typeId') RS-MySQL.h:130: initializer element is not constant RS-MySQL.h:130: (near initialization for `RS_MySQL_dataTypes [21]') RS-MySQL.h:131: `FIELD_TYPE_STRING' undeclared here (not in a function) RS-MySQL.h:131: initializer element is not constant RS-MySQL.h:131: (near initialization for `RS_MySQL_dataTypes [22].typeId') RS-MySQL.h:131: initializer element is not constant RS-MySQL.h:131: (near initialization for `RS_MySQL_dataTypes [22]') RS-MySQL.h:132: initializer element is not constant RS-MySQL.h:132: (near initialization for `RS_MySQL_dataTypes [23]') RS-MySQL.c:25: `MYSQL_SERVER_VERSION' undeclared here (not in a function) RS-MySQL.c: In function `RS_MySQL_init': RS-MySQL.c:73: warning: initialization makes pointer from integer without a cast RS-MySQL.c: In function `RS_MySQL_newConnection': RS-MySQL.c:189: `MYSQL' undeclared (first use in this function) RS-MySQL.c:189: (Each undeclared identifier is reported only once RS-MySQL.c:189: for each function it appears in.) RS-MySQL.c:189: `my_connection' undeclared (first use in this function) RS-MySQL.c:238: `MYSQL_READ_DEFAULT_GROUP' undeclared (first use in this function) RS-MySQL.c: In function `RS_MySQL_closeConnection': RS-MySQL.c:370: `MYSQL' undeclared (first use in this function) RS-MySQL.c:370: `my_connection' undeclared (first use in this function) RS-MySQL.c:386: parse error before ')' token RS-MySQL.c: In function `RS_MySQL_exec': RS-MySQL.c:411: `MYSQL' undeclared (first use in this function) RS-MySQL.c:411: `my_connection' undeclared (first use in this function) RS-MySQL.c:412: `MYSQL_RES' undeclared (first use in this function) RS-MySQL.c:412: `my_result' undeclared (first use in this function) RS-MySQL.c:418: parse error before ')' token RS-MySQL.c:457: parse error before ')' token RS-MySQL.c: In function `RS_MySQL_createDataMappings': RS-MySQL.c:496: `MYSQL_RES' undeclared (first use in this function) RS-MySQL.c:496: `my_result' undeclared (first use in this function) RS-MySQL.c:497: `MYSQL_FIELD' undeclared (first use in this function) RS-MySQL.c:497: `select_dp' undeclared (first use in this function) RS-MySQL.c:505: parse error before ')' token RS-MySQL.c:511: `MYSQL' undeclared (first use in this function) RS-MySQL.c:511: parse error before ')' token RS-MySQL.c:546: `FIELD_TYPE_VAR_STRING' undeclared (first use in this function) RS-MySQL.c:547: `FIELD_TYPE_STRING' undeclared (first use in this function) RS-MySQL.c:551: `FIELD_TYPE_TINY' undeclared (first use in this function) RS-MySQL.c:552: `FIELD_TYPE_SHORT' undeclared (first use in this function) RS-MySQL.c:553: `FIELD_TYPE_INT24' undeclared (first use in this function) RS-MySQL.c:554: `FIELD_TYPE_LONG' undeclared (first use in this function) RS-MySQL.c:556: `UNSIGNED_FLAG' undeclared (first use in this function) RS-MySQL.c:561: `FIELD_TYPE_LONGLONG' undeclared (first use in this function) RS-MySQL.c:566: `FIELD_TYPE_DECIMAL' undeclared (first use in this function) RS-MySQL.c:572: `FIELD_TYPE_FLOAT' undeclared (first use in this function) RS-MySQL.c:573: `FIELD_TYPE_DOUBLE' undeclared (first use in this function) RS-MySQL.c:576: `FIELD_TYPE_BLOB' undeclared (first use in this function) RS-MySQL.c:577: `FIELD_TYPE_TINY_BLOB' undeclared (first use in this function) RS-MySQL.c:578: `FIELD_TYPE_MEDIUM_BLOB' undeclared (first use in this function) RS-MySQL.c:579: `FIELD_TYPE_LONG_BLOB' undeclared (first use in this function) RS-MySQL.c:583: `FIELD_TYPE_DATE' undeclared (first use in this function) RS-MySQL.c:584: `FIELD_TYPE_TIME' undeclared (first use in this function) RS-MySQL.c:585: `FIELD_TYPE_DATETIME' undeclared (first use in this function) RS-MySQL.c:586: `FIELD_TYPE_YEAR' undeclared (first use in this function) RS-MySQL.c:587: `FIELD_TYPE_NEWDATE' undeclared (first use in this function) RS-MySQL.c:591: `FIELD_TYPE_ENUM' undeclared (first use in this function) RS-MySQL.c:595: `FIELD_TYPE_SET' undeclared (first use in this function) RS-MySQL.c: In function `RS_MySQL_fetch': RS-MySQL.c:620: `MYSQL_RES' undeclared (first use in this function) RS-MySQL.c:620: `my_result' undeclared (first use in this function) RS-MySQL.c:621: `MYSQL_ROW' undeclared (first use in this function) RS-MySQL.c:621: parse error before "row" RS-MySQL.c:658: parse error before ')' token RS-MySQL.c:676: `row' undeclared (first use in this function) RS-MySQL.c:681: `MYSQL' undeclared (first use in this function) RS-MySQL.c:681: parse error before ')' token RS-MySQL.c:685: warning: assignment makes pointer from integer without a cast RS-MySQL.c: In function `RS_MySQL_getException': RS-MySQL.c:789: `MYSQL' undeclared (first use in this function) RS-MySQL.c:789: `my_connection' undeclared (first use in this function) RS-MySQL.c:809: parse error before ')' token RS-MySQL.c:811: warning: passing arg 1 of `Rf_mkChar' makes pointer from integer without a cast RS-MySQL.c: In function `RS_MySQL_closeResultSet': RS-MySQL.c:822: `MYSQL_RES' undeclared (first use in this function) RS-MySQL.c:822: `my_result' undeclared (first use in this function) RS-MySQL.c:827: parse error before ')' token RS-MySQL.c:830: `MYSQL_ROW' undeclared (first use in this function) RS-MySQL.c:830: parse error before "row" RS-MySQL.c:831: `row' undeclared (first use in this function) RS-MySQL.c: In function `RS_MySQL_managerInfo': RS-MySQL.c:900: warning: passing arg 1 of `Rf_mkChar' makes pointer from integer without a cast RS-MySQL.c: In function `RS_MySQL_connectionInfo': RS-MySQL.c:910: `MYSQL' undeclared (first use in this function) RS-MySQL.c:910: `my_con' undeclared (first use in this function) RS-MySQL.c:925: parse error before ')' token RS-MySQL.c:939: warning: passing arg 1 of `Rf_mkChar' makes pointer from integer without a cast RS-MySQL.c:940: warning: passing arg 1 of `Rf_mkChar' makes pointer from integer without a cast RS-MySQL.c: In function `RS_MySQL_dbApply': RS-MySQL.c:1158: `MYSQL_RES' undeclared (first use in this function) RS-MySQL.c:1158: `my_result' undeclared (first use in this function) RS-MySQL.c:1159: `MYSQL_ROW' undeclared (first use in this function) RS-MySQL.c:1159: parse error before "row" RS-MySQL.c:1184: `row' undeclared (first use in this function) RS-MySQL.c:1233: parse error before ')' token RS-MySQL.c:1258: `MYSQL' undeclared (first use in this function) RS-MySQL.c:1258: parse error before ')' token RS-MySQL.c:1264: warning: assignment makes pointer from integer without a cast make: *** [RS-MySQL.o] Error 1 ERROR: compilation failed for package 'RMySQL' =======================Younhee Ko(younko at uiuc.edu) http://comedu.korea.ac.kr/~unygo contact : 217-417-4868 Graduate Student in Dept. of Computer Science University of Illinois at Urbana-Champaign
On Mon, 14 Mar 2005, Ko,Younhee wrote:> Hi, I have some problem to install RMySQL package. > Could you help me?Please tell us your OS, R version, etc.> I set up the path.You set a couple of variables, but no path. (These at most supplement the include and library paths.)> [root at ep2 library]# export PKG_CPPFLAGS="-I/var/lib/mysql" > [root at ep2 library]# export PKG_LIBS="-L/var/lib/mysql - > lmysqlclient"Looks like your MySQL files are not where you claim they: I would not expect them to be there (headers are not normally in a 'lib' directory), but where they are depends on whether this is an installation from the sources (not likely if it uses /var/lib), RPM etc. E.g. FC3 has checking for mysql_init in -lmysqlclient... yes mysqlclient found in -L/usr/lib/mysql checking for /usr/local/include/mysql/mysql.h... no checking for /usr/include/mysql/mysql.h... yes Note to David James as maintainer: should not finding these be an error, or at least give a very loud warning from configure?> [root at ep2 library]# R CMD INSTALL /home/younko/RMySQL_0.5- > 5.tar.gz > > > I got this bunch of error message. > > > > Please help me. > > > * 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 > updating cache ./config.cache > creating ./config.status > creating src/Makevars > ** libs > gcc -I/usr/local/lib/R/include -I/var/lib/mysql - > I/usr/local/include -fPIC -g -O2 -c RS-DBI.c -o RS-DBI.o > gcc -I/usr/local/lib/R/include -I/var/lib/mysql - > I/usr/local/include -fPIC -g -O2 -c RS-MySQL.c -o RS- > MySQL.o > In file included from RS-MySQL.c:22: > RS-MySQL.h:40:19: mysql.h: No such file or directory > RS-MySQL.h:41:27: mysql_version.h: No such file or directory > RS-MySQL.h:42:23: mysql_com.h: No such file or directoryThat's sufficient info. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Thank you very much for your comments. Finally I installed it~ :-) But I have one more general question. Using the RMySQL package and DBI, Can I install the R object to the database? I mean, suppose I got the Objects from matest function or fitmaanova function. If I want to save the results to the database table, is it possible? Now I looked up the most functions that are related with database, but, I couldn't find it. is it possible? Thanks in advance. ---- Original message ---->Date: Tue, 15 Mar 2005 07:16:07 +0000 (GMT) >From: Prof Brian Ripley <ripley at stats.ox.ac.uk> >Subject: Re: [R] Install the RMySQL >To: "Ko,Younhee" <younko at uiuc.edu> >Cc: R-help at stat.math.ethz.ch > >On Mon, 14 Mar 2005, Ko,Younhee wrote: > >> Hi, I have some problem to install RMySQL package. >> Could you help me? > >Please tell us your OS, R version, etc. > >> I set up the path. > >You set a couple of variables, but no path. (These at mostsupplement the>include and library paths.) > >> [root at ep2 library]# export PKG_CPPFLAGS="-I/var/lib/mysql" >> [root at ep2 library]# export PKG_LIBS="-L/var/lib/mysql - >> lmysqlclient" > >Looks like your MySQL files are not where you claim they: Iwould not>expect them to be there (headers are not normally ina 'lib' directory),>but where they are depends on whether this is aninstallation from the>sources (not likely if it uses /var/lib), RPM etc. E.g.FC3 has> >checking for mysql_init in -lmysqlclient... yes > mysqlclient found in -L/usr/lib/mysql >checking for /usr/local/include/mysql/mysql.h... no >checking for /usr/include/mysql/mysql.h... yes > >Note to David James as maintainer: should not finding thesebe an error,>or at least give a very loud warning from configure? > > >> [root at ep2 library]# R CMD INSTALL /home/younko/RMySQL_0.5- >> 5.tar.gz >> >> >> I got this bunch of error message. >> >> >> >> Please help me. >> >> >> * 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 >> updating cache ./config.cache >> creating ./config.status >> creating src/Makevars >> ** libs >> gcc -I/usr/local/lib/R/include -I/var/lib/mysql - >> I/usr/local/include -fPIC -g -O2 -c RS-DBI.c -o RS-DBI.o>> gcc -I/usr/local/lib/R/include -I/var/lib/mysql - >> I/usr/local/include -fPIC -g -O2 -c RS-MySQL.c -o RS- >> MySQL.o >> In file included from RS-MySQL.c:22: >> RS-MySQL.h:40:19: mysql.h: No such file or directory >> RS-MySQL.h:41:27: mysql_version.h: No such file ordirectory>> RS-MySQL.h:42:23: mysql_com.h: No such file or directory > >That's sufficient info. > >-- >Brian D. Ripley, ripley at stats.ox.ac.uk >Professor of Applied Statistics,http://www.stats.ox.ac.uk/~ripley/>University of Oxford, Tel: +44 1865 272861(self)>1 South Parks Road, +44 1865 272866 (PA) >Oxford OX1 3TG, UK Fax: +44 1865 272595=======================Younhee Ko(younko at uiuc.edu) http://comedu.korea.ac.kr/~unygo contact : 217-417-4868 Graduate Student in Dept. of Computer Science University of Illinois at Urbana-Champaign