lua-users home
lua-l archive

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


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:

Code: [Select]
/usr/bin/lua: error loading module 'lfs' from file
'/usr/local/lib/lua/5.1/lfs.so':
   file is not a bundle
   [C]: ?
   [C]: in function 'require'
   ...workspace/the_project/the_file.lua:3: in main chunk
   [C]: ?

My versions:

    * Mac OS X 10.6.3
    * i686-apple-darwin10-gcc-4.2.1
    * Lua 5.1.4
    * luafilesystem-1.5.0

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
in http://lua-users.org/wiki/BuildingModules:

Code: [Select]
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:

Code: [Select]
MACOSX_DEPLOYMENT_TARGET="10.3"
export MACOSX_DEPLOYMENT_TARGET
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?
]]