Problems compiling freeorion on FreeBSD

Problems and solutions for installing or running FreeOrion, including discussion of bugs if needed before posting a bug report on GitHub. For problems building from source, post in Compile.

Moderator: Oberlus

Message
Author
OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Problems compiling freeorion on FreeBSD

#1 Post by OlliL »

Hi,

I've problems compiling freeorion. I also filled a bug report at

https://sourceforge.net/tracker/index.p ... tid=544942

But someone told me on IRC I should probably better post at the forums so here I am ;)

I'm running FreeBSD 7 with gcc 4.2.1 and boost 1.37.0. The build log can be obtained here:

http://files.pofo.de/freeorion-0.3.12.20090408.log

It looks like a boost problem with universe/Universe.cpp
Last edited by OlliL on Tue Jan 03, 2012 7:13 am, edited 1 time in total.

OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Re: Problems compiling freeorion

#2 Post by OlliL »

To compile the latest freeorion on FreeBSD:

- use gcc 4.3
- use Ogre 1.6.x
- use latest gigi from svn
- use latest freeorion from svn
- use graphviz 2.22.x

- patch the Endianess detection because the one in boost has an error which was not yet fixed yet in the FreeBSD boost port. The following patch is FreeBSD specific and is temporary until boost is fixed upstream or in the FreeBSD ports collection only.

Code: Select all

--- util/Serialize.cpp.orig     2009-04-13 08:56:38.000000000 +0200
+++ util/Serialize.cpp  2009-04-13 08:56:56.000000000 +0200
@@ -65,7 +65,7 @@
 // some endianness and size checks to ensure portability of binary save files; of one or more of these fails, it means
 // that FreeOrion is not supported on your platform/compiler pair, and must be modified to provide data of the
 // appropriate size(s).
-#ifndef BOOST_LITTLE_ENDIAN
+#if (_BYTE_ORDER != _LITTLE_ENDIAN)
 #  error "Incompatible endianness for binary serialization."
 #endif
 BOOST_STATIC_ASSERT(sizeof(char) == 1);
- apply a patch to fix a gcc 4.3 error (should be FreeBSD only as well but could be used generally I guess)

Code: Select all

--- python/PythonEnumWrapper.cpp.orig   2009-04-09 08:40:02.000000000 +0200
+++ python/PythonEnumWrapper.cpp        2009-04-09 08:40:06.000000000 +0200
@@ -1,3 +1,4 @@
+#include <ostream>
 #include "../universe/Enums.h"

 #include <boost/python.hpp>
- to support the latest 2.22.x graphviz, I used the regexp because the graphviz guys changed a define:

Code: Select all

perl -pi -e 's/ND_coord_i/ND_coord/g' UI/TechTreeWnd.cpp
I'll commit the latest freeorion + gigi ports as well as ogre 1.6 containing all the needed fixes to the FreeBSD ports tree when the right now happening port freeze for the upcomming 7.2 FreeBSD release is over

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Problems compiling freeorion

#3 Post by Geoff the Medio »

OlliL wrote:I'll commit the latest freeorion + gigi ports as well as ogre 1.6 containing all the needed fixes to the FreeBSD ports tree when the right now happening port freeze for the upcomming 7.2 FreeBSD release is over
Sounds good; thanks. Can you post something now that FreeBSD users could download to get the latest FreeOrion, and/or post when a FreeBSD version is downloadable elsehwere, so we can make a more-prominent announcement about it?

OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Re: Problems compiling freeorion

#4 Post by OlliL »

I'm trying to start freeorion now for the first time :shock:

I'd to remove Plugin_CgProgramManager from ogre_plugins.cfg because it does not exist on FreeBSD. After this was done and I adjusted PluginFolder freeorion stops with:

olivleh1@kartoffel olivleh1> freeorion
main() caught exception(std::exception): basic_string::_S_construct NULL not valid
olivleh1@kartoffel olivleh1>

Reading ogre.log does not give that much information:

Code: Select all

