Difference between revisions of "Compile In Linux"

From FreeOrionWiki
Jump to: navigation, search
(Moving Linux Compile to separate page.)
 
(Redirected page to Compile)
 
(366 intermediate revisions by 18 users not shown)
Line 1: Line 1:
Each linux distribution will come with varying components already installed, although some libraries may be older than the version required by FreeOrion.  Hopefully the notes below will help to identify what is required for your particular distribution.
+
#REDIRECT [[Compile]]
 
+
 
+
==Compiler==
+
 
+
GCC 4.x is required.  See [http://freeorion.org/forum/viewtopic.php?p=25508#25508 this forum thread].
+
 
+
 
+
==Platform specifics==
+
===Ubuntu===
+
To build gigi or FreeOrion you first need to install the following packages using Synaptic (you will need to have the [https://help.ubuntu.com/community/Repositories/Ubuntu#head-5bbef89639d9a7d93fe38f6356dc17847d373096 '''Universe''' repository included]):
+
*python (should already be installed)
+
*scons
+
*libfreetype6 and libfreetype6-dev
+
*bcp
+
*libdevil1c2 and libdevil-dev
+
*libsdl1.2debian (should already be installed), libsdl1.2-dev
+
*graphviz and graphviz-dev
+
 
+
You can install all of these (including dependencies) from the command line using this:
+
 
+
sudo apt-get install python scons libfreetype6-dev bcp libdevil-dev libsdl1.2-dev libsdl-mixer1.2-dev graphviz-dev libalut-dev liblog4cpp5-dev
+
 
+
====Ubuntu (FeistyFawn and EdgyEft)====
+
The log4cpp libs are still missing, so lets install them:
+
 
+
sudo apt-get install liblog4cpp4 liblog4cpp4-dev
+
 
+
====Ubuntu (DapperDrake and before)====
+
Your Ubuntu '''log4cpp''' package is too old so you will need to download the required version from the Debian archive ([http://packages.debian.org/unstable/libs/liblog4cpp4 liblog4cpp4] and [http://packages.debian.org/unstable/libdevel/liblog4cpp4-dev liblog4cpp4-dev]) then install them:
+
 
+
sudo dpkg --install liblog4cpp4_0.3.5-rc3-1_i386.deb
+
sudo dpkg --install liblog4cpp4-dev_0.3.5-rc3-1_i386.deb
+
 
+
 
+
 
+
==GiGi==
+
Before attempting to build FreeOrion you will first need to build and install the GiGi library. 
+
 
+
The GiGi source should be automatically downloaded from SVN along with the FreeOrion source code.  If not, it can be manually downloaded:
+
svn co https://gigi.svn.sourceforge.net/svnroot/gigi/trunk gigi
+
 
+
Change into the GiGi directory and build the library:
+
cd freeorion/FreeOrion/GG
+
scons
+
sudo scons install
+
Since improvements and changes will be made to GiGi periodically, you should keep it up to date with:
+
cd freeorion/FreeOrion/GG
+
svn update
+
scons
+
sudo scons install
+
 
+
 
+
==FreeOrion==
+
After GiGi is compiled and installed, compile FreeOrion:
+
cd freeorion/FreeOrion
+
scons
+
When improvements have been made to FreeOrion, you should build the new version:
+
cd freeorion/FreeOrion
+
svn update
+
scons
+
 
+
 
+
==Clean After Dependency Changes==
+
It has been [http://freeorion.org/forum/viewtopic.php?p=27484#p27484 reported] that on Gentoo, it may be necessary to clean your old build before rebuilding GiGi or FreeOrion after updates that make changes to dependencies or versions of dependencies used, such as Boost.  To do this:
+
 
+
scons --clean
+
 
+
 
+
==User stories==
+
*[[User:EoD/Ubuntu GutsyGibbon|Ubuntu 7.10 Gutsy Gibbon]] (September 10, 2007)
+
*[[User:Greywolf|Ubuntu 6.10 Edgy Eft]] (February 26, 2007)
+
*[[User:mvor/Ubuntu|Ubuntu 5.04 Hoary Hedgehog]] (December 26, 2006)
+
*[[User:Solrac776/Gentoo|Gentoo]] (August 27, 2007)
+
*[[User:harm/Debian|Debian]] (August 29, 2007)
+
*[[User:mattg/Fedora|Fedora]] (June 5, 2006)
+
 
+
 
+
==Compilation Errors==
+
===Bogus build errors===
+
You may see errors during the build process like this:
+
 
+
'''Checking for fmod >= 3.75... no'''
+
Checking fmod version >= 3.75... yes
+
Checking for C header file fmod.h... yes
+
Checking for FSOUND_GetVersion() in C library fmod-3.75... yes
+
'''Checking for graphviz >= 0.15.0... no'''
+
'''Checking for libdotneato >= 0.15.0... no'''
+
Checking for C header file graphviz/render.h... yes
+
Checking for begin_component() in C library dotgen... yes
+
 
+
These failed messages refer to scons not finding an installed package for these components. The subsequent successful checks show that despite there being no pkg-config ".pc" file, the required header and library files were successfully located.
+
 
+
===SCons Can't Find Libraries/Dependencies===
+
If SCons is not able to find a library (e.g. Boost, GiGi, etc) that is installed, you need to be certain SCons is looking in the right directories.  Your distribution may install the library in an unexpected location, or you may have manually installed the library in a non-standard directory (e.g. /home/user/freeorion/Boost).  You will need to configure scons to look in these additional directories.  The command:
+
 
+
scons -h
+
 
+
lists the command-line options for SCons, including how to configure dependency directories.  The command (add or remove options to match your needs):
+
 
+
scons configure prefix=/usr/local/freeorion with_boost_include=/usr/local/include/boost with_ogre_include=/usr/include/OGRE
+
 
+
will store these options permanently in the file ''options.cache''.  Run configure again, or edit ''options.cache'', to change the settings.
+
 
+
 
+
==Runtime Errors==
+
===Segmentation Fault===
+
If after compiling everything, you run freeorion and get a segmentation fault:
+
 
+
$ ./freeorion
+
Segmentation fault
+
 
+
You might be mixing dependencies compiled with different versions of GCC.  See [http://freeorion.org/forum/viewtopic.php?p=22324#22324 this forum post], [http://freeorion.org/forum/viewtopic.php?p=22481#22481 this other forum post], [http://www.freeorion.org/forum/viewtopic.php?p=22513#22513 this third post] and [[User:Harm/Debian#The_not-so-easy_to_downright_nightmarish|this section]] of [[User:harm/Debian|Harm's Debian User Story]].
+

Latest revision as of 14:40, 22 April 2020

Redirect to: