From vogels@cmu.edu  Fri Aug  3 04:16:28 2001
From: vogels@cmu.edu (Thomas J Vogels)
Date: Thu, 2 Aug 2001 23:16:28 -0400
Subject: [Rd] Compiling R (1.3.0) on AIX (4.3) fails (PR#1034)
In-Reply-To: <15208.61687.130864.413709@mithrandir.hornik.net>
Message-ID: <NFBBKIAHMMCHOBIBLMMPOECACAAA.tov@ece.cmu.edu>

Kurt,

here is the update:  With your change in TCLTK_LIBS
TCLTK_LIBS="${TCLTK_LIBS} ${wl}${TK_LIB_SPEC} ${TK_LIBS}"
I can compile with both cc and gcc:

-- using no CC in config.site I'll get gcc and compilation proceeds nicely.

-- using CC=cc in config.site forces compilation with cc and compilation
proceeds with warnings for all modules. E.g. for X11 I get the following:

       cc -Wl,-bM:SRE -Wl,-H512 -Wl,-T512 -Wl,-bnoentry       -Wl,-bexpall
-Wl,-bI:../../../etc/R.exp  -o R_X11.so  dataentry.lo devX11.lo rotated.lo
rbitmap.lo -lSM -lICE -lX11  -L/home/tov/opt/z/lib -L/home/tov/opt/z/lib  -l
dl -lm -lc
cc: 1501-218 file dataentry.lo contains an incorrect file suffix
cc: 1501-218 file devX11.lo contains an incorrect file suffix
cc: 1501-218 file rotated.lo contains an incorrect file suffix
cc: 1501-218 file rbitmap.lo contains an incorrect file suffix

-- Note that I can't just use LIBS and CPPFLAGS to set up the paths to Tcl
and Tk (as in LIBS=-L/home/tov/opt/lib and CPPFLAGS=-I/home/tov/opt/include)
since configure will try compile with -ltcl, i.e. without version number and
so doesn't find libtcl8.4.so.  Use of --with-tcltk=/home/tov/opt/lib works.
(Applies to both, cc and gcc)

-- With CC=cc I get warnings about /usr/include/stdarg.h and
/usr/include/varargs.h stepping on each other's toes with macro
re-definitions.

Excerpt form Kurt Hornik's email from Thursday, August 02, 2001 1:20 AM:

>> Do you really want to go this way?  Is AIX the only OS where you can
>> run into this kind of trouble?  If so, why not add a compilation of a
>> little test program in configure in case you have os==AIX, that would
>> use the same flags that you'll use in library/src/tcltk.c?  If that
>> fails, it's flagged early on and directly points to the tcl/tk
>> installation (and not to R).
>
> I think I want to go this way.  Reason: the current situation is a
> mixture of an R bug and a Tk inconsistency.  The R bug is that I had not
> realized that the LIB_SPECs are meant as flags to ld.  The Tk problem is
> that this is not true.
>
> The whole thing is a bit tricky, and it might be interesting to see how
> e.g. GNOME projects deal with this in their -config scripts.  As this is
> hidden inside libtool could you maybe try compiling libxml2 on your AIX
> system and see what xml2-config --libs does?

What and where is xml2?


> Also, what does
> 	./libtool --config | grep ^wl
> give for configuration with native cc?

With cc: wl=""
With gcc: wl="-Wl,"

>
> In general, the portable way would be to have package config scripts use
> $wl or alike.  But that will not do in general: someone could have gcc
> but a native C++ compiler and $wl might be different between these ...

Interestingly I saw today in Tk's configure:

case $SHLIB_LD in
   *ld*)
      TK_LD_SEARCH_FLAGS=`echo ${TK_CC_SEARCH_FLAGS} |sed -e "s|-Wl,||g" -e
"s|,| |g"`
      ;;
    *)
      TK_LD_SEARCH_FLAGS="${TK_CC_SEARCH_FLAGS}"
      ;;
esac

So they thought about throwing out the -Wl when calling the linker with
flags meant for the compiler.  I think you could turn that around and
add -Wl for linker flags that you pass to the compiler.  (My point being
that the echo&sed combination is saver than just prefixing a variable with
${wl}.)

Thanks,
  -tom

--
Email: vogels@cmu.edu

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


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