Confirmed ldd /usr/lib/oracle/current/client64/lib/libclntsh.so.19.1
produces the same result in both environments, with no apparent missingness.
So I think the ldd
outputs may be a bit deceiving, in the sense that if I set/unset LD_LIBRARY_PATH
that does affect whether libclntsh.so.19.1
is found by ldd
, but it does not affect whether library(ROracle)
works - the library fails in either case. I can tell you if I totally unset the relevant environment variables I can produce that "not found" response by ldd
on ROracle.so
, but the result for running ldd
on libclntsh.so.19.1
itself doesn't show anything missing under that situation. (Outputs on all that are shown below.)
In other words, I don't think ROracle
is using the current setting of LD_LIBRARY_PATH
at all, at least not in the way my current user sees that environment variable in my session. My thoughts on this are either
- when ROracle is invoked it somehow spawns a child process that has its own separate set of environment variables, unaffected by those set in my own session?
- the Oracle Instant Client hard-wires paths when it is installed, and those paths have changed since we first installed it (i.e. it isn't following the symlink
/usr/lib/oracle/current
but is instead looking for a specific version number path like /usr/lib/oracle/19.1
, which we don't have (we are on 21).
But for the latter to be true, why would it work in CLI R but not RStudio?
BTW I was asked about .libPaths()
earlier, but I hadn't yet included in my replies those are also confirmed both the same, and there is only one copy/version of ROracle in any of those directories (in /usr/lib64/R/library
).
> Sys.getenv(c('LD_LIBRARY_PATH', 'ORACLE_HOME', 'TNS_ADMIN'))
LD_LIBRARY_PATH
"/usr/lib/oracle/current/client64/lib:/usr/lib64/R/lib:/lib:/usr/lib/jvm/jre/lib/amd64/server:/usr/lib/jvm/jre/lib/amd64:/usr/lib/jvm/java/lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib"
ORACLE_HOME
"/usr/lib/oracle/current/client64"
TNS_ADMIN
"/usr/lib/oracle/network/admin"
> system('ldd /usr/lib64/R/library/ROracle/libs/ROracle.so')
ldd: warning: you do not have execution permission for `/usr/lib64/R/library/ROracle/libs/ROracle.so'
linux-vdso.so.1 => (0x00007ffeddff4000)
libclntsh.so.19.1 => /usr/lib/oracle/current/client64/lib/libclntsh.so.19.1 (0x00007fd37dc94000)
libR.so => /usr/lib64/R/lib/libR.so (0x00007fd37d616000)
libc.so.6 => /lib64/libc.so.6 (0x00007fd37d248000)
libnnz21.so => /usr/lib/oracle/current/client64/lib/libnnz21.so (0x00007fd37cbd3000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fd37c9cf000)
libm.so.6 => /lib64/libm.so.6 (0x00007fd37c6cd000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd37c4b1000)
librt.so.1 => /lib64/librt.so.1 (0x00007fd37c2a9000)
libaio.so.1 => /lib64/libaio.so.1 (0x00007fd37c0a7000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fd37be8d000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd38228b000)
libclntshcore.so.21.1 => /usr/lib/oracle/current/client64/lib/libclntshcore.so.21.1 (0x00007fd37b8dd000)
libRblas.so => /usr/lib64/R/lib/libRblas.so (0x00007fd37933d000)
libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007fd37901b000)
libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007fd378ddf000)
libreadline.so.6 => /lib64/libreadline.so.6 (0x00007fd378b99000)
libtre.so.5 => /lib64/libtre.so.5 (0x00007fd378989000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007fd378712000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fd3784b0000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fd37828a000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fd37807a000)
libz.so.1 => /lib64/libz.so.1 (0x00007fd377e64000)
libicuuc.so.50 => /lib64/libicuuc.so.50 (0x00007fd377aeb000)
libicui18n.so.50 => /lib64/libicui18n.so.50 (0x00007fd3776ec000)
libgomp.so.1 => /lib64/libgomp.so.1 (0x00007fd3774c6000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fd3772b0000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007fd377086000)
libicudata.so.50 => /lib64/libicudata.so.50 (0x00007fd375ab3000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fd3757ab000)
> system('ldd /usr/lib/oracle/current/client64/lib/libclntsh.so.19.1')
linux-vdso.so.1 => (0x00007ffe2e96e000)
libnnz21.so => /usr/lib/oracle/current/client64/lib/libnnz21.so (0x00007f4949467000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f4949263000)
libm.so.6 => /lib64/libm.so.6 (0x00007f4948f61000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4948d45000)
librt.so.1 => /lib64/librt.so.1 (0x00007f4948b3d000)
libaio.so.1 => /lib64/libaio.so.1 (0x00007f494893b000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f4948721000)
libc.so.6 => /lib64/libc.so.6 (0x00007f4948353000)
/lib64/ld-linux-x86-64.so.2 (0x00007f494dec1000)
libclntshcore.so.21.1 => /usr/lib/oracle/current/client64/lib/libclntshcore.so.21.1 (0x00007f4947da3000)
> library(ROracle)
Loading required package: DBI
Error: package or namespace load failed for ‘ROracle’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/lib64/R/library/ROracle/libs/ROracle.so':
libclntsh.so.19.1: cannot open shared object file: No such file or directory
> Sys.unsetenv(c('LD_LIBRARY_PATH', 'ORACLE_HOME', 'TNS_ADMIN'))
> system('ldd /usr/lib64/R/library/ROracle/libs/ROracle.so')
ldd: warning: you do not have execution permission for `/usr/lib64/R/library/ROracle/libs/ROracle.so'
linux-vdso.so.1 => (0x00007ffc921f1000)
libclntsh.so.19.1 => not found
libR.so => /usr/lib64/R/lib/libR.so (0x00007f72f2777000)
libc.so.6 => /lib64/libc.so.6 (0x00007f72f23a9000)
libRblas.so => not found
libgfortran.so.3 => /lib64/libgfortran.so.3 (0x00007f72f2087000)
libm.so.6 => /lib64/libm.so.6 (0x00007f72f1d85000)
libquadmath.so.0 => /lib64/libquadmath.so.0 (0x00007f72f1b49000)
libreadline.so.6 => /lib64/libreadline.so.6 (0x00007f72f1903000)
libtre.so.5 => /lib64/libtre.so.5 (0x00007f72f16f3000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f72f147c000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f72f121a000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f72f0ff4000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f72f0de4000)
libz.so.1 => /lib64/libz.so.1 (0x00007f72f0bce000)
librt.so.1 => /lib64/librt.so.1 (0x00007f72f09c6000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f72f07c2000)
libicuuc.so.50 => /lib64/libicuuc.so.50 (0x00007f72f0449000)
libicui18n.so.50 => /lib64/libicui18n.so.50 (0x00007f72f004a000)
libgomp.so.1 => /lib64/libgomp.so.1 (0x00007f72efe24000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f72efc0e000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f72ef9f2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f72f3007000)
libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f72ef7c8000)
libicudata.so.50 => /lib64/libicudata.so.50 (0x00007f72ee1f5000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f72edeed000)
> system('ldd /usr/lib/oracle/current/client64/lib/libclntsh.so.19.1')
linux-vdso.so.1 => (0x00007ffe85426000)
libnnz21.so => /usr/lib/oracle/21/client64/lib/libnnz21.so (0x00007f8ab3d8b000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f8ab3b87000)
libm.so.6 => /lib64/libm.so.6 (0x00007f8ab3885000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8ab3669000)
librt.so.1 => /lib64/librt.so.1 (0x00007f8ab3461000)
libaio.so.1 => /lib64/libaio.so.1 (0x00007f8ab325f000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f8ab3045000)
libc.so.6 => /lib64/libc.so.6 (0x00007f8ab2c77000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8ab87e5000)
libclntshcore.so.21.1 => /usr/lib/oracle/21/client64/lib/libclntshcore.so.21.1 (0x00007f8ab26c7000)
> library(ROracle)
Error: package or namespace load failed for ‘ROracle’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/lib64/R/library/ROracle/libs/ROracle.so':
libclntsh.so.19.1: cannot open shared object file: No such file or directory
And here is the ldd
output from CLI R, looks like it is the same, aside from the temp memory mappings:
> system('ldd /usr/lib/oracle/current/client64/lib/libclntsh.so.19.1')
linux-vdso.so.1 => (0x00007fff41169000)
libnnz21.so => /usr/lib/oracle/current/client64/lib/libnnz21.so (0x00007fcb8b260000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fcb8b05c000)
libm.so.6 => /lib64/libm.so.6 (0x00007fcb8ad5a000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fcb8ab3e000)
librt.so.1 => /lib64/librt.so.1 (0x00007fcb8a936000)
libaio.so.1 => /lib64/libaio.so.1 (0x00007fcb8a734000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fcb8a51a000)
libc.so.6 => /lib64/libc.so.6 (0x00007fcb8a14c000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcb8fcba000)
libclntshcore.so.21.1 => /usr/lib/oracle/current/client64/lib/libclntshcore.so.21.1 (0x00007fcb89b9c000)