我知道有关这个问题的其他问题,但它们与我的系统设置或安装错误没有太多共同之处,所以:
我使用的是Windows 7,64位
我已经安装了64位Oracle客户端18.3.0.0.0及其sdk和odbc扩展,可从http://www.oracle.com/technetwork/topics/winx64soft-089540.html获得
我已经将安装位置`C:\Oracle\instantclient_18_3‘放在了路径上。
我已经安装了R3.5.1和Rtools 3.5;两者都在路径上。
在R,
Sys.setenv(
'ORACLE_HOME' = 'C:/Oracle/instantclient_18_3',
'OCI_INC' = 'C:/Oracle/instantclient_18_3/sdk/include',
'OCI_LIB64' = 'C:/Oracle/instantclient_18_3'
)
install.packages("ROracle", type="source")结果如下:
* installing *source* package 'ROracle' ...
** package 'ROracle' successfully unpacked and MD5 sums checked
Oracle Client Shared Library 64-bit - 18.3.0.0.0 Operating in Instant Client mode.
found Oracle Client C:/Oracle/instantclient_18_3
found Oracle Client include C:/Oracle/instantclient_18_3/sdk/include
copying from C:/Oracle/instantclient_18_3/sdk/include
** libs
c:/Rtools/mingw_64/bin/gcc -I"C:/Program Files/R/R-3.5.1/include" -DNDEBUG -I./oci -O2 -Wall -std=gnu99 -mtune=generic -c rodbi.c -o rodbi.o
In file included from rooci.h:75:0,
from rodbi.c:181:
./oci/oci.h:716:20: fatal error: ociver.h: No such file or directory
#include <ociver.h>
^
compilation terminated.
make: *** [C:/Program Files/R/R-3.5.1/etc/x64/Makeconf:208: rodbi.o] Error 1
ERROR: compilation failed for package 'ROracle'
* removing 'C:/Users/obrienle/Documents/R/win-library/3.5/ROracle'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘ROracle’ had non-zero exit statusRtools无法定位的文件ociver.h绝对存在于OCI_INC文件夹中,因此我不知道为什么会发生这种情况。有人知道该怎么做吗?
发布于 2018-09-14 17:56:14
我也有同样的问题:
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -I./oci -O2 -Wall -std=gnu99 -mtune=generic -c rodbi.c -o rodbi.o
In file included from rooci.h:75:0,
from rodbi.c:181:
./oci/oci.h:716:20: fatal error: ociver.h: No such file or directory
#include <ociver.h>
^
compilation terminated.一旦我看得离错误更近一些,我就意识到发生了什么。在我看来,Rtools的参数是将-I设置为R的包含文件夹,而不是OCI的包含文件夹,猜猜R的包含文件夹中没有什么?没错,奥西弗。我相信R试图将OCI包含文件夹的内容复制到R文件夹中,因为这一行是错误的几行:
copying from C:\Oracle\instantclient_18_3\sdk\include\如果运行失败,作为管理员可能会有所帮助吗?或者编辑文件夹权限?
无论如何,我手动将oracle包含文件夹的内容复制到R文件夹,这似乎解决了我的问题。
发布于 2018-12-04 15:19:38
感谢埃里克的回答,它绝对有效!但问题似乎在于包本身,而不是R试图将包含文件复制到R的包含文件夹中。所以另一个解决办法是
ROracle文件夹ROracle/configure.win并将下面一行添加到文件的末尾
cp ${ROCI_INC}/ociver.h ./src/ociR CMD INSTALL ROracle这应该能解决问题。我不确定开发人员是否忘了在configure.win中包括这一行,或者这仅仅发生在更新版本的R中,因为这个包自2016年以来就没有更新过,而且在文档中他们提到ROracle支持多达3.2个的R版本。
发布于 2022-03-18 12:22:27
我用4.02。我发现最新的甲骨文网站上的ROracle软件包适用于InstantClient和上面描述的Sys.setenv设置。
谢谢你跟踪我。
https://stackoverflow.com/questions/52215350
复制相似问题