Build a LUA environment on your MAC

Source: Internet
Author: User
Tags lua

First, download and install

(1) Latest release version

Http://www.lua.org/ftp/lua-5.3.1.tar.gz

(2) compiling

Building

Lua is implemented in pure ANSI C and compiles unmodified with all platforms that has an ANSI C compiler. Lua also compiles cleanly as C + +.

Lua is very easy to build and install. There was detailed instructions in the package but here's a simple terminal session that downloads the current release of Lua and builds it in Linux:

Curl-r-O http://www.lua.org/ftp/lua-5.3.1.tar.gztar zxf lua-5.3. 1. Tar . GZCD Lua-5.3. 1  make Linux test

For Mac OS X, use make macosx test .

Normally it will appear: src/lua-v

(3) Installation

Then enter the "sudo make install" command, you will be asked to enter password: Enter the appropriate password (your password), and then enter the automatic installation
After the installation is complete can enter LUA-V, enter will see: Lua 5.3.1 Copyright (C) 1994-2015 lua.org, Puc-riook, has been installed successfully!

Second, using the IDE

1. Installing Sublime

2. Installing the LUA Compiler

Tools->build system->new Build System

Input:

{   "cmd": ["/usr/local/bin/lua", "$file"],   "File_regex": "^ (... *):( [0-9]*):? ([0-9]*) ",   " selector ":" Source.lua "  }  

Save As Lua.sublime-build and then choose Lua on the tools-build system to compile the script.

3. Writing LUA code using sublime

Lua's editing and operating environment has been set up to create a new Hello.lua file, write a statement, choose LUA as the build system, click Command+b, you can run out.

Build a LUA environment on your MAC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.