Compiling Under FreeBSD

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Compiling Under FreeBSD

Post by segfault »

Running FreeBSD 8.0 and encountering expat issues when trying to ./configure. It's telling me it does not exist but I can see it sitting in /usr/local/lib as it should be.
Anyone had this problem before?

Any help would be appreciated.
Thanks, and keep up the great work!
You do not have the required permissions to view the files attached to this post.
Last edited by segfault on Fri Sep 03, 2010 7:28 pm, edited 1 time in total.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

Are you sure you have the development versions?

It not only needs the library itself, it needs the header files to be able to build against it.

(that's true for every dependency)
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

Thanks for the quick reply, didn't get a chanceto get to m y computer until now though.
Hmm, ran a find on / and (among others) found the following:

Code: Select all

....
/usr/local/include/expat.h
/usr/local/include/expat_external.h
/usr/local/include/python2.6/pyexpat.h
/usr/local/include/libxul/unstable/expat.h
/usr/local/include/libxul/unstable/expat_config.h
/usr/local/include/libxul/unstable/expat_external.h
/usr/local/lib/libexpat.a
/usr/local/lib/libexpat.la
/usr/local/lib/libexpat.so
/usr/local/lib/libexpat.so.6
...
Is there something specific I should be looking for other than these?
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

Perhaps it doesn't like it sitting in /usr/local.

Try telling it where to look (using the --with-expat-libs and --with-expat-inc with configure)
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

Excellent, yes i found that configure option and used it successfully. But not it's complaining similarly about my Libpng (which as before certainly exists along with headers etc.). using the --with-png... switch does not seem to be helping this problem.
Will try messing with it some more tonight.
Does anyone around here develop for VS on FreeBSD by chance?
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

I only touched FreeBSD once and was left with a strange, weird tingling sensation.

As if... hey, it looks like linux, feels like it, but it's not in sooooo many places. It's confusing.

So no.

Edit: did you try cmake?

cmake uses pkg-config, which might have better luck on FreeBSD.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

lol sounds like your experience with FreeBSD wasn't all bad then. I can respect the Penguin. Used to love Slackware.
cmake, hmm how would I use that "instead"? Can that help me with my ./configure problems finding libpng?
Somewhat confused.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

cmake is a different build system, we're switching to it, and so we're maintaining the usual autoconf stuff plus cmake.

To use cmake, besides installing it ;) , you have to:

mkdir build (create a folder for all the temporary stuff)
cd build (go into it)
ccmake .. (bring up the interactive configuration inteface)
(configure it - follow the instructions onscreen)
make (build vegastrike)
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

Nice, seeing progress here. All good advice so far. Thanks!
I ran into a problem with missing "libdl".
Seems that FreeBSD doesn't need this lib as it makes libc do the dynamic linking work (according to this: http://forum.fastfrag.ro/index.php?topic=2867.0).

To remedy the libdl issue I did the following (works for FreeBSD_RELEASE_8.0):

Code: Select all

localhost# ln -s /lib/libc.so.7 /usr/local/lib/libdl.so.7
localhost# ln -s /usr/lib/libc.a /usr/local/lib/libdl.a
localhost# ln -s /usr/lib/libc.so /usr/local/lib/libdl.so
Alright, so now ccmake finishes successfully and I can generate the build files.
When I type "gmake" (Which us FreeBSD users need to do since the unix make is somewhat more picky it seems) I get the following:

Code: Select all

 gmake
[  0%] Building CXX object CMakeFiles/OPcollide.dir/src/cmd/collide2/Ice/IceAABB.o
In file included from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Stdafx.h:18,
                 from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Ice/Stdafx.h:1,
                 from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Ice/IceAABB.cpp:21:
/home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/opcodetypes.h:198: error: conflicting declaration 'typedef wchar_t wint_t'
/usr/include/wchar.h:94: error: 'wint_t' has a previous declaration as 'typedef __wint_t wint_t'
gmake[2]: *** [CMakeFiles/OPcollide.dir/src/cmd/collide2/Ice/IceAABB.o] Error 1
gmake[1]: *** [CMakeFiles/OPcollide.dir/all] Error 2
gmake: *** [all] Error 2
if I run "make" I get the following:

Code: Select all

 make
[  0%] Building CXX object CMakeFiles/OPcollide.dir/src/cmd/collide2/Ice/IceAABB.o
In file included from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Stdafx.h:18,
                 from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Ice/Stdafx.h:1,
                 from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Ice/IceAABB.cpp:21:
/home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/opcodetypes.h:198: error: conflicting declaration 'typedef wchar_t wint_t'
/usr/include/wchar.h:94: error: 'wint_t' has a previous declaration as 'typedef __wint_t wint_t'
*** Error code 1

