Author Topic: FS2_Open Linux Mini Howto  (Read 67958 times)

0 Members and 1 Guest are viewing this topic.

Offline Amon_Re

  • 28
    • http://www.kefren.be
Quote
Originally posted by HellToupee


no thats not suitable, not all linux distrobutions use rpm.


True, but i can't make debian packages or gentoo packages...
I could offcourse always drop the executable in a tarball of people with other distributions, but then you wouldn't get any dependancy checks

Cheers
Sig? What sig?

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
Quote
Originally posted by Kamikaze
Why would you need an installer? Just provide rpms, debs and tgzs.

By the way, has anyone gotten static compiling with FSO working? I tried to do it, but it's not working too well.


tgz i can do, debs i haven't got the foggiest idea about :)
The reason why i'm intrested about the installer is that not everyone has a windows install of FS2.

I don't even have windows anymore.

Cheers
Sig? What sig?

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
Well, i just compiled bKtHeG's latest tree, and i got some notes:

1: I needed to compile & install Mesa 6
2: It doesn't compile with gcc 3.x, but it compiles with 2.96
3: Got a seg fault, i'll try & see why (i'm guessing right now it's something minor, it complained about a read error in hash)

Cheers
Sig? What sig?

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
There was a whole bunch of debug output here, but after some tracking it looks like a Mesa 6 issue, nothing to see here, move along... :)

Cheers
« Last Edit: February 16, 2004, 03:32:54 pm by 1139 »
Sig? What sig?

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Amon_Re:

Using gcc 3.3.2 here, what's the error?  I was under the impression that all of the gcc 3.x problems were dealt with already.  As far as Mesa6, I'm using the NVIDIA gl.h, etc. so if it's a header issue I don't see it.  I assume the segfault is gone now as well so I'll leave that alone.  If not then post a backtrace from gdb.

As far as packaging issues, that's one reason why I like loki_setup.  It creates a self-extracting tarball that runs a staticly linked GTK based GUI installer and doesn't ever touch the packaging system.  The basic libraries like OpenAL and SDL can be included, just use a shell script to set LD_LIBRARY_PATH to look in the game directory first for the libs.  This handles the dependency issues for everything but OpenGL and glibc versions which shouldn't be an issue for most people.  loki_uninstall can be used to remove the installed files since everything is registered in a product xml file.

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
Quote
Originally posted by taylor
Amon_Re:

Using gcc 3.3.2 here, what's the error?


Mainly linker issue's, went away with using gcc2.96, but i'm suspecting my compiler is wacked, so i'll check that out first.

Quote
I was under the impression that all of the gcc 3.x problems were dealt with already.  As far as Mesa6, I'm using the NVIDIA gl.h, etc. so if it's a header issue I don't see it.  I assume the segfault is gone now as well so I'll leave that alone.  If not then post a backtrace from gdb.


I'll see what happens later, but the reason why i updated Mesa was exactly a header issue, iirc glGenBuffersARB wasn't known to my system with the Mesa 5.01 libs & headers.
I don't know if installing the nvidea headerfiles will work, as i use a lowly ATI Rage Fury Pro.

Quote
As far as packaging issues, that's one reason why I like loki_setup.  It creates a self-extracting tarball that runs a staticly linked GTK based GUI installer and doesn't ever touch the packaging system.  The basic libraries like OpenAL and SDL can be included, just use a shell script to set LD_LIBRARY_PATH to look in the game directory first for the libs.  This handles the dependency issues for everything but OpenGL and glibc versions which shouldn't be an issue for most people.  loki_uninstall can be used to remove the installed files since everything is registered in a product xml file.


I'll be looking into loki_setup, but some people also like to use the packaging system, anyway, once the whole thing compiles & runs properly it's just a matter of setting everything up (including loki) and use scripts to generate the tarballs, rpm's & loki_setup if need be.

One of the errors i do remember seeing when running the executable that i compiled was in hash.c, but fs2_open doesn't contain a hash.c, the only sources on my hd that do contain this file are linuxppc kernel & mesa, i kinda suck at debugging with gdb (or any debugger actually, definatly need to read up on that :))

I'll keep you posted

Cheers
Sig? What sig?

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
Ok, i recompiled just about every library i can think off, reïnstalled the header files and doublechecked my compiler, it's compiling with gcc 3 again, but alas, no banana.

This is the output i get before the seg fault:

