我在Mac OS Sierra上。
我尝试过 - 在OS X Mavericks上安装RODBC/Roracle软件包,但无济于事。
这就是我所做的:
- 从http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html-基本,sql plus,odbc
- 在InstantClient_12_1 中的我的主文件夹中解开拉链
- ln -s libclntsh.dylib.12.1 libclntsh.dylib
- 导出dyld_library_path =/users/dhananjaygoel/instantclient_12_1:$ dyld_library_path
- r cmd install-configure-args =' - with-oci-lib =/users/dhananjaygoel/instantclient_12_1'roracle_1.3-1.tar.gz
它给我以下错误:
* installing to library ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library’
* installing *source* package ‘ROracle’ ...
** package ‘ROracle’ successfully unpacked and MD5 sums checked
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/Users/dhananjaygoel/instantclient_12_1/sdk/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -I/opt/local/include -c rodbi.c -o rodbi.o
rodbi.c:2432:53: warning: format specifies type 'long long' but the argument has
type 'sb8' (aka 'long') [-Wformat]
sprintf(err_buf, RODBI_ERR_BIND_VAL_TOOBIG, bndsz);
^~~~~
/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^~~~~~~~~~~
rodbi.c:2469:53: warning: format specifies type 'long long' but the argument has
type 'sb8' (aka 'long') [-Wformat]
sprintf(err_buf, RODBI_ERR_BIND_VAL_TOOBIG, bndsz);
^~~~~
/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^~~~~~~~~~~
rodbi.c:2816:55: warning: format specifies type 'long long' but the argument has
type 'sb8' (aka 'long') [-Wformat]
sprintf(err_buf, RODBI_ERR_BIND_VAL_TOOBIG, bndsz);
^~~~~
/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^~~~~~~~~~~
rodbi.c:2861:55: warning: format specifies type 'long long' but the argument has
type 'sb8' (aka 'long') [-Wformat]
sprintf(err_buf, RODBI_ERR_BIND_VAL_TOOBIG, bndsz);
^~~~~
/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^~~~~~~~~~~
4 warnings generated.
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/Users/dhananjaygoel/instantclient_12_1/sdk/include -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -fPIC -Wall -mtune=core2 -g -O2 -I/opt/local/include -c rooci.c -o rooci.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o ROracle.so rodbi.o rooci.o -L/Users/dhananjaygoel/instantclient_12_1 -lclntsh -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.3/Resources/library/ROracle/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/ROracle/libs/ROracle.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.3/Resources/library/ROracle/libs/ROracle.so, 6): Library not loaded: @rpath/libclntsh.dylib.12.1
Referenced from: /Library/Frameworks/R.framework/Versions/3.3/Resources/library/ROracle/libs/ROracle.so
Reason: image not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/ROracle’
有人请帮助。
以下几个机器在运行El Capitan的几台机器上工作,因此也许它将在High Sierra上使用。与其他某些说明不同,这确实不是要求您禁用SIP。
-
安装Oracle Instant Client Basic,SDK和SQL*Plus软件包。我很确定我不会使用ODBC软件包,尽管如果您有的话,它不应该阻碍。
-
创建或编辑
~/.R/Makevars
。添加以下内容:CC=/usr/bin/clang -rpath /Users/dhananjaygoel/instantclient_12_1 LDFLAGS=-L/Users/dhananjaygoel/instantclient_12_1
CC
中的-RPATH设置和LDFLAGS
中的-L链接目录都应是Instant Client的.dylib文件的位置。如果您将它们移到了另一个位置(我个人更喜欢制作A/Lib子目录并将其放在那里),那就是您应该指向的地方。 -
运行安装命令:
R CMD INSTALL --configure-args='--with-oci-lib=/Users/dhananjaygoel/instantclient_12_1' ROracle_1.3-1.tar.gz
用
--with-oci-lib=
指向即时客户端的根(与Makevars中的参考不同,据我所知,这并不依赖于.dylib文件的位置)。
我发现了谷歌搜索。
只需ctrl f(或您在Mac上的替代方案,我正在使用Linux)单词"找不到图像",它将带您解决问题。
该页面最终将带您到这里。
但是,这与您的错误非常相似,但是,我没有任何使用Mac的经验,希望它会有所帮助:)