Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ How to configure a development environment elegant Lua     - Interesting example of Linux Sort command (Linux)

- Denyhosts prevent hackers using SSH scanning (Linux)

- Oracle and MySQL difference between the jdbc (Database)

- Installation Sublime Text 3 (Build 3065) text editor in Ubuntu (Linux)

- Ubuntu system process is bound CPU core (Linux)

- Ubuntu Linux to create and increase the Swap partition tutorial (Linux)

- DM9000 bare Driver Design (Programming)

- MySQL use the integer type (Database)

- Detailed LVM2 (Linux)

- MySQL uses Federate engine mapping table to achieve operation of the local remote operation table (Database)

- Ubuntu 14.04 next upgrade to GNOME 3.12 (Linux)

- Linux server startup and logon security settings (Linux)

- Linux 4.0+ kernel support for hardware switching module (HW Switch Offload) (Linux)

- OpenCV cvFindCornerSubPix () to find sub-pixel Corner (Programming)

- Java Concurrency - multiple threads of HelloWorld (Programming)

- Ubuntu 15.04 and Ubuntu 14.04 installed Cinnamon 2.6 (Linux)

- Linux fast set ip bond (Linux)

- Select helps secure the system network management tools (Linux)

- Security enhancements in Ubuntu ssh service (Linux)

- Linux firewall Iptables study notes (Linux)

  How to configure a development environment elegant Lua
  Add Date : 2017-01-08      
  Topic of discussion

What is an elegant development environment
How to deploy (This article discusses MacOSX platform, other platforms are also applicable)
Elegant Lua development environment

Elegant Lua development environment includes at least the following:

Installation suited to the needs of the latest stable version Lua
Lua install the appropriate package manager (recommended Luarocks, install see another article)
Source Installation (rational organizational installation directory, set the environment variable to make Lua environment easier to use and easy to manage)
Version Selection

First, we pay attention to a variety of popular Lua current version (5.1x, 5.2x, 5.3x), my point is how to choose according to their needs, choose the latest stable version.

I used to do environmental Openresty (Openresty Nginx is a combination of a module Http_lua its derivative version) of the Web-based application development, execution Openresty in Lua parsing code through LuaJit and acceleration, while LuaJit based ABI Lua5.1x of development, Openresty official made clear that the use of LuaJit run Lua code is the optimal solution, so no doubt Lua5.1x is best for me, the latest stable version of Lua5.1.5.

Installation Deployment

Compared to brew, apt-get, yum, etc. installation, I recommend using the source installation, so help us to have more understanding and grasp of the details of the environment, rational organization installation directory, combined to set environment variables, and easy to use management.

Download and unzip the Lua source code:

wget http://www.lua.org/ftp/lua-5.1.5.tar.gz
tar zxvf lua-5.1.5.tar.gz
cd lua-5.1.5
Open the Makefile, you can see the following information:

PLAT = none # installation platform, the default platform is none
INSTALL_TOP = / usr / local # with the installation directory, defaults to / usr / local

# Convenience platforms targets. # Source supported platforms
PLATS = aix ansi bsd freebsd generic linux macosx mingw posix solaris
Save the INSTALL_TOP modify your installation directory after a given

INSTALL_TOP = /usr/local/lua-5.1.5
Continue the installation as follows:

make macosx # compiler platform set macosx, other platforms can be replaced directly macosx, such as make linux
make macosx install # install platform set macosx
After a successful installation as follows:

~ / Desktop / ll /usr/local/lua-5.1.5
total 0
drwxr-xr-x 4 root wheel 136B 10 19 18:48 bin
drwxr-xr-x 7 root wheel 238B 10 19 18:48 include
drwxr-xr-x 4 root wheel 136B 10 19 18:48 lib
drwxr-xr-x 3 root wheel 102B 10 19 18:48 man
drwxr-xr-x 3 root wheel 102B 10 19 18:48 share
Run lua -v Lua Version View installed

~ / Desktop / lua -v
zsh: command not found: lua
 ~ / Desktop / ln -sf /usr/local/lua-5.1.5/bin/lua / usr / local / bin / lua
 ~ / Desktop / lua -v
Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio
Installation project was supported by more than a Lua executable file, elegant place in that source installation, the installation directory to make our organization more easily manage Lua environment, future versions Lua5.1.5 related ABI, Lua and other packages will be installed to the installation directory the lib, under the share path, we can even define LUA_PATH = / usr / local / lua-5.1.5 to be more convenient and so do the related references lua.h module development.

Because the installation directory you specify /usr/local/lua-5.1.5 not in the PATH environment variable, it will be reported directly to the Executive lua command not found: lua, here we use the Add soft connection will link the executable file path to PATH By reaching the same effect can also be directly /usr/local/lua-5.1.5/bin added to your PATH environment variable.

The coexistence of multiple versions

Use natural source installation can implement multiple versions coexist

 ~ / Desktop / luarocks-2.2.2 / ll / usr / local / lua *
/ Usr / local / lua:

 // Ll / usr / local / bin / lua *
lrwxr-xr-x 1 root admin 28B 10 19 23:16 / usr / local / bin / lua -> /usr/local/lua-5.1.5/bin/lua
lrwxr-xr-x 1 root admin 28B 10 20 10:08 / usr / local / bin / lua52 -> /usr/local/lua-5.2.3/bin/lua
lrwxr-xr-x 1 root admin 28B 10 20 10:12 / usr / local / bin / lua53 -> /usr/local/lua-5.3.1/bin/lua
lrwxr-xr-x 1 root admin 29B 10 20 10:12 / usr / local / bin / luac -> /usr/local/lua-5.1.5/bin/luac
lrwxr-xr-x 1 root admin 29B 10 20 10:08 / usr / local / bin / luac52 -> /usr/local/lua-5.2.3/bin/luac
lrwxr-xr-x 1 root admin 29B 10 20 10:11 / usr / local / bin / luac53 -> /usr/local/lua-5.3.1/bin/luac
- ORA-01000 Solution (Database)
- Questions about Linux compiler u-boot (Programming)
- To install HDRMerge 0.4.3 under ubuntu (Linux)
- Samba public folder permissions (Server)
- Linux system Iptables Firewall User Manual (Linux)
- Talk about the Linux folder permissions issue again (Linux)
- Delay for the specified IP port analog network to send and receive packets on Linux (Linux)
- Firewall Configuration Red Hat Enterprise Linux 4 (Linux)
- xCAT deployment (Linux)
- php performance monitoring module XHProf (Linux)
- CentOS build JDK environment (Linux)
- How to install Linux on a MacBook Pro Retina (Linux)
- Ubuntu Gitolite management Git Server code base permissions (Server)
- How to Install lightweight Budgie desktop on Ubuntu 14.04 (v8) (Linux)
- iOS used in the development --UITabBarController tag controller (Programming)
- Linux System Getting Started Learning: Using yum to download the RPM package without installing (Linux)
- Based on Google Cloud Storage Mirroring open Maven Central Repository (Server)
- Java Timer (regular calling, to achieve a fixed time to perform) (Programming)
- crontab task scheduling Health Check (Linux)
- Manager Docker browser (Server)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.