1. download at the website
Download Address http://www.lua.org/download.html
2. Upload to Linux
3. Installation
[Root@centos lua-5.2.3]# make
/do ' make PLATFORM ' where PLATFORM are one of these:
AIX ANSI BSD FreeBSD Gener IC Linux macosx mingw POSIX solaris
doc/readme.html for complete instructions.
[Root@centos lua-5.2.3]# make Linux cd src && make Linux make[1]: Entering directory '/ROOT/DBLION/LUA-5.2.3/SRC ' Make all syscflags= "-dlua_use_linux" syslibs= "-wl,-e-ldl-lreadline" make[2]: Entering directory '/root/dblion/ Lua-5.2.3/src ' Gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o lapi.o lapi.c Gcc-o2-wall-dlua_compat_all-dlua_ USE_LINUX-C-o lcode.o lcode.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o lctype.o lctype.c gcc-o2-wall -DLUA_COMPAT_ALL-DLUA_USE_LINUX-C-o ldebug.o ldebug.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o ldo.o LDO.C gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o ldump.o ldump.c gcc-o2-wall-dlua_compat_all-dlua_use_li NUX-C-o lfunc.o lfunc.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o lgc.o lgc.c Gcc-o2-wall-dlua_compa T_ALL-DLUA_USE_LINUX-C-o llex.o llex.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o lmem.o lmem.c gcc-o2 -wall-dlua_compat_all-dlua_use_LINUX-C-o lobject.o lobject.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o lopcodes.o lopcodes.c Gcc-o2- WALL-DLUA_COMPAT_ALL-DLUA_USE_LINUX-C-o lparser.o lparser.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-O LSTATE.O lstate.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o lstring.o lstring.c gcc-o2-wall-dlua_compat_ ALL-DLUA_USE_LINUX-C-o ltable.o ltable.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o ltm.o ltm.c gcc-o2 -WALL-DLUA_COMPAT_ALL-DLUA_USE_LINUX-C-o lundump.o lundump.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c -O lvm.o lvm.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o lzio.o lzio.c Gcc-o2-wall-dlua_compat_all-dlua_ USE_LINUX-C-o lauxlib.o lauxlib.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o lbaselib.o lbaselib.c gcc- O2-WALL-DLUA_COMPAT_ALL-DLUA_USE_LINUX-C-o lbitlib.o lbitlib.c gcc-o2-wall-dlua_compat_all-dlua_use_linux- C-o LCOROLIB.O Lcorolib. C Gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o ldblib.o ldblib.c Gcc-o2-wall-dlua_compat_all-dlua_use_linu X-C-o liolib.o liolib.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o lmathlib.o lmathlib.c gcc-o2-wall- DLUA_COMPAT_ALL-DLUA_USE_LINUX-C-o loslib.o loslib.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o lstrlib . o lstrlib.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o ltablib.o ltablib.c gcc-o2-wall-dlua_compat_all-d LUA_USE_LINUX-C-o loadlib.o loadlib.c gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o linit.o linit.c ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate. o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o L OSLIB.O lstrlib.o ltablib.o loadlib.o linit.o ranlib liblua.a gcc-o2-wall-dlua_compat_all-dlua_use_linux-c-o Lua . o LUA.C lua.c:67:31: Error: readline/readline.h: No file or directory lua.c:68:30: Error: Readline/history.h: No file or directory lua.c: in function ' Pushline ': lua.c:265: Warning: Implicitly declaring function ' ReadLine ' lua.c:265: Warning: assigning integers to pointers when assigned, not converting LUA.C: in function ' Loadline ': lua.c:297: Warning: Implicitly declaring function ' Add_history ' make[2]: [LUA.O] Error 1 Make[2]: Leaving directory '/root/dblion/lua-5.2.3/src ' make[1]: * * * [Linux] Error 2 make[1]: leaving direct Ory '/ROOT/DBLION/LUA-5.2.3/SRC ' Make: * * * [Linux] Error 2 [Root@centos lua-5.2.3]#
[Root@centos lua-5.2.3]# Whereis readline readline: [root@centos lua-5.2.3]# yum Install readline-devel.i686-Loaded Plugi Ns:fastestmirror, Refresh-packagekit, security Loading mirror speeds from cached hostfile * base:mirrors.yun-idc.com * extras:mirrors.yun-idc.com * updates:mirrors.btte.net Setting up Install Process resolving dependencies--> Running Transaction Check---> Package readline-devel.i686 0:6.0-4.el6 would be installed--> processing -devel for package:readline-devel-6.0-4.el6.i686--> processing dependency:libreadline.so.6 for package: readline-devel-6.0-4.el6.i686--> processing dependency:libhistory.so.6 for package: readline-devel-6.0-4.el6.i686--> Running Transaction Check---> Package ncurses-devel.x86_64 0:5.7-3.20090208. EL6 would be installed---> Package readline.i686 0:6.0-4.el6 would be installed--> processing Dependency:libtinfo.s O.5 for package:readline-6.0-4.el6.i686--> processing dependency:libC.so.6 (glibc_2.4) for package:readline-6.0-4.el6.i686--> Running transaction Check---> Package glibc.i686 0:2.12 -1.132.el6_5.2 would be installed--> processing Dependency:libfreebl3.so (nssrawhash_3.12.3) for package: glibc-2.12-1.132.el6_5.2.i686--> processing Dependency:libfreebl3.so for package:glibc-2.12-1.132.el6_5.2.i686- --> Package ncurses-libs.i686 0:5.7-3.20090208.el6 'll be installed--> Running transaction Check---> Package n ss-softokn-freebl.i686 0:3.14.3-10.el6_5 'll be installed--> finished Dependency resolution dependencies = =========================================================================================================== Package Arch Version Repository Size ======================
====================================================================================== Installing: Readline-devel i686 6.0-4.el6 Base 134 k Installing for DEPENDENCIES:GLIBC i686 2.12- 1.132.el6_5.2 updates 4.3 M ncurses-devel x86_64 5.7-3.20090208.el6 Base 642 k ncurses-libs i686 5.7-3.20090208.el6 Ba Se 251 k nss-softokn-freebl i686 3.14.3-10.el6_5 updates 147 k ReadLine i686 6.0-4.el6 base 176 k Tra Nsaction Summary =============================================================================================== ============= Install 6 Package (s) total download size:5.7 m installed size:17 m are this OK [y/n]: y downloading Packages: (1/6): glibc-2.12-1.132.el6_5.2.i686.rpm | 4.3 MB 00:02 (2/6): NCURSES-DEVEL-5.7-3.20090208.El6.x86_64.rpm | 642 KB 00:00 (3/6): ncurses-libs-5.7-3.20090208.el6.i686.rpm | 251 KB 00:00 (4/6): nss-softokn-freebl-3.14.3-10.el6_5.i686.rpm | 147 KB 00:00 (5/6): readline-6.0-4.el6.i686.rpm | 176 KB 00:00 (6/6): readline-devel-6.0-4.el6.i686.rpm | 134 KB 00:00---------------------------------------------------------------------------------------------------- --------Total 776 kb/s | 5.7 MB 00:07 Running rpm_check_debug Running Transaction Test Transaction test succeeded Running Transaction in stalling:glibc-2.12-1.132.el6_5.2.i686 1/6 Installing:ns s-softokn-freebl-3.14.3-10.el6_5.i686 2/6 installing:ncurses-libs-5.7-3.20090208.el6.i686 3/6 installing:ncurses-devel-5.7-3.20090208.el6.x86_64
4/6 installing:readline-6.0-4.el6.i686 5/6 installing:readline-devel-6.0-4.el6.i686 6/6 Verifying : ncurses-libs-5.7-3.20090208.el6.i686 1/6 Verifying:nss-softok n-freebl-3.14.3-10.el6_5.i686 2/6 verifying:readline-6.0-4.el6.i686 3/6 verifying:readline-devel-6.0-4.el6.i686 4/6 verifying:ncurses-devel-5.7-3.20090208.el6.x86_64 5/6 verifying:glibc-2.12-1.132.el6_5.2.i686
6/6 installed:readline-devel.i686 0:6.0-4.el6 Dependency Installed:glibc.i686 0:2.12-1.132.el6_5.2 ncurses-devel.x86_64 0:5.7-3.20090208.
El6 ncurses-libs.i686 0:5.7-3.20090208.el6 nss-softokn-freebl.i686 0:3.14.3-10.el6_5 readline.i686 0:6.0-4.el6 complete!
[Root@centos lua-5.2.3]# make Linux
cd src && make Linux
make[1]: Entering directory '/root/upload/lua-5 .2.3/src ' Make all
syscflags= '-dlua_use_linux ' syslibs= '-wl,-e-ldl-lreadline ' make[2
]: Entering directory '/ Root/upload/lua-5.2.3/src '
gcc-o2-wall-dlua_compat_all-dlua_use_linux -c-o lua.o lua.c
gcc-o Lua LUA.O liblua.a-lm-wl,-e-ldl-lreadline
/usr/bin/ld:skipping incompatible/usr/lib/gcc/x86_64-redhat-linux/ 4.4.7/.. /.. /.. /libreadline.so when searching for-lreadline
/usr/bin/ld:skipping incompatible/usr/lib/libreadline.so Searching for-lreadline
/usr/bin/ld:cannot find-lreadline
collect2:ld return 1
make[2]: * * * * [LUA] Error 1
MAKE[2]: Leaving directory '/ROOT/UPLOAD/LUA-5.2.3/SRC '
make[1]: * * * [Linux] Error 2
make[1]: Leaving directory '/root/upload/lua-5.2.3/src ' Make
: * * * [Linux] Error 2
[Root@centos local]# mkdir lua [root@centos local]# ls bin etc games include Lib Lib64 libexec Lua net-snmp sbin Scripts sedscript share src [root@centos local]# cd lua/[Root@centos lua]# Pwd/usr/local/lua [Root@centos lua-5.2.3 ]# VI Makefile 1 # Makefile for installing Lua 2 # to doc/readme.html for installation and customization INS
Tructions. 3 4 # = Change the SETTINGS BELOW to SUIT YOUR environment ======================= 5 6 # YOUR Platfor
M. plats for possible values. 7 plat= None 8 9 # Where to install. The installation starts in the SRC and doc directories, a # So take care if install_top was not a absolute path.
The local target. Want to make install_lmod and install_cmod consistent with # Lua_root, Lua_ldir, and Lua_cdir in Luac Onf.h install_top=/usr/local/lua--------------------adding LUA install_bin= $ (install_top)/bin Insta Ll_inc= $ (InstaLl_top)/include install_lib= $ (install_top)/lib install_man= $ (install_top)/man/man1-install_lmod= $ (install_top)/share/lua/$V install_cmod= $ (install_top)/lib/lua/$V # How to INSTALL.
If Your install program does is not support "-P", then have to run Ranlib on the installed. Install= install-p install_exec= $ (INSTALL)-M 0755 install_data= $ (INSTALL)-M 0644 26 # 27
# If You don ' t have "install" can be use "CP" instead.
# install= Cp-p install_exec= $ (INSTALL) # Install_data= $ (INSTALL)
Note: If you encounter make Linux or make install an error, run the [Root@centos lua-5.2.3]# yum install-y readline-devel ncurses-devel, Loaded, first plugins : Fastestmirror, Refresh-packagekit, security Loading mirror speeds from cached Hostfile * base:mirror.bit.edu.cn * ext ras:mirror.bit.edu.cn * updates:mirror.bit.edu.cn Setting up Install Process Package ncurses-devel-5.7-3.20090208.el6. X86_64 already installed and latest version resolving dependencies--> Running transaction Check---> Package readli Ne-devel.x86_64 0:6.0-4.el6 'll be installed--> finished Dependency resolution dependencies resolved ============== ============================================================================================== Package Arch Version Repository Size ========================================= =================================================================== Installing:readline-devel x86_64 6.0-4.el6 Base 134 k Transaction Summary ============================================================= =============================================== Install 1 Package (s) total download size:134 K installed size:255 K Downloading packages:y readline-devel-6.0-4.el6.x86_64.rpm | 134 KB 00:00 Running rpm_check_debug Running Transaction Test Transaction test succeeded Running Transaction in stalling:readline-devel-6.0-4.el6.x86_64 1/1 Verifying:re adline-devel-6.0-4.el6.x86_64 1/1 installed:readline-devel.x 86_64 0:6.0-4.el6 complete!
[Root@centos lua-5.2.3]# make Linux
cd src && make Linux
make[1]: Entering directory '/root/upload/lua-5 .2.3/src ' Make all
syscflags= '-dlua_use_linux ' syslibs= '-wl,-e-ldl-lreadline ' make[2
]: Entering directory '/ Root/upload/lua-5.2.3/src '
gcc-o lua lua.o liblua.a-lm-wl,-e-ldl-lreadline
gcc-o2-wall-dlua_compat_ All-dlua_use_linux -c-o luac.o luac.c gcc-o luac luac.o liblua.a-lm-wl,-e-ldl-lreadline make[2
]: L eaving directory '/root/upload/lua-5.2.3/src '
make[1]: Leaving directory '/ROOT/UPLOAD/LUA-5.2.3/SRC '
4. Compile and run
[Root@centos testscripts]# cat Dblion.lua
print ("Dblion test")
[Root@centos testscripts]# Lua Dblion.lua
dblion Test