[R-SIG-Mac]RXLisp

Jan de Leeuw deleeuw@stat.ucla.edu
Wed, 21 Aug 2002 23:00:54 -0700


I was obviously fascinated by Duncan's earlier message on RXLisp.

I managed to build a working version of RXLisp for OS X, by some
unabashed and rather uninformed hacking. I compiled XLISP-STAT using
the gcc flags -fno-common  and --no-cpp-precomp (not sure if they
are necessary or not, they are part of an older hack). I "make
libxlisp.so", using Duncan's replacement for the three XLS files
(I am not sure if these are necessary with my build strategy, probably
not).  I do not really make libxlisp.so, because there is no -shared  
flag for
the static linker in OS X. I just leave the XLS directory with a broken  
link
and a lot of foo.o files.

Then I do , in the appropriate place,

R CMD INSTALL --configure-args='--with-build-dll' RXLisp

but the final link of this  is

gcc -bundle -bundle_loader /usr/local/lib/R/bin/R.bin  -o RXLisp.so \
	Converters.o RXLisp.o \
          -L/Users/deleeuw/MyStuff/Developer/xlispstat-3-52-18 -lxlisp

This breaks, of course, there is no libxlisp. I then move to RXLisp/src  
and do

gcc -bundle -bundle_loader /usr/local/lib/R/bin/R.bin  -o RXLisp.so \
	Converters.o RXLisp.o \
	$XLISP_SRC_DIR/*.o -L/usr/X11R6/lib -lX11 -L/sw/lib -ldl

i.e. I link all the foo.o files Duncan puts in libxlisp.so. Then once  
more

R CMD INSTALL --configure-args='--with-build-dll' RXLisp

which puts everything in the R hierarchy. Now I can do

[cabledoc68:~/Desktop] deleeuw% R

R : Copyright 2002, The R Development Core Team
Version 1.5.1 Patched (2002-08-04)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type `license()' or `licence()' for distribution details.

R is a collaborative project with many contributors.
Type `contributors()' for more information.

Type `demo()' for some demos, `help()' for on-line help, or
`help.start()' for a HTML browser interface to help.
Type `q()' to quit R.

 > library(RXLisp)
 > .XLispInit()
XLISP-PLUS version 3.04
Portions Copyright (c) 1988, by David Betz.
Modified by Thomas Almy and others.
XLISP-STAT Release 3.52.18 (Beta).
Copyright (c) 1989-1999, by Luke Tierney.

NULL
 > .XLisp("+",1,2,3)
[1] 6
 > .XLisp("max",1,2)
[1] 2
 > .XLisp("tan",.25)
[1] 0.2553419
 > .XLisp("sum",1:10)
[1] 55
 > .XLisp("gcd",as.integer(4),as.integer(16),as.integer(20))
[1] 4
 > .XLisp("list",1,2,3,4,5,6)
[1] 1 2 3 4 5 6
 > q()

RXLisp can of course only do subr's (i.e. functions defined
in compiled C code in XLS), and it does not know about
XLS objects, graphics, arrays, vectors, etc. I am not sure
if my version, which does not use the libxlisp.so shared
lib at all, can do all that Duncan's version can. I will put
RXLisp as a binary package on http://gifi.stat.ucla.edu/pub
===
Jan de Leeuw; Professor and Chair, UCLA Department of Statistics;
US mail: 9432 Boelter Hall, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw@stat.ucla.edu
homepage: http://gifi.stat.ucla.edu
   
------------------------------------------------------------------------ 
-------------------------
           No matter where you go, there you are. --- Buckaroo Banzai
                    http://gifi.stat.ucla.edu/sounds/nomatter.au
   
------------------------------------------------------------------------ 
-------------------------