Search code examples
oraclerredhatoracle-call-interfacerstudio-server

How to get OCI lib to work on red hat machine with R Oracle?


I need to get OCI lib working on my rhel 6.3 machine and I am experiencing some trouble with OCI headers files that can't be found. I have installed (using yum install)

oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm

because this official page it's all I need to run OCI. To test the whole thing in general I've installed sqplus64, which worked after I set export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib. Unfortunately the headers files couldn't be found after setting LD_LIBRARY_PATH. Actually I am not surprised because there is no include directory in any of these oracle paths.

So the question is: Where do I get these missing header files from? Are they actually already there and I just can find them?

Btw: I am doing this whole exercise because I want to use ROracle on my R Studio server and this R package depends on the OCI library. Once I am back in R territory the road gets much less bumpier for me.

EDIT: this documentation helped me a little further. However, I guess I found some header files now in: "/usr/include/oracle/11.2/client64". But which variable do I have to set to this location?


Solution

  • Ladies and gentlemen, the solution is:

    $ ./configure --with-oracle-headers-path=/usr/include/oracle/11.2/client64/ --with-oracle-lib-path=/usr/lib/oracle/11.2/client64/lib/
    
    $ make
    $ make install
    

    At least this compiles without error. now let's turn to the R package itself:

    $ export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH
    $ R CMD INSTALL ROracle_1.1-7.tar.gz
    

    Details can be found here.