【问题标题】:ROracle package installation failureROracle 软件包安装失败
【发布时间】:2019-02-12 09:11:33
【问题描述】:

我知道有关此问题的其他问题,但它们与我的系统设置或我遇到的安装错误没有太多共同之处,因此:

我使用的是 Windows 7,64 位

我已经安装了 64 位 Oracle Instant Client 18.3.0.0.0 及其 sdk 和 odbc 扩展,可从http://www.oracle.com/technetwork/topics/winx64soft-089540.html 获得

我已将安装位置 `C:\Oracle\instantclient_18_3' 放在 PATH 上。

我已经安装了 R 3.5.1 和 Rtools 3.5;两者都在 PATH 上。

在 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 status

Rtools 找不到的文件 ociver.h 肯定存在于OCI_INC 文件夹中,所以我不知道为什么会这样。有人对尝试什么有任何想法吗?

【问题讨论】:

  • 附注(这对编译问题没有帮助):不要忘记安装与您的 Instant Client 版本匹配的 VC Redistributable。 Instant Client 下载页面上有链接。
  • 是的,很高兴提到@ChristopherJones,尽管我注意到他们没有为 v 18 指定可再发行组件 - 不确定这是疏忽还是早期版本只需要它。
  • 每个 Instant Client 版本都需要一个特定的可再发行版本。

标签: r windows-7-x64 roracle rtools


【解决方案1】:

我遇到了完全相同的问题:

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 的包含文件夹中没有什么?没错,ociver.h。我相信 R 尝试将 OCI 包含文件夹的内容复制到 R 包含文件夹,因为这条线距错误几行:

copying from C:\Oracle\instantclient_18_3\sdk\include\

失败可能以管理员身份运行会有所帮助吗?或者编辑文件夹权限?

无论如何,我手动将 oracle 包含文件夹的内容复制到 R 包含文件夹中,这似乎解决了我的问题。

【讨论】:

  • 赢家!非常感谢:)
【解决方案2】:

感谢 Eric 的回答,它绝对有效!但似乎问题出在包本身,而不是 R 试图将包含文件复制到 R 的包含文件夹中。所以另一种解决方法是

  • 解压缩源存档,以便在您的文件夹中有一个ROracle 文件夹 当前目录
  • 编辑文件ROracle/configure.win 并在文件末尾添加以下行

    cp ${ROCI_INC}/ociver.h ./src/oci

  • 保存并关闭文件。现在在您的当前目录中,在您更新的包文件夹上运行安装命令

    R CMD INSTALL ROracle

这应该可以解决问题。我不确定开发人员是否忘记在 configure.win 中包含该行,或者这仅发生在较新版本的 R 中,因为该软件包自 2016 年以来尚未更新,并且在他们提到 ROracle 支持的文档中R 版本高达 3.2。

【讨论】:

  • 我向 CRAN 存档的维护者发送了一封电子邮件。找到这个@mirkhosro 的工作很棒
  • 维护人员反应非常迅速,并表示已在代码中修复,但他们正在尝试将更新上传到 CRAN(使用新驱动程序)。
  • 非常感谢@geneorama 与他们联系。我很高兴听到他们做出回应并且会生效:)
  • ROracle 程序包在 2021 年秋季仍然没有此修复程序。但是,该方法运行良好,谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-06-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-03-07
相关资源
最近更新 更多