[Rd] Compiling R (1.3.0) on AIX (4.3) fails (PR#1034)

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Mon, 30 Jul 2001 19:19:43 +0200


>>>>> Thomas Vogels writes:

> Excerpt from Kurt's email this morning:

>>>> > 2) after configure (with CC=gcc but using AIX's linker
>> /usr/bin/ld), the
>>>> > Makefile in src/library/tcltk/src doesn't protect the linker
>> flags
>> -bI
>>>> > with -Xlinker! (-Xlinker is required when using gcc so that the
>> linker flags
>>>> > are passed on to ld correctly.  Which I know that you know...)
>>>> >   The fix is to add -Xlinker before every -bI. Sorry, haven't
>> looked into
>>>> > patching configure yet...
>> 
>> Very strange.  Configure has
>> 
>> *aix4.[2-9]*)
>> EXPORTFILE="\$(top_builddir)/etc/R.exp"
>> cpicflags=
>> cxxpicflags=
>> fpicflags=
>> wl="-Wl,"
>> main_ldflags="${wl}-bdynamic ${wl}-bE:${EXPORTFILE} ${wl}-bM:SRE"
>> shlib_ldflags="${wl}-bM:SRE ${wl}-H512 ${wl}-T512 ${wl}-bnoentry \
>> ${wl}-bexpall ${wl}-bI:\$(R_HOME)/etc/R.exp"
>> SHLIB_LIBADD="\$(LIBM)"
>> ;;
>> 
>> so unless I am missing something obvious all linker flages are
>> protected
>> via `-Wl,' (which should also work if the C compiler is not gcc).
>> 

> Sorry, should have been more explicit, I guess: the problem is with
> PKG_LIBS (which is the only variable in that Makefile using linker
> flags...)  Some digging shows that '-Wl,' (or '-Xlinker') is missing
> in tkConfig.sh.  So if you have Tcl/Tk (8.3 in my case) installed and
> used AIX's 'cc' compiler, you get in trouble with later using gcc
> (e.g. for R).  Oddly, this didn't show when compiling, say, Tktable.

> There is the question, why configure didn't "see" this coming.  What
> would be nice is a warning to the effect that tkConfig.sh is broken
> when R can't compile tcltk.c.  (Currently I get messages about libc.a
> not found...)

This is asking for a bit much, I think.  How would configure know for
sure that tkConfig.sh is broken?

On second thought: the comment in tkConfig.sh says

	# String to pass to linker to pick up the Tk library from its
	# installed directory.
	TK_LIB_SPEC='@TK_LIB_SPEC@'

so maybe this assumes to be called by ld directly ...

What happens if we omit TK_LIB_SPEC from TCLTK_LIBS?

-k


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._