luasockets modeule will not load for me

All about writing scripts for Celestia in Lua and the .cel system
Topic author
logan_number5
Posts: 9
Joined: 12.12.2003
With us: 20 years 9 months

luasockets modeule will not load for me

Post #1by logan_number5 » 01.04.2009, 19:05

A few months back I had tried unsuccessfully to get luasockets-2.0.2 to work in Celestia 1.5.1
from with ScriptedOrbits. Chris suggested not doing this and using hooks instead.
My problem then was an undefined symbol (lua_getmetatable) during the require ("socket") statement.

I've now returned to this problem and the hooks work great. but when I try to bring
in sockets.. I still get problems - and I've tried a dozen ways to fix it:

Error: error loading module 'socket' from file 'socket.so':
socket.so: cannot open shared object file: No such file or directory
Segmentation fault

Assuming that it was looking for core.so, I softlinked socket.so to core.so and
got my favorite message all over again:

Error: error loading module 'socket' from file '/usr/local/smallsat/luasocket/socket.so':
/usr/local/smallsat/luasocket/socket.so: undefined symbol: lua_getmetatable


How does everyone else define their LUA_PATH & LUA_CPATH vars?
Do you put lua and luasockets in competely separate dirs, or on top of each other?

-- "extremely frustrated" Save me!

Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 9 months
Location: Stuttgart, Germany

Re: luasockets modeule will not load for me

Post #2by Stuffer » 02.04.2009, 07:11

logan_number5,

I also work with a hook script which connects to a socket.

To get the luasockets to work with Celestia you only have to copy the foldets mime, socket and (I think) lua into the celestia root directory and then it should work.
When you include the socket library by 'require "sockets" ' in your hook script you should be able to access the sockets from within Celestia.

Of course don't forget the SystemAccessPolicy which is one of my favourite mistakes.

hope this helps
Stuffer
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

Topic author
logan_number5
Posts: 9
Joined: 12.12.2003
With us: 20 years 9 months

Re: luasockets modeule will not load for me

Post #3by logan_number5 » 02.04.2009, 14:51

Stuffer, I think it improved, but its not working. Thanks.

Error: error loading module 'socket.core' from file './socket/core.so':
./socket/core.so: undefined symbol: lua_getmetatable
Segmentation fault

I have a lua folder, a mime folder (one file), and a socket folder(one file).
The hook script, socket.lua, mime.lua are in the main celestia directory.

I compiled luasockets-2.0.2 against my Lua version is 5.1.4 -
and Lua has no .so files - only a liblua.a

Could it be that celestia's built-in Lua and mine are different, so luasocket fails
to load??

ml

Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 9 months
Location: Stuttgart, Germany

Re: luasockets modeule will not load for me

Post #4by Stuffer » 03.04.2009, 08:06

Michael,

I'm sorry.
I simply overread the first lines in your first thread.
You are using Celestia 1.5.1 where I switched to using Celestia 1.6 from SVN.

I can't think of anything why it doesn't work with your version. I would assume that sth has changed in the coding regarding the addition of new lua libraries. But I'm not into the code so far.

I could only recommend to try and use 1.6 where this seems to be extremely simple and with me works perfectly fine.

Stuffer
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB

Topic author
logan_number5
Posts: 9
Joined: 12.12.2003
With us: 20 years 9 months

Re: luasockets modeule will not load for me

Post #5by logan_number5 » 03.04.2009, 20:08

Alas, no joy with 1.6 either. Exactly the same error.

[foobar@yogurt ~/celestia-1.6]$ ./celestia
Cannot chdir to '/usr/local/share/celestia', probably due to improper installation
Error: error loading module 'socket.core' from file './socket/core.so':
./socket/core.so: undefined symbol: lua_getmetatable
Segmentation fault

Clearly, I have a serious configuration problem or I'm building
lua or luasockets incorrectly.

Thanks for all the suggestions Stuffer. I appreciate it.

But after struggling for a few months with this,
I'm going to surrender and go on to other things.

l_5

Topic author
logan_number5
Posts: 9
Joined: 12.12.2003
With us: 20 years 9 months

(solved)Re: luasockets modeule will not load for me

Post #6by logan_number5 » 07.04.2009, 14:29

So I quit using my own build of lua-5.1.4 and had my system
folks install an official lua-5.1.4 and all worked great.

Not sure why that would matter, but it did.

Thanks again for your suggestions, Stuffer.

l5

Stuffer
Posts: 67
Joined: 03.12.2008
With us: 15 years 9 months
Location: Stuttgart, Germany

Re: luasockets modeule will not load for me

Post #7by Stuffer » 07.04.2009, 14:49

No problem.

Glad you figured this out.
Now have fun using it ;).
I think this socket thing is of great usage.

Stuffer
Win XP Pro x Core2Duo 2,1GHz x 2 GB RAM x NVidia Quadro FX 1500 256 MB


Return to “Scripting”