lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I am pleased to announce that LuaJIT 2.0 now compiles and runs on iOS version 3.0+, thanks to Mike Pall who has sacrificed his precious time for us - iOS developers. You will need fetch latest changes from GIT to proceed with iOS build, see: http://luajit.org/download.html

Please follow instructions at doc/install.html#ios of your working copy.

You may also use the script of mine below to produce complete universal library for both simulator & device (armv6 & armv7). Place the script below in your GIT working copy. Once executed you will find "iOS" subdirectory containing both headers and libluajit.a universal static library.
Just copy them into your Xcode project and include "lua.h", "lauxlib.h", "lualib.h" in your Prefix.pch.


--------------- build_iOS.sh ------------------
#!/bin/sh

# Make sure Xcode root and SDK version match your installation
ISDK=/Developer/Platforms/iPhoneOS.platform/Developer
ISDKVER=iPhoneOS4.3.sdk
ISDKP=$ISDK/usr/bin/

rm -rf iOS
mkdir iOS
make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="-arch armv6 -isysroot $ISDK/SDKs/$ISDKVER" TARGET=arm TARGET_SYS=iOS clean all
cp -p src/libluajit.a iOS/libluajit-armv6.a
make HOST_CC="gcc -m32 -arch i386" CROSS=$ISDKP TARGET_FLAGS="-arch armv7 -isysroot $ISDK/SDKs/$ISDKVER" TARGET=arm TARGET_SYS=iOS clean all
cp -p src/libluajit.a iOS/libluajit-armv7.a
make CC="gcc -m32 -arch i386" clean all
cp -p src/libluajit.a iOS/libluajit-i386.a
make clean
lipo -create iOS/libluajit-*.a -output iOS/libluajit.a
rm iOS/libluajit-*.a
cp src/luaconf.h src/lua.h src/lauxlib.h src/lualib.h iOS
-------------- /build_iOS.sh ------------------


FYI here's output from scimark.lua running on my iPhone 3GS:

Lua SciMark 2010-12-10 based on SciMark 2.0a. Copyright (C) 2006-2010 Mike Pall.

FFT         1.74  [1024]
SOR         5.34  [100]
MC          1.29  
SPARSE      3.72  [1000, 5000]
LU          4.10  [100]

SciMark     3.24  [small problem sizes]


Cheers,
-- 
Adam Strzelecki