[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Installing luafilesystem on Mac OS X 10.6
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 8 Apr 2010 09:05:57 +0200
I'm posting this question here by Rex from the luahub forum, since it
seems a generally important question about Snow Leopard:
First of all, sorry if this is not the right place for this thread! If
it isn't please point me to a better place!
I'm tearing my hair out trying to install luafilesystem on a Mac -- I
keep getting the following error:
/usr/bin/lua: error loading module 'lfs' from file
file is not a bundle
[C]: in function 'require'
...workspace/the_project/the_file.lua:3: in main chunk
* Mac OS X 10.6.3
* Lua 5.1.4
I first attempted to build luafilesystem using the make file, then
doing a "make install". That's when I first saw the error message.
I read up a bit, installed luarocks and tried doing "luarocks install
luafilesystem". Now Lua doesn't find lfs at all. I tried copying the
lfs.so file generated by luarocks into /usr/local/lib/lua/5.1/ but
then I get the same old "file is not a bundle" error.
I uninstalled everything and compiled myself according to instructions
gcc -O2 -fpic -c -o lfs.o lfs.c
gcc -O -shared -fpic -undefined dynamic_lookup -o lfs.so lfs.o
sudo cp lfs.so /usr/local/lib/lua/5.1/
No go. I even tried the old version for Lua 5.1.0.and 5.1.2:
gcc -O2 -fno-common -c -o lfs.o lfs.c
gcc -bundle -undefined dynamic_lookup -o lfs.so lfs.o
...and I tried adding "-Wl,-bind_at_load" (and also setting
MACOSX_DEPLOYMENT_TARGET="10.6"). No improvement.
I'm running out of ideas. Is there anything else I should try?