Stop in /home/luke/src/VegaStrike/vegastrike/build.
*** Error code 1

Stop in /home/luke/src/VegaStrike/vegastrike/build.
*** Error code 1

Stop in /home/luke/src/VegaStrike/vegastrike/build.
This looks like a genuine code error no? Any ideas? Perhaps I should checkout the SVN again?
Hope all this hassle helps some other FreeBSD-VegaStrike shmoes someday.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

That seems like a problem in opcode (see opcode's page).

Our opcode has a few patches applied I think, but in general it's pretty much the one in that page.

It's not FreeBSD-friendly (in fact, it was merely ported to linux, since it's native to Windows). BUT, it's a purely mathematical library (just does a lot of numbers), so it should be rather portable.

It seems here it defined wint_t twice. It doesn't happen in any linux that I've heared of, so it must be FreeBSD-specific. Try wrapping the wint_t typedef around #ifndefs

Code: Select all

typedef wchar_t wint_t;
Becomes

Code: Select all

#ifndef wint_t
typedef wchar_t wint_t;
#endif
(you may have to repeat that with a few other typedefs)

If it works, please prepare a patch and post it :)
I'll be happy to commit it.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

Tried wrapping it with the #ifndef and still get this:

Code: Select all

make
[  0%] Building CXX object CMakeFiles/OPcollide.dir/src/cmd/collide2/Ice/IceAABB.o
In file included from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Stdafx.h:18,
                 from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Ice/Stdafx.h:1,
                 from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Ice/IceAABB.cpp:21:
/home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/opcodetypes.h:200: error: conflicting declaration 'typedef wchar_t wint_t'
/usr/include/wchar.h:94: error: 'wint_t' has a previous declaration as 'typedef __wint_t wint_t'
*** Error code 1

Stop in /home/luke/src/VegaStrike/vegastrike/build.
*** Error code 1

Stop in /home/luke/src/VegaStrike/vegastrike/build.
*** Error code 1

Stop in /home/luke/src/VegaStrike/vegastrike/build.
If I comment it out entirely it seems to make just fine, except I wasn't able to actually run VS afterwards (even made the symbolic links etc. but keep getting this:

Code: Select all

~/src/VegaStrike/data]$ ./vssetup
bash: ./vssetup: No such file or directory
when ls shows this:

Code: Select all

lrwxr-xr-x   1 luke  wheel      24 Aug 20 17:12 vegastrike -> ../vegastrike/vegastrike
-rw-r--r--   1 luke  wheel   55964 Aug 12 23:55 vegastrike.config
-rw-r--r--   1 luke  wheel  160838 Aug 12 23:55 vegastrike.ico
-rw-r--r--   1 luke  wheel  125997 Aug 12 23:55 vegastrike.xpm
-rw-r--r--   1 luke  wheel    3420 Aug 12 23:55 vsinstall.sh
-rw-r--r--   1 luke  wheel   72679 Aug 12 23:55 vslogo.xpm
lrwxr-xr-x   1 luke  wheel      21 Aug 20 17:12 vssetup -> ../vegastrike/vssetup
-rw-r--r--   1 luke  wheel   40018 Aug 12 23:55 weapon_list.xml
So close..... have I forgotten something silly?
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

1) Instead of commenting the line, wrap it in ifdefs too
2) you tried to run vssetup, but you linked vegastrike - the former is for configuration, while the latter is the game itself.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

This compiled successfully:

Code: Select all

#ifdef wint_t
#ifndef wint_t  
    typedef wchar_t wint_t;  
#endif  
#endif 
...and looking in the "build" directory (since I used cmake) I now see the vegastrike binary! YAY!
But no vssetup. Should that be alarming?
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

Patch created.
First patch and code contribution to open source ever!
I feel like a champ.

Let me know if there is anything missing (should have addded a comment perhaps?)

Thanks for all the patience and guidance Klauss.
You do not have the required permissions to view the files attached to this post.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

Ehm... you included all of svn's internals in that patch ;)

Instead of diff, you can use "svn diff", which will provide a nice and tidy patch with your local changes.

Anyway, I just committed something like the patch (I noticed while applying it that there was a suspicious-looking ifdef just prior wint_t's definition) - see if it builds now please.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

Sorry total noob ==============================>
Thanks for the tip. I still have much reading to do before trying to contribute :oops:
Alright so I rebuilt to receive the following make error

Code: Select all

Scanning dependencies of target OPcollide
[  0%] Building CXX object CMakeFiles/OPcollide.dir/src/cmd/collide2/Ice/IceAABB.o
In file included from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Stdafx.h:18,
                 from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Ice/Stdafx.h:1,
                 from /home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/Ice/IceAABB.cpp:21:
/home/luke/src/VegaStrike/vegastrike/src/cmd/collide2/opcodetypes.h:200: error: conflicting declaration 'typedef wchar_t wint_t'
/usr/include/wchar.h:94: error: 'wint_t' has a previous declaration as 'typedef __wint_t wint_t'
*** Error code 1

Stop in /home/luke/src/VegaStrike/vegastrike/build.
*** Error code 1

Stop in /home/luke/src/VegaStrike/vegastrike/build.
*** Error code 1
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

Can you attach your wchar.h?
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

as seen in FreeBSD 8.0-RELEASE-p2.
You do not have the required permissions to view the files attached to this post.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

Ok. Done.
;)
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

