ROracle LoadLibrary Failure: The Specified Module could not be found

400 Views Asked by At

I've been trying to get ROracle installed on my Win 10 VM for the last few days and nothing that I've tried is working. Tools and software that is currently installed is:

R 4.1.3

RStudio 2022.02.0+443 RTools 4.0.1.0

Instantclient_12_1

DBI

Things I've tried so far:

Install via CRAN - Use the built in installer to install to my Library location. OCI_LIB64 and PATH are edited to include the instantclient location. Rprofile.site file is updated to point to Library location.

Manually download ROracle zip file and manually move to Library location. Can only do this with old versions of ROracle as I have not been able to locate the zip file for the most recent version (1.3-1.1).

Have tried the above with older versions of R3.6.3, and RTools35.

Everything fails when loading. I'm not sure what else to do... Below is what I see when I try installing via CRAN with all the newest software versions.

R version 4.1.3 (2022-03-10) -- "One Push-Up"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DBI, lib.loc = "P:/OPT/R/Library")
> install.packages("ROracle", lib="P:/OPT/R/Library")
Package which is only available in source form, and may need
  compilation of C/C++/Fortran: ‘ROracle’
installing the source package ‘ROracle’

trying URL 'https://cran.rstudio.com/src/contrib/ROracle_1.3-1.1.tar.gz'
Content type 'application/x-gzip' length 314510 bytes (307 KB)
downloaded 307 KB

* installing *source* package 'ROracle' ...
** package 'ROracle' successfully unpacked and MD5 sums checked
** using staged installation
P:/OPT/instantclient_12_1/genezi.exe: error while loading shared libraries: MSVCR100.dll: cannot open shared object file: No such file or directory
P:/OPT/instantclient_12_1/genezi.exe: error while loading shared libraries: MSVCR100.dll: cannot open shared object file: No such file or directory
./configure.win: line 55: [: too many arguments
./configure.win: line 63: [: too many arguments
Oracle
found Instant Client P:\OPT\instantclient_12_1
found Instant Client SDK P:\OPT\instantclient_12_1/sdk/include
copying from P:\OPT\instantclient_12_1/sdk/include
** libs
Warning: this package has a non-empty 'configure.win' file,
so building only the main architecture

/mingw64/bin/gcc  -I"C:/PROGRA~1/R/R-EB9D~1.3/include" -DNDEBUG -I./oci         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c rodbi.c -o rodbi.o
/mingw64/bin/gcc  -I"C:/PROGRA~1/R/R-EB9D~1.3/include" -DNDEBUG -I./oci         -O2 -Wall  -std=gnu99 -mfpmath=sse -msse2 -mstackrealign  -c rooci.c -o rooci.o
/mingw64/bin/gcc -shared -s -static-libgcc -o ROracle.dll tmp.def rodbi.o rooci.o P:\OPT\instantclient_12_1/oci.dll -LC:/PROGRA~1/R/R-EB9D~1.3/bin/x64 -lR
installing to P:/OPT/R/Library/00LOCK-ROracle/00new/ROracle/libs/x64
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
  converting help for package 'ROracle'
    finding HTML links ... done
    ExtDriver-class                         html  
    OraConnection-class                     html  
    OraDriver-class                         html  
    OraResult-class                         html  
    Oracle                                  html  
    dbCommit-methods                        html  
    dbConnect-methods                       html  
    dbDriver-methods                        html  
    dbGetInfo-methods                       html  
    dbListConnections-methods               html  
    dbReadTable-methods                     html  
    dbSendQuery-methods                     html  
    fetch-methods                           html  
    summary-methods                         html  
** building package indices
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for 'ROracle' in inDL(x, as.logical(local), as.logical(now), ...):
 unable to load shared object 'P:/OPT/R/Library/00LOCK-ROracle/00new/ROracle/libs/x64/ROracle.dll':
  LoadLibrary failure:  The specified module could not be found.

Error: loading failed
Execution halted
ERROR: loading failed
* removing 'P:/OPT/R/Library/ROracle'
Warning in install.packages :
  installation of package ‘ROracle’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\Administrator\AppData\Local\Temp\RtmpQXFA09\downloaded_packages’
1

There are 1 best solutions below

1
On

Solved the issue by upgrading the instantclient to the most recent version and changing the permissions to every file in P:\Oracle\OPT\instantclient_21_3\sdk\include to unblocked. Reran installer wizard and installed it to the standard location (not the network share that I was using) and it went through. Tested it with some timecheck code and everything worked. Want to give credit to ROracle package installation failure and users obrl_soil and Eric Moffett for inspiring me to change ALL the file settings.