Linux user having trouble compiling

Re: Linux user having trouble compiling

Postby Bertram » 07 Jan 2013, 18:06

Hi! :)

We're close!

I'll handle that one as well.

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby Bertram » 07 Jan 2013, 20:31

Hi!

Here is an experimental patch (re-read many times but blindly made so far)

Rename the file to .patch

and use the git command:

git am <filename> to apply it. Is it workink? Could also softCoder or any lua specialist have a look at it?

Thanks a lot and best regards,
Attachments
0001-Adapted-the-game-engine-to-lua-5.2-a-blind-try.patch.txt
(7.96 KiB) Downloaded 228 times
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby qubodup » 08 Jan 2013, 17:14

Hey, here's my make result after make clean, rm CMakeCache.txt, cmake . and make -j1:
http://codepad.org/Te3KWCgQ

I don't know whether I know any lua/luabind specialists.

Isn't it an OK solution to rely on 5.1 for now and explain how to make sure it gets used?

I'll ask softcoder but you know how IRC can be. :)
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Linux user having trouble compiling

Postby qubodup » 08 Jan 2013, 17:49

softcoder {l Wrote}:some solution
for example megaglest uses defines for lua 5.1 vs 5.2
#if LUA_VERSION_NUM > 501
Iif(lua_rawlen(luaState, argumentIndex)!=2){
#else
Iif(luaL_getn(luaState, argumentIndex)!=2){
#endif
i see in the errors some are lua_rawlen
lua_tointegerx is a lua 5.2 new function
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Linux user having trouble compiling

Postby Bertram » 08 Jan 2013, 23:39

Hi qubodup,

Well, that's exactly the pilosophy I'm using here, both when porting luabind and now when trying to port the rest of the engine:

Here is the essence of the latest patch:

{l Code}: {l Select All Code}
#if LUA_VERSION_NUM < 502
    int32 global_index = LUA_GLOBALSINDEX;
#else
    // Push the global table index on the stack
    lua_pushglobaltable(_lstack);
    // Get it
    int32 global_index = lua_tonumber(_lstack, 1);
    // Remove the value
    lua_pop(_lstack, 1);
#endif


i see in the errors some are lua_rawlen

There are no more more errors linked to lua_rawlen. Those are fixed.

lua_tointegerx is a lua 5.2 new function

Yes, you should be compiling against lua 5.2 right?
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby qubodup » 09 Jan 2013, 10:33

I don't understand most of what's going on. Here are the steps that I take:
{l Code}: {l Select All Code}
git reset --hard origin/master
rm CMakeCache.txt
make clean
wget  http://forum.freegamedev.net/download/file.php?id=5143
git am file.php\?id\=5143
cmake . &> out.txt
make &>> out.txt
curlpaste out.txt

http://codepad.org/tnJWhhBo
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Linux user having trouble compiling

Postby Bertram » 09 Jan 2013, 11:56

Hi qubodup,

Indeed it's strange, but yet, I know the testing is still blind, so i can easily understand it's failing miserably.

I've been having a short yet efficient discussion with bjorn and I'm trying some code that *should* work for both version.

More when I see it working. :)

Thanks for all the tests, the patience, and your neverending good will :)
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby Bertram » 09 Jan 2013, 12:13

Ok, I've done something that looks like being working, with the kind advising of Thorbjorn Lindeijer:

I guess we'll go that way if nobody complains:



I know I'm starting to be demanding, but can you try this last one?

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby qubodup » 09 Jan 2013, 12:52

{l Code}: {l Select All Code}
rm CMakeCache.txt && make clean && wget -O tmp.patch http://forum.freegamedev.net/download/file.php?id=5164 && git reset --hard origin/master && git pull && git am tmp.patch && cmake . &> out.txt && make &>> out.txt && curlpaste out.txt

http://codepad.org/p0GvPkTT
Was I supposed to use the clean master or was I supposed to apply the patch over 0001-Adapted-the-game-engine-to-lua-5.2-a-blind-try.patch.txt (I did the first)?
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Linux user having trouble compiling

Postby Bertram » 09 Jan 2013, 13:13

Nope you did fine :)

Each patch is supposed to replace the previous one.

Btw, it actually pass the compilation test, only two forgotten changes left.

I'm on it.

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby Bertram » 09 Jan 2013, 13:39

Hi again,

Here is a new patch to be applied alone on master:


Thanks a lot! :)
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby Bertram » 09 Jan 2013, 14:37

Hi again,

A small change in the global script will be needed to redeclare setfenv but so far, I was able to run the game on lua5.2.

I'll test those changes on lua 5.1 and make a newer patch.
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby Bertram » 09 Jan 2013, 15:35

Me again,

I switched myself fully to lua5.2, thus, that should be final patch, to be applied alon on top of master:
0001-Ported-the-engine-to-lua5.2.patch.txt
(11.57 KiB) Downloaded 232 times


Thanks in advance for the tests!!

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby Ablu » 09 Jan 2013, 16:40

If it helps. here is manaservs patch for it: https://github.com/mana/manaserv/commit ... de5b0d899f
Ablu
 
Posts: 1
Joined: 07 Jan 2013, 20:12

Re: Linux user having trouble compiling

Postby qubodup » 09 Jan 2013, 22:17

