Installing Lua 5.2.0 on OS X 10.7.3 with X Code 4.3.2

Posted on 2012-04-02
Medium Priority
Last Modified: 2012-06-12
So, my class is working with Lua, and we cannot figure out how to get it on our Macs.  We are up to date on everything, and from what I can tell, that is the problem.  Apple has been bundling X Code into an app, and that has allegedly been causing problems accessing /usr/bin commands in the Terminal, which we need in order to do development in certain situations.  

One came up recently, when trying to get Lua on our Macs.  According to the Lua page and countless guides, I have to unzip the folder, get to the directory with the makefile, and run
make macosx

Open in new window

I get
-bash:make:command not found

Open in new window

I have tried to work around this by creating symbolic links of the entire contents of the Developer/usr/bin folder to the local /usr/bin, and I was able to run the make command.  However, it ended in disaster:
Cliffs-MacBook-Air:lua-5.2.0 Cliff$ make macosx
cd src && make macosx
make all SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline"
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_MACOSX    -c -o lapi.o lapi.c
lapi.c:9:20: error: string.h: No such file or directory
In file included from luaconf.h:11,
                 from lua.h:16,
                 from lapi.c:14:
/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:15:25: error: limits.h: No such file or directory
make[2]: *** [lapi.o] Error 1
make[1]: *** [macosx] Error 2
make: *** [macosx] Error 2

Open in new window

Question by:prototrumpet
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 40

Expert Comment

by:Eoin OSullivan
ID: 37796807
I assume this is the LUA you are interested in using (http://www.lua.org/about.html).

I find that installing Unix apps on OSX that involve compiling etc. can be a real headache .. it is easier to use pre-built packages using something like MACPORTS as these are tried and tested on OSX Snow Leopard and OSX Lion

The last post on this page shows the steps required... you have XCode installed .. so you simply install macports then the specific lua packages you require

Author Comment

ID: 37797185
I thought of MacPorts but haven't tried it yet because the latest version I saw was a 5.1.X and the current was 5.2.0.  If that's my only option though, I'll have to go for it.  I will reply with results shortly, thanks!

Author Comment

ID: 37797350
Here is what I am getting when trying to install with MacPorts:

Error: Target org.macports.configure returned: configure failure: shell command failed (see log for details)
Error: Failed to install ncurses
Log for ncurses is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_ncurses/ncurses/main.log
Error: The following dependencies were not installed: readline ncurses
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

Open in new window

I believe the shell command failed error is due to a lot of the developer shell commands you get with X Code not working, which is essentially the basis of my problem, I believe.  I can't access make, gcc, g++, etc without the X Code GUI.  My system, since installing the latest version of X Code via the App Store, has been neutered of all of its Terminal development prowess.  Any ideas?
LVL 40

Accepted Solution

Eoin OSullivan earned 2000 total points
ID: 37797519
Maybe you should delete and do a re-install the latest XCode using the AppStore as it sounds like the XCode installation might be at issue.

I've had no problem installing macports or any of its packages..

I'd recommend you get rid of those symbolic links in the Developer/usr/bin/ folder ..

Did you have earlier versions of XCode installed which may be confusing things?

I simply installed macports .. after ensuring that the 3 steps below were complete

1. Install Xcode 4.3 from Mac App Store
2. Install Command Line Tools for Xcode
3. Run the command in a Terminal window ... sudo /usr/bin/xcode-select -switch /Applications/Xcode.app

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface   In the first 100 days of the Macintosh release in January 1984, Apple sold 72,000 of the computers. Relatively cheap, easy-to-use personal computer with a graphical operating system. I've never seen this model. I did see this one:   …
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month8 days, 4 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question