Installing Lua 5.2.2 on Mac OS X 10.7.4
Archive - Originally posted on "The Horse's Mouth" - 2013-05-25 22:13:11 - Graham Ellis"Where's the C compiler" ... "How do I build for Mac?" ... Here's how I've just done the job on a newly set up system ...
1. Download and install XCode (the Mac OS Development environment) from the Apple Store. It's free of charge.
2. Install command line tools - within XCode select from menu bar
• Xcode
• Preferences
• Downloads
• Command Line Tools
• Install
and you should now have gcc
3. Download Lua from http://www.lua.org/download.html
4. from a terminal window, unpack and build Lua
• tar xf lua-5.2.2.tar
• cd lua-5.2.2
• make macosx
5. Install it
• sudo make install
6. Test it - here's a sample session
WomanW
ithCat:lua-5.2.2 grahamellis$ lua
Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio
> print "Lua is a great language"
Lua is a great language
> print 6 + 7
stdin:1: syntax error near '6'
> print (6+7)
13
> ^D
WomanWithCat:lua-5.2.2 grahamellis$
7. Book your training course - we offer course Lua courses for newcomers to programming (Learning to program in Lua) and for those with prior experience of other languages (Lua Programming). The next public course starts in mid-June ... if you're reading this article in our archive, please click on the course links to give you next dates.
* We train on Lua for other platforms too ;-)
* If you have a group of delegates, please ask about having us run a private course for you.
P.S. Most of the other languages we teach are already installed as standard as part of current OS X (the process above has added C and C++ compilers too). Here are the versions:
WomanWithCat:~ grahamellis$ ruby -v
ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]
WomanWithCat:~ grahamellis$ perl -v
This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-thread-multi-2level
WomanWithCat:~ grahamellis$ php -v
PHP 5.3.10 with Suhosin-Patch (cli) (built: Feb 21 2012 15:30:55)
WomanWithCat:~ grahamellis$tclsh
% puts $tcl_version
8.5
WomanWithCat:~ grahamellis$ gcc -v
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
WomanWithCat:~ grahamellis$ python
Python 2.7.1 (r271:86832, Aug 5 2011, 03:30:24)
Upcoming public course details - [here]