Configured and built without a hitch using cmake.
Nicely done Klauss, thanks for all the help.

Am having some problems running it with certain settings (No sound, crashes with extreme detail etc.) but these a likely due to my hardware and/or possibility of the SVN branch just not being stable at the moment.
All in all, it works!

Thanks again and keep up the great work.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

Hum... crashes with extreme detail?

Can we have a stacktrace?

(usually it's the other way around, it crashes with anything less than extreme detail)

PS: Extreme shader, on the other hand, isn't even implemented yet.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

Alright so as soon as I type ./vssetup I get these messages. Haven't looked into that really yet.

Code: Select all

Found data in /home/luke/src/VegaStrike/data
Gtk-Message: (for origin information, set GTK_DEBUG): failed to retrieve property `GtkOptionMenu::indicator-size' of type `GtkRequisition' from rc file value "0" of type `glong'
Gtk-Message: (for origin information, set GTK_DEBUG): failed to retrieve property `GtkOptionMenu::indicator-spacing' of type `GtkBorder' from rc file value "0" of type `glong'
But if I select the nicest "Extreme Shader" and "Extreme Detail" and run "./vegastrike" it will crash before the main menu can load. With a "gdb ./vegastrike" it locked up and forced me to kill the process from TTY and then switch back into X. When I come back into X I see the following output form the gdb:

Code: Select all

...
Creating template manager...
  Initializing renderer...
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...0 joysticks were found.

The names of the joysticks are:
[New Thread 2b67efc0 (LWP 100175)]
FactionXML:LoadXML factions.xml
Contents of star system:
<system name="Empty" background="backgrounds/black" nearstars="0" stars="0" starspread="0"  y="0" z="0" x="0">
</system>

using NV_CUBE_MAP
Min (0.000000, 0.000000, 0.000000) Max(0.000000, 0.000000, 0.000000) MinLumin 1.000000, MaxLumin 1.000000Read In Star Count 0 used: 2000
Min (0.000000, 0.000000, 0.000000) Max(0.000000, 0.000000, 0.000000) MinLumin 1.000000, MaxLumin 1.000000Read In Star Count 0 used: 38
Loading a starsystem
Loading Star System Special/Empty
FOUND MODIFICATION = player FOR PLAYER #0
CREATING A LOCAL SHIP : dumbfire
Hi helper play 0
HereInitializing optimizer
Compilation of technique fixed successful
terminate called after throwing an instance of 'Audio::FileOpenException'
  what():  Cannot open "techniques/default.technique"

Program received signal SIGABRT, Aborted.
[Switching to Thread 2b301140 (LWP 100128)]
0x296882fb in thr_kill () from /lib/libc.so.7
(gdb) Killed: 9
If I run VS with lower settings it will still crash on it's way it Serenety under SPEC while I'm fiddling with the chase cam.

Not sure if any of this is what you want.
Please advise.
I see it mentions "No debugging symbols found". I will try building with debug symbols maybe in the meantime.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

Do not use extreme shader, it's a placeholder. I shouldn't have committed it. Use "nicest shader" instead.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
segfault
Merchant
Merchant
Posts: 39
Joined: Tue Aug 17, 2010 3:50 am
Location: Ottawa, Canada

Re: FreeBSD and expat

Post by segfault »

Alright, down graded to Average shader and recieved another after launch about 30seconds in:

Code: Select all

...
Python launched mechanist_citizen Ox FG Berliners with 1 ships
Adding news
conditioning
nonzeroing
finding nonloaded quest
quest_tutorial
finding quest
quest_tutorial
nonpfact
dot 0.203897dot 0.998277Processing News
Compiling python module bases/launch_music.py
Floating point exception: 8 (core dumped)
Still can't seem to get sound working.
NOTE: When I played the port (binary package) for 5.0 everything works quite nicely.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: FreeBSD and expat

Post by klauss »

Floating point exceptions cause a core dump in FreeBSD?

FTW?

I'm not sure we can correct that easily. Isn't there a way to tell the compiler or the OS to ignore them? (as is usually done)

BTW: FPE 8 means overflow according to my googling around. Try running VS through gdb and see where it blows, but I wouldn't hope for an easy fix.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
Post Reply