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

Thomas Vogels Thomas Vogels <tov@ece.cmu.edu>
30 Jul 2001 10:18:35 -0400


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...)

Thanks,
  -tom

-- 
mailto:tov@ece.cmu.edu (Tom Vogels)   Tel: (412) 268-6638   FAX: -3204

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._