0

我正在尝试使用 R 2.15.1 和 Rtools 2.15 在 Windows 下编译 ROracle 包版本 1.1-4

install.packages('ROracle',type='source')

但似乎ocimingw.c缺少(见下面的输出)。我使用R CMD INSTALL --build.

编辑 2012-09-11:问题显然是 1.1-4 特有的,因为我设法正常构建和安装 1.1-1。

知道解决方案可能是什么吗?

trying URL 'http://stat.ethz.ch/CRAN/src/contrib/ROracle_1.1-4.tar.gz'
Content type 'application/x-gzip' length 156924 bytes (153 Kb)
opened URL
downloaded 153 Kb

* installing *source* package 'ROracle' ...
** package 'ROracle' successfully unpacked and MD5 sums checked
looking for Instant Client c:/instantclient/x64/instantclient_11_2
cygwin warning:
  MS-DOS style path detected: C:\instantclient\x64\instantclient_11_2
  Preferred POSIX equivalent is: /cygdrive/c/instantclient/x64/instantclient_11_2
  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
found Instant Client C:\instantclient\x64\instantclient_11_2
found Instant Client SDK c:/instantclient/x64/instantclient_11_2/sdk/include
generating ocimingw.lib from ocimingw.def
x86_64-w64-mingw32-dlltool: not found
copying from c:/instantclient/x64/instantclient_11_2/sdk/include
** 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:/R/R-215~1.1/etc/x64/Makeconf
  Preferred POSIX equivalent is: /cygdrive/c/R/R-215~1.1/etc/x64/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 -m64 -I"C:/R/R-215~1.1/include" -DNDEBUG -I./oci    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c rodbi.c -o rodbi.o
rodbi.c: In function 'rociResExec':
rodbi.c:1169:14: warning: unused variable 'drv' [-Wunused-variable]
rodbi.c: In function 'rociResFetch':
rodbi.c:1187:16: warning: unused variable 'drv' [-Wunused-variable]
rodbi.c: In function 'rociResInfo':
rodbi.c:1256:16: warning: unused variable 'drv' [-Wunused-variable]
rodbi.c: In function 'rociResTerm':
rodbi.c:1323:14: warning: unused variable 'drv' [-Wunused-variable]
rodbi.c: In function 'rodbiCheck':
rodbi.c:2348:25: warning: pointer targets in passing argument 1 of 'snprintf' differ in signedness [-Wpointer-sign]
c:\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/stdio.h:505:15: note: expected 'char * restrict' but argument is of type 'text *'
rodbi.c: In function 'rawToStrhexCall':
rodbi.c:2573:7: warning: pointer targets in passing argument 1 of 'Rf_mkChar' differ in signedness [-Wpointer-sign]
C:/R/R-215~1.1/include/Rinternals.h:628:6: note: expected 'const char *' but argument is of type 'unsigned char *'
rodbi.c:2557:26: warning: unused variable 'seglen' [-Wunused-variable]
rodbi.c: In function 'rociResInit':
rodbi.c:1121:3: warning: 'qry_encoding' may be used uninitialized in this function [-Wuninitialized]
gcc -m64 -I"C:/R/R-215~1.1/include" -DNDEBUG -I./oci    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c rooci.c -o rooci.o
In file included from C:/R/R-215~1.1/include/R.h:44:0,
                 from rodbi.h:37,
                 from rooci.c:47:
C:/R/R-215~1.1/include/R_ext/RS.h:43:0: warning: "ERROR" redefined [enabled by default]
c:\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/wingdi.h:70:0: note: this is the location of the previous definition
rooci.c: In function 'roociInitializeRes':
rooci.c:620:32: warning: 'cnvcid' may be used uninitialized in this function [-Wuninitialized]
gcc -m64 -shared -s -static-libgcc -o ROracle.dll tmp.def rodbi.o rooci.o -L. ocimingw.lib -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/R/R-215~1.1/bin/x64 -lR
gcc.exe: error: ocimingw.lib: No such file or directory
ERROR: compilation failed for package 'ROracle'
* removing 'C:/R/R-2.15.1/library/ROracle'
4

2 回答 2

0

这个问题显然是 1.1-4 特有的,因为我设法正常构建和安装 1.1-1。我会等待 1.1-5 版本再试一次。感谢所有贡献者!

于 2012-10-02T16:28:23.713 回答
0

在 Windows 中从源代码安装ROracle非常容易,如果您想从源代码中使用 ROracle,请尝试使用 Linux,这是我的安装日志

如果仍然喜欢 windows,您可以从Oracle获取已编译的 ROracle 包,它包含在“客户端支持包”中。

于 2012-09-20T16:26:55.937 回答