Solved

Installing Lua 5.2.0 on OS X 10.7.3 with X Code 4.3.2

Posted on 2012-04-02
4
990 Views
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

0
Comment
Question by:prototrumpet
  • 2
  • 2
4 Comments
 
LVL 39

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
http://www.macports.org/ports.php?by=name&substr=lua

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
http://mediamosa.org/content/installation-321-mac-os-x-lion
0
 

Author Comment

by:prototrumpet
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!
0
 

Author Comment

by:prototrumpet
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?
0
 
LVL 39

Accepted Solution

by:
Eoin OSullivan earned 500 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
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now