3

我在 Mac OSX 10.8.5 上安装了 64 位 R(R 版本 2.15.2 (2012-10-26) - “不给糖就捣蛋”),并安装了来自 Oracle 的 Oracle Instantclient 版本 11.2.0.3.0。我已经得到了 sqlplus,以及 Perl 和 Python 来运行这些。现在我正在尝试构建 ROracle。它需要从源代码构建,所以我下载了它并尝试运行:

R CMD INSTALL ROracle_1.1-10.tar.gz

但是,我认为它期望的目录结构与 Instant Client 给我的不同。例如,当我尝试运行该命令时,我得到:

$ R CMD INSTALL ROracle_1.1-10.tar.gz
* installing to library ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library’
* installing *source* package ‘ROracle’ ...
** package ‘ROracle’ successfully unpacked and MD5 sums checked
configure: error: "/Applications/instantclient_11_2/lib" directory does not exist
ERROR: configuration failed for package ‘ROracle’
* removing ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/ROracle’

确实,我的“/Applications/instantclient_11_2”目录中没有“lib”目录。但是,我确实尝试通过创建一个并链接到 '/Applications/instantclient_11_2' 目录中的 .dylib 文件来伪造它,然后我将这个错误转移到一个新的错误:

$ R CMD INSTALL ROracle_1.1-10.tar.gz
* installing to library ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library’
* installing *source* package ‘ROracle’ ...
** package ‘ROracle’ successfully unpacked and MD5 sums checked
configure: error: "/Applications/instantclient_11_2/rdbms/public" directory does not exist
ERROR: configuration failed for package ‘ROracle’
* removing ‘/Library/Frameworks/R.framework/Versions/2.15/Resources/library/ROracle’

所以它现在正在寻找另一个不存在的目录。我不想继续猜测它所期望的目录,并试图用指向这些目录中应该期望的文件的链接来反向填充它(我什至不知道它在这里可能期望什么)。

还有其他方法可以安装它吗?我想我应该能够基于 Perl 和 Python 可以使用这些驱动程序的事实来做到这一点。

谢谢,马特

4

1 回答 1

6

我认为您设置了“ORACLE_HOME”变量。我有同样的问题,只要我这样做

export ORACLE_HOME=""

我可以成功编译 ROracle。

前:

me@my-laptop:~/Downloads$ R CMD INSTALL ROracle_1.1-10.tar.gz
*installing to library ‘/opt/R/library’
* installing *source* package ‘ROracle’ ...
** package ‘ROracle’ successfully unpacked and MD5 sums checked
configure: error: "/usr/lib/oracle/12.1/rdbms/public" directory does not exist
ERROR: configuration failed for package ‘ROracle’
* removing ‘/opt/R/library/ROracle’

后:

me@my-laptop:~/Downloads$ export ORACLE_HOME=""
me@my-laptop:~/Downloads$ R CMD INSTALL ROracle_1.1-10.tar.gz
* installing to library ‘/opt/R/library’
* installing *source* package ‘ROracle’ ...
** package ‘ROracle’ successfully unpacked and MD5 sums checked
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/opt/oracle/sdk/include     -fpic  -O2 -pipe -g  -c rodbi.c -o rodbi.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/opt/oracle/sdk/include     -fpic  -O2 -pipe -g  -c rooci.c -o rooci.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/opt/oracle/sdk/include     -fpic  -O2 -pipe -g  -c routl.c -o routl.o
gcc -std=gnu99 -shared -o ROracle.so rodbi.o rooci.o routl.o -L/opt/oracle -lclntsh -L/usr/lib/R/lib -lR
installing to /opt/R/library/ROracle/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (ROracle)
于 2014-02-26T17:39:37.020 回答