Toshinari,

you may want to contact the package maintainer, because RXLisp doesn't work on a OS X out of the box. After a bunch of hacks I have succeeded in compiling it and get it to load, but it's still not very useful, because it is still missing something at the Lisp level. Anyway, attached, you'll find a commented shell script that can be used to build the whole thing.

Cheers,
Simon

#!/bin/sh
# How to install RXLisp in OS X (Mac OS X 10.4.4 or higher, R 2.4.1 or higher!!)

# we will be building in /tmp, replace by any other directory if you wish
BDIR=/tmp

cd $BDIR
# get both tar-balls and unpack
curl -O http://www.omegahat.org/RXLisp/RXLisp_0.3-1.tar.gz
tar fxz RXLisp_0.3-1.tar.gz
curl -O ftp://ftp.stat.umn.edu/pub/xlispstat/current/xlispstat-3-52-20.tar.gz
tar fxz xlispstat-3-52-20.tar.gz

# fix xlispstat
patch xlispstat-3-52-20/lowess.c <<EOF
7c7
< #ifdef MACINTOSH
---
> #ifdef __APPLE__
EOF

# build shared library
cd $BDIR/RXLisp/xlisp
XLISP_SRC_DIR=$BDIR/xlispstat-3-52-20 ./install

# the linking will fail, because the flags are broken, link manually
cd $BDIR/xlispstat-3-52-20
cc -dynamiclib -single_module -o libxlisp.dylib  xsdynload.o xssystem.o 
unixprim.o xlarray.o xlbfun.o xlbignum.o xlcont.o xldbug.o xldmem.o xleval.o 
xlfio.o xlftab.o xlglob.o xlimage.o xlinit.o xlio.o xlisp.o xljump.o xllist.o 
xlpp.o xlprin.o xlrand.o xlread.o xlseq.o xlstr.o xlsubr.o xlsym.o xlsys.o 
xlstruct.o xlmath2.o xlmath3.o xltvec.o xlbcode.o xlbcutil.o xlshlib.o xlwrap.o 
xlmodule.o dummycod.o basics.o common.o compound.o dists.o ddists.o hrdwrobs.o 
mats1.o mats2.o math.o obinit.o objects.o optimize.o sortdata.o statinit.o 
stats.o utils.o utils2.o gamln.o splines.o kernel.o lowess.o cfft.o betab.o 
gammab.o nor.o ppnd.o studentb.o bivnor.o linalg.o cholesky.o ludecomp.o 
qrdecomp.o svdecomp.o makerot.o eigen.o minimize.o blas.o xsiview2.o xsivint.o 
xsnewplt.o xsgraph.o xsiview3.o xsivwin.o xsiview.o xsivwin2.o menus.o 
dialogs.o iviewdat.o iviewscl.o iview.o iviewint.o xshist.o xsnames.o 
xssctmat.o xsspin.o xssctplt.o windows.o stmem.o graphics.o myplot.o term.o 
postscript.o  X11BSDstuff.o X11graph.o X11menus.o X11dialogs.o X11buttons.o 
X11text.o X11toggle.o X11choice.o X11slider.o X11listitem.o X11resizebr.o 
X11scroll.o -L/usr/X11R6/lib -lX11  -lm

# ok, now back to RXLisp
cd $BDIR
XLISPLIB="-L${BDIR}/xlispstat-3-52-20 -lxlispstat" 
XLISP_SRC_DIR=${BDIR}/xlispstat-3-52-20 R CMD INSTALL 
--configure-args='--without-build-xlisp-dll' RXLisp

# again, this will fail, because RXLisp is broken and makes invalid 
assumptions, but we can fix that...
cd $BDIR
cp RXLisp/src/libRXLispConverters.so RXLisp/src/libRXLispConverters.dylib
# one more pass
XLISPLIB="-L${BDIR}/xlispstat-3-52-20 -lxlispstat" 
XLISP_SRC_DIR=${BDIR}/xlispstat-3-52-20 R CMD INSTALL 
--configure-args='--without-build-xlisp-dll' RXLisp

# ok, now it should compile and install ... except that it won't work ;)
# some more fixing to do.
libRX=`echo 
'cat(system.file("libs",.Platform$r_arch,"RXLisp.so",package="RXLisp"))' |R 
--vanilla --slave`
lib=`dirname $libRX`
cp $BDIR/xlispstat-3-52-20/libxlisp.dylib $lib/
mv $lib/libRXLispConverters.so $lib/libRXLispConverters.dylib
install_name_tool -change libRXLispConverters.so $lib/libRXLispConverters.dylib 
$libRX
install_name_tool -change libxlisp.dylib $lib/libxlisp.dylib $libRX

# phew, done ...

On Mar 4, 2007, at 9:30 AM, kamakura wrote:

Hi,

Does anyone succeed in installing RXLisp on intel Mac OS X 10.4.8
Tiger ?
I often use XLispstat on my intel mac.  I would be happy if it could
be used as R library.
I have installed xlispstat on my intel mac.

export XLISP_SRC_DIR=/Users/kamakura/work/xlispstat-3-52-20/
sudo R CMD INSTALL -configure-arg='-with-build-dll' RXLisp

WARNING: invalid package '-configure-arg=-with-build-dll'
* Installing *source* package 'RXLisp' ...
loading cache ./config.cache
*** Assuming XLisp installation is located in /usr/local/lib/xlispstat
creating ./config.status
creating src/Makevars
creating R/XLispConfig.S
creating cleanup
creating inst/scripts/RXLisp.bsh
creating inst/scripts/RXLisp.csh
creating inst/scripts/inXLisp.lsp
** libs
** arch - i386
(PKG_LIBS="-L. -lRXLispConverters -L/Users/kamakura/work/
xlispstat-3-52-20/ -lxlisp" ; export PKG_LIBS ; R CMD SHLIB -o
RXLisp.so RXLisp.c)
gcc-4.0 -arch i386 -dynamiclib -Wl,-macosx_version_min -Wl,10.3 -
undefined dynamic_lookup -single_module -multiply_defined suppress -L/
usr/local/lib -o RXLisp.so RXLisp.o -L. -lRXLispConverters -L/Users/
kamakura/work/xlispstat-3-52-20/ -lxlisp  -L/Library/Frameworks/
R.framework/Resources/lib/i386 -lR -dylib_file libRblas.dylib:/
Library/Frameworks/R.framework/Resources/lib/i386/libRblas.dylib
/usr/bin/libtool: can't locate file for: -lRXLispConverters
/usr/bin/libtool: file: -lRXLispConverters is not an object file (not
allowed in a library)
/usr/bin/libtool: can't locate file for: -lxlisp
/usr/bin/libtool: file: -lxlisp is not an object file (not allowed in
a library)
make[1]: *** [RXLisp.so] Error 1
make: *** [RXLisp.so] Error 2
ERROR: compilation failed for package 'RXLisp'
** Removing '/Library/Frameworks/R.framework/Versions/2.4/Resources/
library/RXLisp'



+++++++++++++++++++++++++++++
     Toshinari Kamakura

     Chuo University
     1-13-27 Kasuga
     Bunkyo-ku
     Tokyo 112-8551, Japan
++++++++++++++++++++++++++++++

_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac



_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to