我在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’
所以它现在正在寻找另一个不存在的目录。我不想继续猜测它所期望的目录,并试图用它们应该在这些目录中预期的文件的链接来回填它(我甚至不知道它可能在这里期待什么)。 / p>
还有其他方法可以安装吗?我想我应该能够根据Perl和Python可以使用这些驱动程序的事实来做到这一点。
谢谢, 马特
答案 0 :(得分:5)
我认为你有“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)