I am trying to install ROracle package version 1.3-1.1 on R version 4.4.1. The OS is RHEL 8.9, kernel 4.18.0-513.24.1.el8_9.x86_64. I've installed Oracle client 23 including JDBC, ODBC and all development rpms (from https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient23/x86_64/index.html), and I use OCI_INC and OCI_LIB environment variables to specify locations of inc files and libraries for OCI. When running R CMD INSTALL ROracle_1.3-1.1.tar.gz I'm getting the following error:
* installing to library ‘/export/apps/prod/*****/R/x86_64-redhat-linux-gnu-library/4.4’
* installing *source* package ‘ROracle’ ...
** package ‘ROracle’ successfully unpacked and MD5 sums checked
** using staged installation
configure: creating ./config.status
config.status: creating src/Makevars
** libs
using C compiler: ‘gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20)’
gcc -I"/usr/include/R" -DNDEBUG -I/usr/include/oracle/23/client64 -I/usr/local/include -fpic -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c rodbi.c -o rodbi.o
rodbi.c: In function ‘rociDrvInit’:
rodbi.c:532:31: error: format not a string literal and no format arguments [-Werror=format-security]
RODBI_ERROR((const char *)errMsg); \
^~~~~~
rodbi.c:217:15: note: in definition of macro ‘RODBI_ERROR’
error(err)
^~~
rodbi.c:1221:3: note: in expansion of macro ‘RODBI_CHECK_DRV’
RODBI_CHECK_DRV(drv, __FUNCTION__, 1, TRUE,
^~~~~~~~~~~~~~~
rodbi.c: In function ‘rociConInit’:
rodbi.c:552:31: error: format not a string literal and no format arguments [-Werror=format-security]
RODBI_ERROR((const char *)errMsg); \
^~~~~~
(and a few more screens of similar looking messages). I also experimented with an earlier (19.23) version of the client with the same result. Can someone please help me understand what I might be doing wrong? Thanks!
Best regards,
Nikolai
You're not doing anything wrong, just being restrictive about compilation warnings. The package's code quality should be improved to avoid such errors, but that's on Oracle.
The -Werror=format-security
flag is set for gcc
(you can see it on the line that starts with gcc
), and some things on the package's code trigger that warning, and the compilation fails. You need to find out where that flag is being set (e.g. CFLAGS=
in ~/.R/Makevars
). Once you find out where it is set, try removing it, reinstall the package (and set it back on afterwards, if you want to).