11:32:45: Plugin successfully installed
11:32:45: *-*-* OGRE Initialising
11:32:45: *-*-* Version 1.6.2 (Shoggoth)
11:32:45: CPU Identifier & Features
11:32:45: -------------------------
11:32:45:  *   CPU ID: AuthenticAMD: AMD Athlon(tm) 64 Processor 3500+
11:32:45:  *      SSE: yes
11:32:45:  *     SSE2: yes
11:32:45:  *     SSE3: no
11:32:45:  *      MMX: yes
11:32:45:  *   MMXEXT: yes
11:32:45:  *    3DNOW: yes
11:32:45:  * 3DNOWEXT: yes
11:32:45:  *     CMOV: yes
11:32:45:  *      TSC: yes
11:32:45:  *      FPU: yes
11:32:45:  *      PRO: yes
11:32:45:  *       HT: no
11:32:45: -------------------------
11:32:45: ******************************
*** Starting GLX Subsystem ***
******************************
11:32:45: GLRenderSystem::_createRenderWindow "FreeOrion v0.3.12None", 1024x768 windowed  miscParams: FSAA=0 displayFrequency=60 MHz gamma= vsync=No
11:32:45: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource GLX_icon.png in resource group General or any other group. in ResourceGroupManag
11:32:45: GLXWindow::create used FBConfigID = 125
11:32:45: *-*-* OGRE Shutdown
I doubt that the missing icon is causing this... I would have checked this further but I have no idea where to put it - a trace shows not where it is searched for :(

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: Problems compiling freeorion

#5 Post by OndrejR »

Missing icons is normal thing. Also Impostor images. :shock:

FreeOrion since last compilation on FreeBSD gained UTF support. Some similar problem which I found on Internet:
http://www.velocityreviews.com/forums/t ... valid.html

Also I doubt that FreeOrion was also tested with Ogre 1.6.2. It was only with 1.6.1.

OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Re: Problems compiling freeorion

#6 Post by OlliL »

I'm using r2983 right now.
Is there a way to get a more verbose output? Maybe from ogre? To see what really causes the abort here? The Posting you've linked to is kinda old.... hmmm

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: Problems compiling freeorion

#7 Post by OndrejR »

It is strange that you don't have SSE3. But to the problem:
You have to debug FreeOrion: ogre, gg and FO have to be recompiled to enable debugging symbols. I would also try Ogre 1.6.1. UTF support was added to GG some months ago and it was never tested on FreeBSD and that may be problem. But without debugging it is hard to say where problem is. Also be certain that your graphic card supports OpenGL 2.x.

OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Re: Problems compiling freeorion

#8 Post by OlliL »

Ok I'll try that later.

After starting freeorion, for a short time, a black window pops up (or with -f the screen gets black) until the exception gets raised - but only for a very short time.
Regarding OpenGL - I guess my ATI does support 2.0 (HD3850) but I only have the radeonhd driver supplied by X.Org - no native binary AMD drivers....
So the performance will be kinda bad anyway but I just wana check it...

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: Problems compiling freeorion

#9 Post by OndrejR »

There is problem with ATI cards. Currently there are not know minimum requirements for FreeOrion. On NVidia 6600 above FO is running. But on ATI we don't know. Open source ATI drivers may not have all required extensions. But you are probably first on this forum with ATI HD series. It would be nice to test FO with binary drivers.

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: Problems compiling freeorion on FreeBSD 7

#10 Post by kroddn »

I read interesting things on this thread:

https://www.crystalspace3d.org/forum/in ... pic=1510.0

The "kernel per process data size limit" is an interesting point. I encountered simuilar problems on OpenSuSE systems in one project and had to increase such limits (ulimit on linux systems).

Maybe this limit is set on your system?

OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Re: Problems compiling freeorion on FreeBSD 7

#11 Post by OlliL »

I would say 32GB datsize should be enough:

olivleh1@kartoffel olivleh1> limit
cputime unlimited
filesize unlimited
datasize 33554432 kbytes
stacksize 524288 kbytes
coredumpsize unlimited
memoryuse unlimited
vmemoryuse unlimited
descriptors 11095
memorylocked unlimited
maxproc 5547
sbsize unlimited
olivleh1@kartoffel olivleh1>

User avatar
kroddn
Static Linker
Posts: 347
Joined: Thu Jun 28, 2007 10:28 am

Re: Problems compiling freeorion on FreeBSD 7

#12 Post by kroddn »

Then I would say that this problem is related to the fact that you use an ATI card. Another problem could be, that nvidias Cg is needed (on ATI systems too!) but not available for FreeBSD.

OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Re: Problems compiling freeorion on FreeBSD 7

#13 Post by OlliL »

Ok, now I got a freeorion+gigi with symbols but I'm not sure what to do here because the program exits normally. I must admit that I'm not that familiar with gdb...

Code: Select all

(gdb) file /usr/local/bin/freeorion
Reading symbols from /usr/local/bin/freeorion...done.
(gdb) run
Starting program: /usr/local/bin/freeorion /usr/local/bin/freeorion
[New LWP 100130]
[New Thread 0x8062020b0 (LWP 100130)]
main() caught exception(std::exception): basic_string::_S_construct NULL not valid

Program exited normally.
(gdb) bt
No stack.
(gdb) list
24      
25      #ifdef FREEORION_WIN32
26      #  define OGRE_INPUT_PLUGIN_NAME "GiGiOgrePlugin_OIS.dll"
27      #else
28      #  define OGRE_INPUT_PLUGIN_NAME "libGiGiOgrePlugin_OIS.so"
29      #endif
30      
31      int main(int argc, char* argv[])
32      {
33          InitDirs();
(gdb) 

OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Re: Problems compiling freeorion on FreeBSD 7

#14 Post by OlliL »

RenderWindow* window = root->initialise(true, "FreeOrion " + FreeOrionVersionString());
in FreeOrion/client/human/chmain.cpp is raising the exception

OlliL
Space Floater
Posts: 28
Joined: Wed Apr 08, 2009 6:04 pm

Re: Problems compiling freeorion on FreeBSD 7

#15 Post by OlliL »

Looks like somthing in my GL is broken...

GLSupport::initialiseExtensions

from ogre is the function where the whole process stops

void GLSupport::initialiseExtensions(void)
{

// Set version string
const GLubyte* pcVer = glGetString(GL_VERSION);
assert(pcVer && "Problems getting GL version string using glGetString");
String tmpStr = (const char*)pcVer;

the assignment to tmpStr is causing the exception. Looks like glGetString does not return anything...

Post Reply