Reputation: 33
When trying to use ROracle I get the following error message
> library("ROracle")
Error: package or namespace load failed for ‘ROracle’:
package ‘ROracle’ was installed before R 4.0.0: please re-install it
I've installed/downloaded DBI, RTools, oracle isntant client (basic + sdk) and tried following these instructions but it did not work: ROracle install
I'm able to download ROracle just fine (see below) so I'm stumped on what is missing. Do I need to downgrade a version?
> Roracle_path <- "filepath.../ROracle_1.3-2.zip"
> install.packages(Roracle_path, repos = NULL)
Installing package into ‘C:/Users/<my username>/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
package ‘ROracle’ successfully unpacked and MD5 sums checked
Upvotes: 3
Views: 1797
Reputation: 252
ROracle_1.3-2.tar.gz which is built for R 3.6.x works also with R 4.x if you install the package from SOURCES.
On Linux systems at first you have to install the Oracle Instant Client basic and SDK:
/home/jovyan/R
unzip instantclient-basic-linux.x64-21.4.0.0.0dbru.zip -d /opt/oracle/
unzip instantclient-sdk-linux.x64-21.4.0.0.0dbru.zip -d /opt/oracle
The linux package libaio1 have to be installed on the system:
apt install -y libaio1
Next, the environment variables must be set:
export PATH="$PATH:/opt/oracle/instantclient_21_4"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/oracle/instantclient_21_4"
Finally the package can be installed from Sources (use ROracle_1.3-2.tar.gz (sources) but not ROracle_1.3-2_R_x86_64-linux-gnu.tar.gz (binary) ):
R CMD INSTALL --configure-args='--with-oci-lib=/opt/oracle/instantclient_21_4/ --with-oci-inc=/opt/oracle/instantclient_21_4/sdk/include' ROracle_1.3-2.tar.gz
During the installation process you will see that the package will be installed from SOURCES:
* installing to library ‘/opt/conda/lib/R/library’
* installing *source* package ‘ROracle’ ...
** using staged installation
configure: creating ./config.status
config.status: creating src/Makevars
** libs
x86_64-conda-linux-gnu-cc -I"/opt/conda/lib/R/include" -DNDEBUG -I/opt/oracle/instantclient_21_4/sdk/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /opt/conda/include -I/opt/conda/include -Wl,-rpath-link,/opt/conda/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /opt/conda/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base-split_1639563404388/work=/usr/local/src/conda/r-base-4.1.2 -fdebug-prefix-map=/opt/conda=/usr/local/src/conda-prefix -c rodbi.c -o rodbi.o
x86_64-conda-linux-gnu-cc -I"/opt/conda/lib/R/include" -DNDEBUG -I/opt/oracle/instantclient_21_4/sdk/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /opt/conda/include -I/opt/conda/include -Wl,-rpath-link,/opt/conda/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /opt/conda/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base-split_1639563404388/work=/usr/local/src/conda/r-base-4.1.2 -fdebug-prefix-map=/opt/conda=/usr/local/src/conda-prefix -c rooci.c -o rooci.o
x86_64-conda-linux-gnu-cc -shared -L/opt/conda/lib/R/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/opt/conda/lib -Wl,-rpath-link,/opt/conda/lib -L/opt/conda/lib -o ROracle.so rodbi.o rooci.o -L/opt/oracle/instantclient_21_4/ -lclntsh -Wl,-rpath,/opt/oracle/instantclient_21_4/ -L/opt/conda/lib/R/lib -lR
installing to /opt/conda/lib/R/library/00LOCK-ROracle/00new/ROracle/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ROracle)
#
Check the line in the output to see it will be installed from Sources:
* installing *source* package ‘ROracle’ ...
Upvotes: 1