首先下载最新的Ubuntu系统的安装包:
http://www.newlisp.org/downloads/newlisp_10.4.5-utf8_i386.deb
然后安装:
dpkg -i ./newlisp_10.4.5-utf8_i386.deb
现在看看怎么用。
运行newlisp,报错:
/usr/bin/newlisp: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory
那就安装libreadline吧。
sudo apt-get install libreadline6 libreadline6-dev
安装完后,仍然报这个错。检查一下libreadline.so.6居然在这里:
/lib/x86_64-linux-gnu/libreadline.so.6
那就添加一个链接吧:
ln -s /lib/x86_64-linux-gnu/libreadline.so.6 /usr/lib/
再运行newlisp,还是报错。
newlisp newlisp: error while loading shared libraries: libreadline.so.6: wrong ELF class: ELFCLASS64
真是无语。下载源代码重新编译吧。先删除前面的链接文件。再卸载掉之间安装的newlisp.
用apt-get autoremove newlips即可。
这里下载:http://sourceforge.net/projects/newlisp/files/newlisp-10.4.5.tgz/download
Update: 现在是最新版本:http://www.newlisp.org/downloads/newlisp-10.5.3.tgz
解压后进入目录,运行make,报错:
newlisp.h:36:19: fatal error: ffi.h: No such file or directory
安装libffi-dev
apt-get install libffi-dev
再运行make,成功了,然后运行sudo make install
安装完成。
现在运行newlisp,不带参数进入交互模式,看到:
root@chenshu-beijing:/usr/src/newlisp-10.4.5# newlisp newLISP v.10.4.5 64-bit on Linux IPv4/6 UTF-8 libffi, execute 'newlisp -h' for more info. >
成功了。可以运行lisp语句(+ 2 5)。
退出按C-c 然后根据提示按x. 或者运行(exit) 退出。
3月份补充
32bit的系统现在可以下载Ubuntu的安装包,直接安装。
下载地址是:http://www.newlisp.org/downloads/development/
文件名是:newlisp_10.4.7-utf8_i386.deb
刚好我家里有两台非常老的电脑可以享受一下。
64bit系统还要用源代码编译。