R-beta: Problem with functions using sub and gsub, Solaris2.4

gordon.harrington@uni.edu gordon.harrington at uni.edu
Sat Sep 12 00:13:37 CEST 1998


Earlier Peter Dalgaard provided some helpful hints regarding sub and gsub. By
extracting regex.o from the system library and putting it in the load list and
by referencing the system regex.h it was possible unequivocally to load main
with the system regex. The resulting program still contained the bug. Since the
problem does not appear with Solaris2.5 the problem clearly lies specifically
in the Solaris2.4 system library. Another library must be used.

Compiling the GNU regex and archiving it enables a build with:
CPPFLAGS=-I/usr/local/include LIBS=/usr/local/lib/libregex.a ./configure \
	--prefix=/apps/R/Rcurrent

Gordon
> gordon.harrington at uni.edu writes:
> 
> > 
> > Previously I had problems with data(foo) and Gass and I had problems with
> > help(). His diagnostic was "POSIX regular expressions not available" and
> > mine was "invalid regular expression". Martin Maechler has no problems
> > with Solaris 2.5 and suggested a regular expression library was needed,
> > e.g., regex-x.xx. 
> 
> Gass's problem is pretty clearly that the library is absent, yours is
> - different.
> 
> The whole thing works for me in Solaris 2.5.1 too.
> 
> > 
> > Solaris 2.4 has regex.o in /usr/ccs/libgen.a and regex.h in /usr/include.
> > configure finds regcomp and make does not show any errors compiling and
> > loading. Hence their is no indication that R cannot find the appropriate
> > library. As an attempted solution, I tried downloading GNU regex-0.12 and
> > putting regex.o in src/main so that it would be available first when ld
> > searched for links. (character.c in main seems to be the only function
> > calling regcomp.) It does not alter the problem. (I am using gcc since
> > the sun native C compiler does not do well by R.)
> > 
> > Any suggestions?
> 
> This may be a completely silly suggestion, but did you add the new
> regex.o to the list of of OBJS in src/main/Makefile? You don't
> actually say that you did, and just placing the file in the directory
> is not enough.
> 
> Another thing: Are you sure that the libgen routine is getting linked
> in? Wading through DejaNews gives me some hints that there are stub
> routines in libc.a that might get linked in instead. I.e. does the
> final gcc command actually contain "-lgen"?
>


Gordon M. Harrington		Mail:	3720 Village Place, #6308
Professor Emeritus			Waterloo, IA 50702-5848
University of Northern Iowa 	Phone:	319-291-8535
gordon.harrington at uni.edu	Fax:	319-291-8324

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list