I'm aware of the other questions about this issue, but they don't have much in common with my system setup or the installation error I'm getting, so:
I am using Windows 7, 64 bit
I have installed the 64 bit Oracle Instant Client 18.3.0.0.0 along with its sdk and odbc extensions, available from http://www.oracle.com/technetwork/topics/winx64soft-089540.html
I've put the install location C:\Oracle\instantclient_18_3
on the PATH
.
I have installed R 3.5.1 and Rtools 3.5; both are on the PATH
.
In R,
Sys.setenv(
'ORACLE_HOME' = 'C:/Oracle/instantclient_18_3',
'OCI_INC' = 'C:/Oracle/instantclient_18_3/sdk/include',
'OCI_LIB64' = 'C:/Oracle/instantclient_18_3'
)
install.packages("ROracle", type="source")
results in the following
* installing *source* package 'ROracle' ...
** package 'ROracle' successfully unpacked and MD5 sums checked
Oracle Client Shared Library 64-bit - 18.3.0.0.0 Operating in Instant Client mode.
found Oracle Client C:/Oracle/instantclient_18_3
found Oracle Client include C:/Oracle/instantclient_18_3/sdk/include
copying from C:/Oracle/instantclient_18_3/sdk/include
** libs
c:/Rtools/mingw_64/bin/gcc -I"C:/Program Files/R/R-3.5.1/include" -DNDEBUG -I./oci -O2 -Wall -std=gnu99 -mtune=generic -c rodbi.c -o rodbi.o
In file included from rooci.h:75:0,
from rodbi.c:181:
./oci/oci.h:716:20: fatal error: ociver.h: No such file or directory
#include <ociver.h>
^
compilation terminated.
make: *** [C:/Program Files/R/R-3.5.1/etc/x64/Makeconf:208: rodbi.o] Error 1
ERROR: compilation failed for package 'ROracle'
* removing 'C:/Users/obrienle/Documents/R/win-library/3.5/ROracle'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘ROracle’ had non-zero exit status
The file ociver.h that Rtools can't locate is definitely present in the OCI_INC
folder, so I don't know why this is happening. Does anyone have any ideas about what to try?
I had the exact same problem:
c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -I./oci -O2 -Wall -std=gnu99 -mtune=generic -c rodbi.c -o rodbi.o
In file included from rooci.h:75:0,
from rodbi.c:181:
./oci/oci.h:716:20: fatal error: ociver.h: No such file or directory
#include <ociver.h>
^
compilation terminated.
Once I looked a lot closer to the error I realized what was happening. It looked to me that the arguments for Rtools was setting -I to R's include folder, not the OCI include folder, and guess what isn't in R's include folder? That's right, ociver.h. I believe R tries to copy the contents of the OCI include folder to the R include folder because of this line a few lines up from the error:
copying from C:\Oracle\instantclient_18_3\sdk\include\
and fails maybe running as administrator will help? Or perhaps editing folder permissions?
Anyway, I manually copied the contents of the oracle include folder to the R include folder and that seemed to fix the problem for me.