DEBUG: os_config_read_string at osapi/osregistry_unix.cpp, line 423, thread 4129 - section: (null) char: VideocardFs2open default: (null)
DEBUG: os_config_read_string at osapi/osregistry_unix.cpp, line 423, thread 4129 - section: (null) char: Videocard default: (null)
DEBUG: os_config_read_string at osapi/osregistry_unix.cpp, line 423, thread 4129 - section: (null) char: VideoApi default: (null)
DEBUG: os_config_read_string at osapi/osregistry_unix.cpp, line 423, thread 4129 - section: (null) char: Language default: English
DEBUG: os_config_read_string at osapi/osregistry_unix.cpp, line 423, thread 4129 - section: (null) char: Soundcard default: (null)
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
[hash.c:395] failed read
STUB: Constructor at sound/audiostr.cpp, line 420, thread 4129
STUB: Initialize at sound/audiostr.cpp, line 440, thread 4129
DEBUG: os_config_read_string at osapi/osregistry_unix.cpp, line 423, thread 4129 - section: (null) char: VideocardFs2open default: (null)
STUB: gr_detect_cpu at graphics/2d.cpp, line 935, thread 4129
DEBUG: os_config_read_string at osapi/osregistry_unix.cpp, line 423, thread 4129 - section: (null) char: Gamma default: 1.80
STUB: game_init at freespace2/freespace.cpp, line 2835, thread 4129

Like i said i have no experiance with running debuggers (i'm an old skool amiga user, debugging on that machine was running it & seeing if the bloody thing rebooted or not ;)) so if you could gimme a small explication of what you want me to do, i'll get right on it.

Anyways, if you ask my unfounded, unverified & intuitionbased opinion, i'd say it's related to mesa 6.0.

Cheers
Sig? What sig?

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Quote
Like i said i have no experiance with running debuggers (i'm an old skool amiga user, debugging on that machine was running it & seeing if the bloody thing rebooted or not ) so if you could gimme a small explication of what you want me to do, i'll get right on it.


It's not that difficult really.  Just open a terminal window and run the fs2 binary with gdb "gdb ./fs2" which with load it up and give you a "(gdb)" prompt.  Type "r" and press enter to run FS2, and you can put any command line options you want like this "r -window".  It's a good idea to always run the app in a window since you'll need to get back to the gdb window at some point.  When it segfaults you'll be put back at the (gdb) prompt and then you type "bt" and press enter to get the backtrace.  It will then spit out all of the info, which could be a lot or a little, that's needed.  At this point you can just do "k", or "kill", to terminate the still running fs2 process and then "q" to exit gdb.

gdb does a lot more than that obviously but that's the basic stuff and usually all that's needed.

 

Offline tigital

  • 23
...sorry I haven't gotten the OSX/ppc stuff into icculus's cvs yet, but like taylor, I've been extremely busy with other stuff (including a massive hard drive crash that I'm just now fully recovering from)...

...I finally got cvs access to icculus, and also just met ryan, the man himself, a coupla weeks ago at the apple games summit!

...so hold tight, and I'll try to get it done in the next week...

 

Offline Setekh

  • Jar of Clay
  • 215
    • Hard Light Productions
Cool, great to hear you guys are still active at this. :)
- Eddie Kent Woo, Setekh, Steak (of Steaks), AWACS. Seriously, just pick one.
HARD LIGHT PRODUCTIONS, now V3.0. Bringing Modders Together since January 2001.
THE HARD LIGHT ARRAY. Always makes you say wow.

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
Taylor, here's the (short) backtrace i get when running fs2:

Program received signal SIG32, Real-time event 32.
0x40414714 in pthread_getconcurrency () from /lib/i686/libpthread.so.0
(gdb) bt
#0  0x40414714 in pthread_getconcurrency () from /lib/i686/libpthread.so.0
#1  0x404142b8 in pthread_getconcurrency () from /lib/i686/libpthread.so.0
#2  0x40413a61 in pthread_create () from /lib/i686/libpthread.so.0
(gdb)

I know libpthread is a systemlibrary so i'll see if that one can be updated.

Cheers
Sig? What sig?

 
Anyone currently a little behind schedule : Eh, that's okay with me, I'm pretty used to waiting.  Almost too used to it, actually.  I have to stop waiting on myself for school work :P

tigital : Ach, your HD blew?  Hope you didn't loose anything vital/had it backed up recently..  

