dynload for R on AIX (>= 4.2)

Thomas Vogels Thomas Vogels <tov@ece.cmu.edu>
Mon, 14 Jun 1999 09:53:51 -0400


"Martin" == Martin Maechler <maechler@stat.math.ethz.ch> writes:

Thomas> The "ugliness" that I encounter is that I need a file of the
Thomas> exported symbols in R and the libraries (libappl.a, libmath.a,

Martin> Couldn't you just 'nm' the  R.binary file?
Martin> That should be available *before* you start building  *.so's ?
Martin> Then it could happen in src/main/Makefile[.in].

nm on R.binary would include stuff from libc.a and libm.c as well
(e.g. printf & friends).  Much like Tcl/Tk, I'd like to misuse the
LDCMD to build an export file when R.binary is linked.  I've put a
script at: http://www.ece.cmu.edu/~tov/public/ldAIX4
(or in color: http://www.ece.cmu.edu/~tov/public/ldAIX4.html)
It's invoked with something like:
ldAIX4 f77 -bdynamic -o ../../bin/R.binary *.o \
../unix/libunix.a ../appl/libappl.a ../nmath/libmath.a -lX11 -lblas -ldl -lm

Martin> I see in the "Makefile" that you're creating the list of exported objects
Martin> simply using  nm & awk :

For no particularly good reason, I've switched to nm & sed at the
moment :-)  The awk script is more readable, so I'll probly go back.
Are there concerns about non-availabilty of awk (plain awk, not gawk)?

Martin> main.exp : main.o
Martin> $(NM) $(NM_FLAGS) main.o | $(AWK) ' \
Martin> BEGIN { print "#! ."; } \
Martin> $$2 == "T" && $$1 != ".main" { print substr ($$1, 2) } \
Martin> ' > $@
Martin> 
Martin> which looks very reasonable.

... but is incomplete since I forgot about global vars (bummer, why
are there global vars? ;-)

Martin> Now we just need configure build the proper Makeconf(s) and Makefile(s)
Martin> and things would hopefully work..

Hope is a good choice of words.  I've patched configure (there is a
section with platform dependent overrides).  But now I have to patch
the Makefiles since things get confused.  More to follow.

Martin> Could we short-cut E-mail ( R-core, Arne, TomV ) to get this going?

Who is R-core?

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