标签:class root rm -rf dir pre cap 版本 lua 技术
我们通过yum安装的lua默认是5.1版本,如果不符合我们有的程序需要,可以通过源码编译安装最新版lua。过程记录如下:
下载->解压->编译三步曲:
wget http://www.lua.org/ftp/lua-5.3.4.tar.gz tar -xzf lua-5.3.4.tar.gz cd lua-5.3.4 make linux test
系统如果没有安装readline依赖包,编译过程中可能会出现以下错误:
解决办法:
yum install libtermcap-devel ncurses-devel libevent-devel readline-devel -y
再次编译安装即可成功.
[root@server lua-5.3.4]# make linux test cd src && make linux make[1]: Entering directory `/home/hadoop/software/lua-5.3.4/src‘ make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" make[2]: Entering directory `/home/hadoop/software/lua-5.3.4/src‘ gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o lua.o lua.c gcc -std=gnu99 -o lua lua.o liblua.a -lm -Wl,-E -ldl -lreadline gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_LINUX -c -o luac.o luac.c gcc -std=gnu99 -o luac luac.o liblua.a -lm -Wl,-E -ldl -lreadline make[2]: Leaving directory `/home/hadoop/software/lua-5.3.4/src‘ make[1]: Leaving directory `/home/hadoop/software/lua-5.3.4/src‘ src/lua -v Lua 5.3.4 Copyright (C) 1994-2017 Lua.org, PUC-Rio
替换原来的lua
[root@server lua-5.3.4]# lua -v Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio [root@server lua-5.3.4]# rm -rf /usr/bin/lua [root@server lua-5.3.4]# ln -s /home/hadoop/software/lua-5.3.4/src/lua /usr/bin/lua [root@server lua-5.3.4]# lua -v Lua 5.3.4 Copyright (C) 1994-2017 Lua.org, PUC-Rio
centos7源码编译安装lua:lua5.1升级lua5.3
标签:class root rm -rf dir pre cap 版本 lua 技术
原文地址:https://www.cnblogs.com/fit/p/9165266.html