[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


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 41

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 41

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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:   …
CocoaPods is the best way to manage library dependencies in iOS and OS X projects. By using cocoa pods there is no need of downloading the code from github and copying to your project. There are plenty of open source libraries now available with C…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

656 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