taylor : You aren't going to loose your HD soon, too, are you? :P
Anyway, I applied the patch to the Bk build, and I still got errors about the ASM bits.  Are they really needed?  
Code: [Select]
// -- code/graphics/aaline.cpp --
// Multiply a fixed-point number by a s11.20 fixed-point
// number.  The actual multiply uses less bits for the
// multiplier, since it always represents a fraction
// less than 1.0 and less total bits are sufficient.
// Some of the steps here are not needed.  This was originally
// written to simulate exact hardware behavior.
//#if defined _WIN32
long int fix_xy_mult(long int oa, fix_xy ob)
{
        int retval;

#if defined _MSC_VER
        _asm {
                mov     edx, oa
                mov     eax, ob
                imul    edx
                shrd    eax,edx,20
                mov     retval, eax
        }
#elif defined __GNUC__
        asm(
            "mov   %1,%%edx;"
            "mov   %2,%%eax;"
            "imul  %%edx;"
            "shrd  $20,%%eax,%%edx;"
            "mov   %%eax,%0"
            : "=g" (retval)        // outputs
            : "g" (oa), "g" (ob)   // inputs
            : "eax", "edx"         // clobbered registers
            );
#else
#error unknown compiler
#endif
        return retval;
}

I looked at the icculus build, and here's what it looked like...
Code: [Select]
// -- src/graphics/aaline.cpp --
// Same comments here....
// ...
long int fix_xy_mult(long int oa, fix_xy ob)
{
#ifdef PLAT_UNIX
        STUB_FUNCTION;    // It's a stub function, here... <_
        return 0;      
#else
        int retval;
       
        _asm {
                mov     edx, oa
                mov     eax, ob
                imul    edx
                shrd    eax,edx,20
                mov     retval, eax
        }
       
        return retval;
#endif
}


And I think I've tried both GCC 2.95.3 and 3.2.2.

Best of wishes to all you stressed coders out there ;)
~Atal
Mertakk monae ki ienikk du bellou zhello.
Kuek mertakk monae ienikk divakkou zhello.

What does it mean if the most fun you had all night was blowing up asteroids...?

"Its a Babylon Space 2 HercFury!" --mikhael on seeing my first fighter design.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Quote
taylor : You aren't going to loose your HD soon, too, are you? :P

Almost lost everything already.  I had a serious failure at the end of 2001 that almost made me lose the Freespace 1 port.  Spent three days running dd over parts of the drive, after replacing the drive ciruitry, looking for stuff to salvage.  I lost some stuff but got most of it back.  Now I've got smartd monitoring both drives on my main workstation, automatic network backups, and a exact model number spares of both drives for easy replacement.

I think that some times I just take things too far. ;)

Quote
Anyway, I applied the patch to the Bk build, and I still got errors about the ASM bits. Are they really needed?

Aaahh!  I knew that was going to be an issue but forgot about it for some reason.  I'll do a quick patch against what I've already sent you to get rid of the ASM issues.  You're obviously not going to benefit from those optimized sections but it's all going to work still.  The icculus.org port doesn't make use of any ASM code.

 

Offline Inquisitor

Ok, which one of you guys wants to merge this into the active SCP code base and help maintain it?
No signature.

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
Quote
Originally posted by Inquisitor
Ok, which one of you guys wants to merge this into the active SCP code base and help maintain it?


/me hides :eek:
Sig? What sig?

 

Offline Inquisitor

Seriously :) It needs merged in :)

I can help compile it now that i have a linux dev environment, but the merge is gonna require one of you guys :)
No signature.

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
The latest build compiles on your setup? And runs? :eek:
I still haven't figured out why it crashes here, libpthread is up to date, so is Mesa, problem is, ever since updating libpthread i can't do anything anymore, when i run it through gdb it halts after the seg fault, but alas, it first kills mouse & keyboard, wich means i can't reach my console :mad:

Oh well, i'll find the cause sooner or later, i'm stuborn :)

Cheers
Sig? What sig?

 
Well, the ASM errors are gone.  Thanks Taylor.

*ominous pause*

