Centos安装lua-luarocks

2,268 阅读1分钟

Github官方安装地址

这里再简单记录一下执行过程

首先安装依赖

yum install libtermcap-devel ncurses-devel libevent-devel readline-devel

其次下载并安装lua

-$ curl -R -O http://www.lua.org/ftp/lua-5.3.4.tar.gz
-$ tar -zxf lua-5.3.4.tar.gz
-$ cd lua-5.3.4
-$ make linux test
-$ sudo make install

最后再下载并安装luarocks

-$ wget https://luarocks.org/releases/luarocks-3.0.4.tar.gz
-$ tar zxpf luarocks-3.0.4.tar.gz
-$ cd luarocks-3.0.4
-$ ./configure

configrue 后面还会需要跟一下详细参数,这里沾一下官方文档中给的示例吧。

Installation directories:
  --prefix=PREFIX              Directory where LuaRocks should be installed
                               [/usr/local]

By default, `make install' will install all the files in `/usr/local',
`/usr/local/lib' etc.  You can specify an installation prefix other than
`/usr/local/' using `--prefix', for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --sysconfdir=SYSCONFDIR      Directory for single-machine config [PREFIX/etc]

Where to install files provided by rocks:
  --rocks-tree=DIR             Root of the local tree of installed rocks.
                               To make files installed in this location
                               accessible to Lua and your $PATH, see
                               "luarocks path --help" after installation.
                               Avoid using paths controlled by your
                               system's package manager, such as /usr.
                               - Default is [PREFIX]

Where is your Lua interpreter:
  --lua-version=VERSION        Use specific Lua version: 5.1, 5.2, 5.3, or 5.4
                               - Default is auto-detected.
  --with-lua-bin=LUA_BINDIR    Location of your Lua binar(y/ies).
                               - Default is the directory of the
                               auto-detected Lua interpreter,
                               (or DIR/bin if --with-lua is used)
  --with-lua=LUA_DIR           Use Lua from given directory. [LUA_BINDIR/..]
  --with-lua-include=DIR       Lua's includes dir. [LUA_DIR/include]
  --with-lua-lib=DIR           Lua's libraries dir. [LUA_DIR/lib]
  --with-lua-interpreter=NAME  Lua interpreter name.
                               - Default is to auto-detected

For specialized uses of LuaRocks:
  --force-config               Force using a single config location.
                               Do not honor the $LUAROCKS_CONFIG_5_x
                               or $LUAROCKS_CONFIG environment
                               variable or the user's local config.
                               Useful to avoid conflicts when LuaRocks
                               is embedded within an application.
  --disable-incdir-check       If you do not wish to use "luarocks build",
                               (e.g. when only deploying binary packages)
                               you do not need lua.h installed. This flag
                               skips the check for lua.h in "configure".