[R] RMySQL 0.6-1 Package Install Fails in R 2.5.1 (pclinuxos)

Matt Cook mcook at cymat.com
Wed Nov 19 14:25:57 CET 2008


I am having difficulties installing the RMySQL package (0.6-1) on a
clean install of pclinuxos with R version 2.5.1. My version of the OS 
came with R-base already installed along the RKWard GUI front end.I have 
attempted to install the package through RKWard however I have had some 
problems.

I have searched google and various forums extensively but I have not
found anyone with the exact same problem as myself. I am a relative 
novice with both Linux and R, so I am at a loss with where I should 
begin troubleshooting. I am fairly certain that I have installed all the 
required devel libraries for both R and MySQL. The package install seems 
to pass all the checks save for the /usr/local/include/mysql/mysql.h 
check. I have looked and this location does not exist. However the 
following check does find MySQL.h in another locale 
(/usr/include/mysql/mysql.h).

The package attempted install log and some relevant code are attached
below. Anyhelp or suggestions provided will be greatly appreciated.

I should also mention that other packages install with no difficulties,
including RMySQL's dependency, DBI.
----------------------------------------------------------------------------------------------
The following is the transcript of my attempted RMySQL install:

install.packages("RMySQL",lib="/usr/local/lib/R/library",dependencies=TRUE)

* Installing *source* package 'RMySQL' ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for compress in -lz... yes
checking for getopt_long in -lc... yes
checking for mysql_init in -lmysqlclient... yes
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking mysql.h usability... no
checking mysql.h presence... no
checking for mysql.h... no
checking /usr/local/include/mysql/mysql.h usability... no
checking /usr/local/include/mysql/mysql.h presence... no
checking for /usr/local/include/mysql/mysql.h... no
checking /usr/include/mysql/mysql.h usability... yes
checking /usr/include/mysql/mysql.h presence... yes
checking for /usr/include/mysql/mysql.h... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/local/lib/R/include -I/usr/local/lib/R/include
-I/usr/include/mysql -I/usr/local/include -fpic -g -O2 -c

RS-DBI.c -o RS-DBI.o
In file included from RS-DBI.c:22:
RS-DBI.h:263: error: expected ‘)’ before ‘c’
RS-DBI.h:263: error: expected expression before ‘)’ token
make: *** [RS-DBI.o] Error 1
chmod: cannot access `/usr/local/lib/R/library/RMySQL/libs/*': No such
file or directory
ERROR: compilation failed for package 'RMySQL'
** Removing '/usr/local/lib/R/library/RMySQL'
----------------------------------------------------------------------------------------------

*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*
I am very confused by the last portion of the install attempt where it
seems to have problems with the RS-DBI header & C files. I will include 
the suspect code lines that that are identified:

RS-DBI.c line 22 --> #include "RS-DBI.h"

RS-DBI.h
/* We now define a generic data type name-Id mapping struct
* and initialize the RS_dataTypeTable[]. Each driver could
* define similar table for generating friendly type names
*/

struct data_types {
char *typeName;
Sint typeId;
};

/* return the primitive type name for a primitive type id */
char *RS_DBI_getTypeName(Sint typeCode, const struct data_types table[]);
/* same, but callable from S/R and vectorized */

s_object *RS_DBI_SclassNames(s_object *types); s_object
*RS_DBI_createNamedList(char

**names, Stype *types, Sint *lengths, Sint n);
s_object *RS_DBI_copyFields(RS_DBI_fields *flds);
void RS_na_set(void *ptr, Stype type);
int RS_is_na(void *ptr, Stype type);
extern const struct data_types RS_dataTypeTable[];

int isalpha(int c); <-------------------------------------LINE 263

#ifdef __cplusplus
}
*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*

Regards,

-- 
Matt Cook
Junior Engineer

Cymat Technologies Ltd.
6320-2 Danville Road
Mississauga, Ontario, Canada, L5T 2L7
P: (905) 696-9900 x2425 / F: (905) 696-9300
www.cymat.com



More information about the R-help mailing list