简体   繁体   English

RMySQL的编译在以下两个方面均失败:R和R CMD

[英]Compilation of RMySQL fails in both: R and R CMD

I worked out all of these recipes, step by step. 我逐步解决了所有这些问题。 Checked a lot of times that every condition is met: 多次检查是否满足所有条件:

  1. Using MySQL in R for Windows 在Windows R中使用MySQL

  2. adding RMySQL package to R fails (on Windows)? 将RMySQL程序包添加到R失败(在Windows上)?

  3. http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL http://biostat.mc.vanderbilt.edu/wiki/Main/RMySQL

  4. http://cran.r-project.org/web/packages/RMySQL/INSTALL http://cran.r-project.org/web/packages/RMySQL/INSTALL

My setup: 我的设置:

  • Windows XP 32bit Windows XP 32位

  • MySQL 5.5 server/client with all necessary lib and include files MySQL 5.5服务器/客户端以及所有必需的lib和include文件

  • PATH: C:\\Program Files\\R\\R-2.12.2\\bin\\i386 ; 路径:C:\\ Program Files \\ R \\ R-2.12.2 \\ bin \\ i386; C:\\WINDOWS\\system32 ; C:\\ WINDOWS \\ system32; C:\\WINDOWS ; C:\\ WINDOWS; C:\\Progra~1\\R\\R-212~1.2\\bin ; C:\\ Progra〜1 \\ R \\ R-212〜1.2 \\ bin; C:\\Rtools\\bin ; C:\\ Rtools \\ bin; C:\\Rtools\\MinGW\\bin C:\\ Rtools \\ MinGW \\ bin

Still I am not able to even start compilation with R. RStudio gives me: 仍然我什至无法使用R开始编译。RStudio给了我:

> install.packages('RMySQL', type ='source')
Installing package(s) into ‘C:/Documents and Settings/.../My Documents/R/win-library/2.12’
(as ‘lib’ is unspecified)
trying URL 'http://ftp5.gwdg.de/pub/misc/cran/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
downloaded 161 Kb

>Warning in install.packages :
  installation of package 'RMySQL' had non-zero exit status

>The downloaded packages are in
    ‘C:\Documents and Settings\...\Local Settings\Temp\RtmpZnaoz4\downloaded_packages’

R CMD is starting compilation, but then it suddenly fails. R CMD正在开始编译,但是随后突然失败。 I had to add the path to the C:\\Rtools\\MinGW\\bin in the default windows path for R CMD to access gcc, although it is not mentioned in any of above recipes. 我必须在默认Windows路径中将路径添加到C:\\Rtools\\MinGW\\bin中,以使R CMD访问gcc,尽管以上任何食谱均未提及。 I suspect that there's something going on with paths. 我怀疑路径发生了什么。 Maybe R is not accessing Rtools or gcc or Rcmd, MySQL or something... 也许R无法访问Rtools或gcc或Rcmd,MySQL或其他东西。

>C:\Documents and Settings\...\downloaded_packages>R CMD INSTALL RMySQL_*.tar.gz

>* installing to library 'C:\Documents and Settings\...\My Documents/R/win-library/2.12'

>* installing *source* package 'RMySQL' ...

>checking for $MYSQL_HOME... C:/PROGRA~1/MySQL/MYSQLS~1.5

>cygwin warning:

>  MS-DOS style path detected: C:/PROGRA~1/MySQL/MYSQLS~1.5

>  Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/MySQL/MYSQLS~1.5

>  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

>  Consult the user's guide for more details about POSIX paths:

>    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

>** libs

>Warning: this package has a non-empty 'configure.win' file,

>so building only the main architecture

>cygwin warning:

>  MS-DOS style path detected: C:/PROGRA~1/R/R-212~1.2/etc/i386/Makeconf

>  Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-212~1.2/etc/i386/Makeconf

>  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

>  Consult the user's guide for more details about POSIX paths:

>    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

>gcc -I"C:/PROGRA~1/R/R-212~1.2/include" -I"C:/PROGRA~1/MySQL/MYSQLS~1.5"/include        >-O3 -Wall  -std=gnu99 -c RS-DBI.c -o RS-DBI.o

>gcc -I"C:/PROGRA~1/R/R-212~1.2/include" -I"C:/PROGRA~1/MySQL/MYSQLS~1.5"/include        >-O3 -Wall  -std=gnu99 -c RS-MySQL.c -o RS-MySQL.o

>gcc -shared -s -static-libgcc -o RMySQL.dll tmp.def RS-DBI.o RS-MySQL.o C:/PROGRA~1/MySQL/MYSQLS~1.5/lib/opt/libmysql.lib -LC:/PROGRA~1/R/R-212~1.2/bin/i386 -lR

>installing to C:\Documents and Settings\...\My Documents/R/win-library/2.12/RMySQL/libs/i386

>** R

>** inst

>** preparing package for lazy loading

>Creating a new generic function for "format" in "RMySQL"

>Creating a new generic function for "print" in "RMySQL"

>** help

>*** installing help indices

>** building package indices ...

>** testing if installed package can be loaded

>MYSQL_HOME defined as C:/PROGRA~1/MySQL/MYSQLS~1.5

>Error : .onLoad failed in loadNamespace() for 'RMySQL', details:

>  call: dir(path = mysql, pattern = "^include$", include.dirs = TRUE,

>  error: unused argument(s) (include.dirs = TRUE)

>ERROR: loading failed
>* removing 'C:\Documents and Settings\...\My Documents/R/win-library/2.12/RMySQL'

Read the error message. 阅读错误消息。

call: dir(blah blah 致电:dir(blah blah

error: unused argument(s) (include.dirs = TRUE) 错误:未使用的参数(include.dirs = TRUE)

The include.dirs argument to dir was added in R-2.13.0. dirinclude.dirs参数在R-2.13.0中添加。 See the NEWS file. 请参阅新闻文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM