Lua 学习摘要

Summary: Author: 张亚飞 | 阅读时间: 1 minute read | Published: 2016-04-30
Filed under Categories: LinuxTags: Note,

Lua 学习摘要

sudo apt install lua5.1
sudo apt remove lua5.1
sudo apt install liblua5.2-dev
  • luajit 安装卸载 - 可以与源码编译安装的 lua5.3 混合安装
sudo apt install libluajit-5.1-dev
sudo apt install libreadline-dev
  • 源码编译安装 lua-5.3.4

/opt/data

sudo wget http://www.lua.org/ftp/lua-5.3.4.tar.gz
tar -zvxf lua-5.3.4.tar.gz
cd lua-5.3.4/
make linux
sudo make install

输入make linux,注意在make后面一定要带上对应的平台名称,如果直接输入make它会提示你带上platform参数


Ubuntu 安装lua

  • 源码编译 lsyncd 出现如下错误
一 8月 22 23:01:23 coam@coam:/opt/data/lsyncd-release-2.1.6$ sudo cmake .
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindLua.cmake:113 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:9 (find_package)

-- Configuring incomplete, errors occurred!
See also "/opt/data/lsyncd-release-2.1.6/CMakeFiles/CMakeOutput.log".
  • 输入 lua 发现 lua 已安装
一 8月 22 23:04:00 coam@coam:/opt/data/lsyncd-release-2.1.6$ lua
Lua 5.2.4  Copyright (C) 1994-2015 Lua.org, PUC-Rio
>
  • 需要安装lua开发包
sudo apt install liblua5.2-dev

再次执行 cmake . 顺利完成

一 8月 22 23:03:57 coam@coam:/opt/data/lsyncd-release-2.1.6$ sudo cmake .
-- Found Lua: /usr/lib/x86_64-linux-gnu/liblua5.2.so;/usr/lib/x86_64-linux-gnu/libm.so
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/data/lsyncd-release-2.1.6

Comments

Cor-Ethan, the beverage → www.iirii.com