I can't install ROracle on MacBook Air M2 with MacOS Ventura 13.4.1 and R from brew.
Preconditions
- MacBook Air M2
- MacOS Ventura 13.4.1
- R from brew
> Sys.info()
sysname "Darwin"
release "22.5.0"
version "Darwin Kernel Version 22.5.0: Thu Jun 8 22:21:34 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T8112" nodename "HostName.local" machine "arm64" login "UserName"
user "UserName"
effective_user "UserName"
sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: aarch64-apple-darwin22.4.0 (64-bit)
Running under: macOS Ventura 13.4.1
Matrix products: default
BLAS: /opt/homebrew/Cellar/openblas/0.3.23/lib/libopenblasp-r0.3.23.dylib
LAPACK: /opt/homebrew/Cellar/r/4.3.1/lib/R/lib/libRlapack.dylib; LAPACK version 3.11.0
locale:
[1] pl_PL.UTF-8/pl_PL.UTF-8/pl_PL.UTF-8/C/pl_PL.UTF-8/pl_PL.UTF-8
time zone: Europe/Warsaw
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.3.1
install.packages("DBI")
I'm installing ROracle according: [https://cran.r-project.org/web/packages/ROracle/INSTALL]
So, I've installed Oracle Instant Client Version 12.2.0.1.0
- Basic Package
- SDK Package
- SQL*Plus Package from site https://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.html
With environment
ORACLE_HOME="/Users/UserName/instantclient_12_2"
export ORACLE_HOME
PATH=$ORACLE_HOME:$PATH
export PATH
sqlplus works properly.
Installing
When I am installing ROracle:
R CMD INSTALL --configure-args='--with-oci-lib=/Users/UserName/instantclient_12_2 --with-oci-inc=/Users/UserName/instantclient_12_2/sdk/include' ~/Downloads/ROracle_1.3-1.1.tar.gz
Result
I get the result:
* installing to library ‘/opt/homebrew/lib/R/4.3/site-library’
* installing *source* package ‘ROracle’ ...
** pakiet ‘ROracle’ został pomyślnie rozpakowany oraz sumy MD5 zostały sprawdzone
** using staged installation
configure: creating ./config.status
config.status: creating src/Makevars
** libs
using C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using SDK: ‘MacOSX13.3.sdk’
clang -I"/opt/homebrew/Cellar/r/4.3.1/lib/R/include" -DNDEBUG -I/Users/UserName/instantclient_12_2/sdk/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include -fPIC -g -O2 -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);
~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/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);
~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/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);
~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/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);
~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/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"/opt/homebrew/Cellar/r/4.3.1/lib/R/include" -DNDEBUG -I/Users/UserName/instantclient_12_2/sdk/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include -fPIC -g -O2 -c rooci.c -o rooci.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/homebrew/Cellar/r/4.3.1/lib/R/lib -L/opt/homebrew/opt/gettext/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/xz/lib -L/opt/homebrew/lib -o ROracle.so rodbi.o rooci.o -L/Users/UserName/instantclient_12_2 -lclntsh -Wl,-rpath,/Users/UserName/instantclient_12_2 -L/opt/homebrew/Cellar/r/4.3.1/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
ld: warning: ignoring file /Users/UserName/instantclient_12_2/libclntsh.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
installing to /opt/homebrew/lib/R/4.3/site-library/00LOCK-ROracle/00new/ROracle/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
Error
...and it ends up with an error:
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘ROracle’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/homebrew/lib/R/4.3/site-library/00LOCK-ROracle/00new/ROracle/libs/ROracle.so':
dlopen(/opt/homebrew/lib/R/4.3/site-library/00LOCK-ROracle/00new/ROracle/libs/ROracle.so, 0x0006): symbol not found in flat namespace '_OCIArrayDescriptorAlloc'
Error: loading failed
Execution halted
ERROR: loading failed
No answer to a similar earlier question fixes this error: