From mail at joeconway.com  Tue Apr 29 08:31:44 2003
From: mail at joeconway.com (Joe Conway)
Date: Tue Apr 29 16:30:10 2003
Subject: [Rd] Red Hat 9 regex symbol conflict
References: <Pine.LNX.4.44.0304291109120.5367-100000@gannet.stats>
Message-ID: <3EAE8CD0.2040000@joeconway.com>

Prof Brian Ripley wrote:
> On Tue, 29 Apr 2003, Prof Brian Ripley wrote:
> 
>>2) Can you explore the use of -DUSE_SYSTEM_REGEX, which is designed for 
>>exactly this sort of problem?

Sorry, I should have mentioned that I did try that. I get a compile time 
failure:
------------------------------------------------------------------------
dcf.o(.text+0x10a): In function `do_readDCF':
/opt/src/R-1.7.0/src/main/dcf.c:63: undefined reference to `Rf_regcomp'
dcf.o(.text+0x11d):/opt/src/R-1.7.0/src/main/dcf.c:64: undefined 
reference to `Rf_regcomp'
dcf.o(.text+0x130):/opt/src/R-1.7.0/src/main/dcf.c:65: undefined 
reference to `Rf_regcomp'
dcf.o(.text+0x146):/opt/src/R-1.7.0/src/main/dcf.c:66: undefined 
reference to `Rf_regcomp'
dcf.o(.text+0x1a1):/opt/src/R-1.7.0/src/main/dcf.c:72: undefined 
reference to `Rf_regexec'
dcf.o(.text+0x1ce):/opt/src/R-1.7.0/src/main/dcf.c:88: undefined 
reference to `Rf_regexec'
dcf.o(.text+0x201):/opt/src/R-1.7.0/src/main/dcf.c:92: undefined 
reference to `Rf_regexec'
dcf.o(.text+0x227):/opt/src/R-1.7.0/src/main/dcf.c:108: undefined 
reference to `Rf_regexec'
dcf.o(.text+0x6ed):/opt/src/R-1.7.0/src/main/dcf.c:170: undefined 
reference to `Rf_regfree'
dcf.o(.text+0x6f8):/opt/src/R-1.7.0/src/main/dcf.c:171: undefined 
reference to `Rf_regfree'
dcf.o(.text+0x700):/opt/src/R-1.7.0/src/main/dcf.c:172: undefined 
reference to `Rf_regfree'
dcf.o(.text+0x70e):/opt/src/R-1.7.0/src/main/dcf.c:173: undefined 
reference to `Rf_regfree'
collect2: ld returned 1 exit status
------------------------------------------------------------------------

I stopped there earlier, but I just now was able to successfully compile 
by adding the following to src/include/Rinternals.h:

   #ifdef USE_SYSTEM_REGEX
   #include <regex.h>
   #endif /* USE_SYSTEM_REGEX */


However make check now fails with:
------------------------------------------------------------------------
make[4]: Entering directory `/opt/src/R-1.7.0/tests/Examples'
collecting examples for package 'base' ...
make[5]: Entering directory `/opt/src/R-1.7.0/src/library'
  >>> Building/Updating help pages for package 'base'
      Formats: text example
Error in grep(pattern, x, ignore.case, extended, value) :
         invalid regular expression
Execution halted


>>As I understand it, you are getting calls from regex.o in libR.so resolved
>>into some other library rather than the symbol in the same module.
>>(re_compile_fastmap is called nowhere else).  If that can happen (and it
>>seems perverse), surely regcomp and regexp called from e.g. character.o
>>could get resolved to a library other than libR.so.  I don't see we have
>>much option but to remap the names R uses to be safe.
> 
> Sorry, my grep missed this: the names used are already remapped in 
> Rregex.h.
> 
> I've made the others static in R-patched.

Great! Thank you. I'll download and give R-patched a try.

On a mostly unrelated note, I've been wondering if anyone is actively 
maintaining/working on RPgSQL? I see that it is no longer listed on 
CRAN. If not, I would like contribute by bringing RPgSQL back up to the 
level of a fully supported CRAN package (I won't have time to get 
started until June, however). Any interest or anyone specific I should 
contact?

Thanks,

Joe


[Rd] Red Hat 9 regex symbol conflict
Joe Conway