Bertram {l Wrote}:
0001-Ported-the-engine-to-lua5.2.patch.txt

http://codepad.org/KHXOUH3X
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Linux user having trouble compiling

Postby Bertram » 09 Jan 2013, 23:35

Hi qubodup,

By looking at your compile log, only the linking part is wrong. To me, it tries to link using lua5.1 or something.

Could you make sure you both remove the CMakeCache.txt file and the CMakeFiles/ folder as well?

Then, a 'cmake .' shoudl do it. thanks!

Because I see it compiling fine at least, I'll push that one that I also tested locally against both lua version. :)

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby qubodup » 10 Jan 2013, 00:24

I added rm CMakeFiles/ -r to the command list.

cmake . finds lua5.1 indeed...
-- Found Lua51: /usr/lib/liblua5.1.so;/usr/lib/libm.so I guess it first checks for that version or it couldn't find 5.2?

Install locations again: http://codepad.org/vSMr4qOq

cmake . and make -j 1 output: http://codepad.org/YePsSHpv

I hope it's OK that I just paste results and don't think. :)
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Linux user having trouble compiling

Postby Bertram » 10 Jan 2013, 07:55

eh eh, np ;)

To me it's compiling using the 5.2 headers and try to link using the 5.1 library, so you should uninstall the 5.1 lib maybe and try again?
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby IkarusDowned » 11 Jan 2013, 14:07

qubodup where have you installed lua 5.2 to? You may need to alter your LD_LIBRARY path to put the lua 5.2 in front of 5.1 location
IkarusDowned
 
Posts: 37
Joined: 12 Nov 2012, 06:01

Re: Linux user having trouble compiling

Postby Bertram » 11 Jan 2013, 23:01

Ah, right!

You can also specify the library to link against, something like:
{l Code}: {l Select All Code}
cmake -DLUA_LIBRARIES=/usr/lib/liblua5.2.so -DLUA_INCLUDE_DIR=/usr/include/lua5.2/ .


Thanks to Ikarus for the reminder.

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby qubodup » 12 Jan 2013, 03:13

Sorry for not getting back earlier.
Bertram {l Wrote}:
{l Code}: {l Select All Code}
cmake -DLUA_LIBRARIES=/usr/lib/liblua5.2.so -DLUA_INCLUDE_DIR=/usr/include/lua5.2/ .

Thanks, that helped.

{l Code}: {l Select All Code}
cmake -DLUA_LIBRARIES=/usr/lib/liblua.so .


(install locations still http://codepad.org/vSMr4qOq )

By the way: I noticed that save game 1 and 2 show up as empty but I'm able to load them, which just makes the main menu appear as if I started the game again. I do have saved_game_[12].lua in my ~/.valyriatear/ dir.
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Linux user having trouble compiling

Postby IkarusDowned » 12 Jan 2013, 09:15

qubodup {l Wrote}:
By the way: I noticed that save game 1 and 2 show up as empty but I'm able to load them, which just makes the main menu appear as if I started the game again. I do have saved_game_[12].lua in my ~/.valyriatear/ dir.


This may have to do with the new quest log and features that aren't in your current save game.
If you have the time, can you restart a new game, get to the first save and save it. see if the same problem happens again?
IkarusDowned
 
Posts: 37
Joined: 12 Nov 2012, 06:01

Re: Linux user having trouble compiling

Postby Bertram » 12 Jan 2013, 19:09

Hi qubodup,

Nice to see it's compiling. :)

Ikarus must be right about that one. We might have introduced something with that change.

Also note that for historical reason the save games 1 and 2 are corresponding to the slot 2 and 3, just in case.

Speaking of save games, I'll go digging into that system for simplification purpose rather soon. If we can find any problem while I'm on it, that could be perfect :)
Could you upload them here for testing purpose? I may even fix them for you if you want so that you don't lose your progress.

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Linux user having trouble compiling

Postby qubodup » 13 Jan 2013, 15:12

I'm not worried about my savegame. Just about error handling/usability. Broken savegames 1. Appear as if there is no save game but 2. interact as if there is a savegame but 3. interact not like a working savegame should (they restart the menu, rather than loading a game.
http://codepad.org/twYyVlPC
http://codepad.org/r84PU3Vv

By the way: I have trouble loading savegames in another Lua-using game
[string "/home/andy/.boswars/save/game.sav.gz"]:16925: function or expression too complex near ','

https://savannah.nongnu.org/bugs/?35623

Just mentioning, in case VT creates savegame files in a similar file (there are some examples attached in the report). This might be useful if somebody reports issues loading data-heavy (much progress?) savegames in the future.

Speaking of save games, I'll go digging into that system for simplification purpose rather soon.

Do you mean the save/load interface or the save/load code or the savegame file format?
User avatar
qubodup
Global Moderator
 
Posts: 1671
Joined: 08 Nov 2009, 22:52
Location: Berlin, Germany

Re: Linux user having trouble compiling

Postby IkarusDowned » 13 Jan 2013, 16:46

they restart the menu, rather than loading a game.


when this happens, check the stderr.txt output and see what the error message is. if you can send that message to us as well, that would be helpful
IkarusDowned
 
Posts: 37
Joined: 12 Nov 2012, 06:01

Who is online

Users browsing this forum: No registered users and 1 guest