Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 217
Matt Bannert Avatar asked Dec 19 '12 14:12

Matt Bannert


2 Answers

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.

like image 151
Matt Bannert Avatar answered Sep 23 '22 18:09

Matt Bannert


  1. Download the oracle-instantclient and oracle-instantclient-devel rpms on Oracle Instant Client website
  2. Install them using yum with --nogpgcheck (thanks to this answer):
yum install --nogpgcheck oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
  1. Now install ROracle by defining LD_LIBRARY_PATH, OCI_LIB and OCI_INC environment variables (like said in the doc):
LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib:$LD_LIBRARY_PATH OCI_LIB=/usr/lib/oracle/12.1/client64/lib OCI_INC=/usr/include/oracle/12.1/client64 R -e 'install.packages("ROracle", repos="http://cloud.r-project.org");'
like image 42
Anthony O. Avatar answered Sep 25 '22 18:09

Anthony O.