But now I'm getting the same OpenGL errors that Amon was getting.
*prints the list of errors here... or not.* :P
Anyway, I checked that I have the latestest Glext.h already (I'm pretty sure, also, that it was from the exact same build.. woo.).  I'm not sure about this part in the gropengl.cpp, though:
Code: [Select]
#ifdef _WIN32
static ogl_extension GL_Extensions[GL_NUM_EXTENSIONS]=
{
        {0, NULL, "glFogCoordfEXT", "GL_EXT_fog_coord",0},
        ....    // Taken out to shorten.  You know what's there, anyway.
};
#elif defined unix //somebody should check weather the "NULL" is required under windows or not
// Should that really be "unix"?  Is it defined by a Makefile or compiler arg or...?
static ogl_extension GL_Extensions[GL_NUM_EXTENSIONS]=
{
        {0, 0, "glFogCoordfEXT", "GL_EXT_fog_coord",0},
        ....
};
#endif

Then there's a bunch of defines under an #ifdef _WIN32...
Code: [Select]
#ifdef _WIN32
        #define GLEXT_CALL(x,i) if (GL_Extensions[i].enabled)\
                                                                ((x)GL_Extensions[i].func_pointer)

        #define glFogCoordfEXT GLEXT_CALL(PFNGLFOGCOORDFEXTPROC, GL_FOG_COORDF)
        ....
#endif


Just wondering if any of this should be different.  They aren't in the Icculus build, obviously.  There's like a 2500 line difference between the two, any other code aside... <. .>

~Atal
Mertakk monae ki ienikk du bellou zhello.
Kuek mertakk monae ienikk divakkou zhello.

What does it mean if the most fun you had all night was blowing up asteroids...?

"Its a Babylon Space 2 HercFury!" --mikhael on seeing my first fighter design.

 

Offline Amon_Re

  • 28
    • http://www.kefren.be
Well, i've been diagnosing my system further, and it seems that my system still uses Mesa 4, even though i have compiled & installed Mesa 6.

I tracked this down to DRI, however, when doing make linux-solo in Mesa 6 the compilation fails (missing directory in /drivers/dri).

@Atalhlla:
IIRC you were compiling in LinuxPPC right? What are your errors? Could you PM them to me? If it's Mesa that's missing, just goto http://www.mesa3d.org

Cheers
Sig? What sig?

 
Thanks, Amon, that solved the gropengl thing.  Anyway, now it dies on graphics/scaler.cpp
Code: [Select]
g++ -DPACKAGE_NAME=\"fs2_open\" -DPACKAGE_TARNAME=\"fs2_open\" -DPACKAGE_VERSION=\"3.5\" \
-DPACKAGE_STRING=\"fs2_open\ 3.5\" -DPACKAGE_BUGREPORT=\"\" -DNO_CD_CHECK=1 -DNO_NETWORK=1 -DNO_STANDALONE=1 \
-DMORE_SPECIES=1 -DNO_SOFTWARE_RENDERING=1 -DNDEBUG=1  -I. -I.    -fexceptions -I/c/dx8/include -Wno-missing-braces -Wno-multichar \
-fsigned-char -DNO_DIRECT3D -DUSE_OPENGL -g -O2 -I/usr/include/SDL -D_REENTRANT -c -o scaler.o `test -f 'graphics/scaler.cpp' || echo \
'./'`graphics/scaler.cpp
graphics/scaler.cpp: In function `void gr8_scaler(vertex*, vertex*)':
graphics/scaler.cpp:963: `palette_blend' undeclared (first use this function)
graphics/scaler.cpp:963: (Each undeclared identifier is reported only once for
   each function it appears in.)
graphics/scaler.cpp: In function `void gr8_aascaler(vertex*, vertex*)':
graphics/scaler.cpp:1205: `struct alphacolor' has no member named `table'
graphics/scaler.cpp:1216: `struct alphacolor' has no member named `table'
make[1]: *** [scaler.o] Error 1
make[1]: Leaving directory `/home/atalhlla/freespace2-ppclinux-test/fs2_open/code'
make: *** [all-recursive] Error 1

I really don't know what to make of this one...

/me waits to see if anyone 'll pull out another magical (AKA what should have been obvious) fix out.

Amon : Just to check, did you replace all the Mesa/OGL things in /usr/lib (or /usr/local/lib if you have them there, instead) and in /usr/X11R6/lib ?

~Atal
Mertakk monae ki ienikk du bellou zhello.
Kuek mertakk monae ienikk divakkou zhello.

What does it mean if the most fun you had all night was blowing up asteroids...?

"Its a Babylon Space 2 HercFury!" --mikhael on seeing my first fighter design.