JMath is a text based
frontend for Mathematica that is based
on the GNU Readline library . It
is to Mathematica what tcsh/bash are to csh/sh. If you are still are
using the terminal interface, you'll probably like this program. The
following are some of it's advantages over the default text based
frontend 'math'.
o Command line editing(emacs/vi) and history (via readline)
o Symbol completion
o Filename completion within strings and after << and >>
o Lets Mathematica know when terminal is resized
o Moves cursor to position of syntax errors for easy correction
In order to build JMath you will need a copy of GNU Readline. If you
don't have it it can be found at .
Readline versions less than 2.2 wont complete filenames properly.
I have tested JMath on Solaris/Linux/Irix/MacOSX with
Mathematica-3.0/4.0/4.1/5.0/5.1/5.2 and readline-2.1/2.2/4.0/4.1/4.2/4.3/5.1.
According to the license (GPL) of the Readline library, you may not
distribute binaries of this program since it links with the decidedly
not opensource MathLink library from Mathematica, but according to my
reading (and IANAL), you may compile and run this program. The JMath
code I have written is distributed under the the terms of the GPL.
BUILD
_____
The build process is
make
on Mac OS X you make need to specify the Mathematica version
that you have installed
make MV=5.2
If that doesn't work you might want to examine the explcit
instructions below which assume (except on Mac OS X) that
you already have readline installed.
Red Hat RPMs (I can't distribute _binary_ RPMs due to license issues)
_______ ____
# Do these if you don't have a ~/.rpmmacros already
# and you want to build non root (recommended).
# echo %_topdir /tmp/redhat > ~/.rpmmacros;
# mkdir -p /tmp/redhat/{RPMS/i386,SRPMS,SPECS,SOURCES,BUILD}
rpmbuild -ta jmath-0.9.16-1.tar.gz
on older RedHat systems
rpm -ta jmath-0.9.16-1.tar.gz
# Then (as root) just
# rpm -U /tmp/redhat/RPMS/i386/jmath-0.9.16-1.i386.rpm
Linux/Irix
----- ----
mcc jmath.c -o jmath -lreadline -lncurses
or if not try
mcc jmath.c -o jmath -lreadline -ltermcap
MacOS X
----- -
# MacOS X Mathematica doesn't come with "mcc"
env MATHDIR=/Applications/Mathematica\ 5.2.app/AddOns/MathLink/DevelopersKits/Darwin/CompilerAdditions \
cc -o jmath jmath.c -L"$MATHDIR" -I"$MATHDIR" -lreadline -lML -lm
# MacOS X Mathematica doesn't come with "math"
jmath --math '"/Applications/Mathematica 5.2.app/Contents/MacOS/MathKernel"'
# Actually MacOS X doesn't come with the readline devel libraries so
# you can use the following to build them.
cd jmath-0.9.16
curl -s -O ftp://ftp.gnu.org/gnu/readline/readline-5.1.tar.gz
tar zxf readline-5.1.tar.gz
cd readline-5.1
./configure
make
ln -s . readline
cd ..
mcc jmath.c -o jmath -Ireadline-5.1 readline-5.1/libreadline.a -lncurses
Solaris
-------
mcc jmath.c -o jmath -lreadline -ltermcap -lsocket -lnsl
or to force gcc
env CC=gcc mcc jmath.c -o jmath -lreadline -ltermcap -lsocket -lnsl
--
-Jim Radford 8 August 2006
radford@robotics.caltech.edu