1. Download lua: wget http://www.lua.org/ftp/lua-5.2.2.tar.gz
2. Unzip the installation package: tar-zxvf lua-5.2.2.tar.gz
Cd lua-5.2.2
3. Run the "make" command. Check whether your operating system is in the list. Currently, the following platforms are supported:
Aix ansi bsd freebsd generic linux macosx mingw posix solaris
If your platform is in the list, you only need to execute "make xxx". xxx is your platform name.
After compilation, three files are generated in the src Folder: lua (Interpreter), luac (compiler), and liblua. a (library file ).
Run the "make test" command to check whether lua has been compiled successfully. This command prints the lua version information.
(If you are using a linux system and a compilation error occurs, make sure that you have installed the readline development kit. If a link error occurs, try the "make linux MYLIBS =-ltermcap" command)
(My CentOS6.3 has not encountered this problem)
4. Run the "make install INSTALL_TOP = xxx" command to install the compiled lua to the directory you want to install. Xxx is the directory you selected.
So far, your lua has been installed successfully. Type "lua" in the command line.
Lua details: click here
Lua's: click here
Recommended reading:
Lua Language 15-minute Quick Start
Lua programming (version 2nd) Chinese PDF
Lua programming (version 2) Reading Notes
NetBSD will support the use of Lua scripts to develop Kernel Components
CentOS compilation and installation of Lua LuaSocket