• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1069
  • Last Modified:

Installing Lua 5.2.0 on OS X 10.7.3 with X Code 4.3.2

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
prototrumpet
Asked:
prototrumpet
  • 2
  • 2
1 Solution
 
Eoin OSullivanConsultantCommented:
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
 
prototrumpetAuthor Commented:
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
 
prototrumpetAuthor Commented:
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
 
Eoin OSullivanConsultantCommented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now