LuaJIT

文章来自

安装LuaJIT,这是个语言,相当于Java-JDK的存在

wget -c http://luajit.org/download/LuaJIT-2.0.4.tar.gz
tar xzvf LuaJIT-2.0.4.tar.gz
cd LuaJIT-2.0.4
make install PREFIX=/usr/local/luajit

# 设置环境变量!
export LUAJIT_LIB=/usr/local/luajit/lib
export LUAJIT_INC=/usr/local/luajit/include/luajit-2.0

可能报错
报错nginx: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory 可以执行

# 具体source的路径已实际安装路径为准
ln -s /usr/local/luajit/lib/libluajit-5.1.so.2 /lib64/libluajit-5.1.so.2

helloword

  • 直接命令,也可以用lua文件,这里不展示了
luajit print("helloword")

安装cjson

wget http://www.kyne.com.au/~mark/software/download/lua-cjson-2.1.0.tar.gz
tar zxvf lua-cjson-2.1.0.tar.gz
cd lua-cjson-2.1.0

vim Makefile
PREFIX = /usr/local/luajit
LUA_INCLUDE_DIR = $(PREFIX)/include/luajit-2.0

make
make install
# 安装完毕后可以在 路径下看到有个cjson.so文件
原文地址:https://www.cnblogs.com/pengdt/p/13062373.html