Difference between revisions of "Compile"

From FreeOrionWiki
Jump to: navigation, search
m
Line 104: Line 104:
  
 
'''A. '''
 
'''A. '''
This bug should be fixed now. If you still experience freezes/crashes and are using the autotools (configure & make) system, please contact [[Yoghurt]].
+
This bug should be fixed now. If you still experience freezes/crashes and are using the autotools (configure & make) system, please contact [[User:Yoghurt Yoghurt]].
 
In the meantime, you can try to build [[FreeOrion]] with optimizations turned on:
 
In the meantime, you can try to build [[FreeOrion]] with optimizations turned on:
 
* make clean && make CXXFLAGS="-O3 -funroll-loops"
 
* make clean && make CXXFLAGS="-O3 -funroll-loops"

Revision as of 22:22, 22 June 2004

FreeOrion can currently be compiled under Windows and Linux.

Overview

First of all, you will need to obtain the source. This can be grabbed from our project page or from CVS. The version available on the project page usually corresponds to an official release, and so may be very out of date. If you are interested in helping program FreeOrion then you will need to grab the CVS copy. Then you need to set up the required software, compile the game, download the missing artwork, and run it.

Software requirements

To compile the latest version of FreeOrion you will need GiGi. Here are the version numbers for software dependencies:

Getting the source

CVS

CVS can be obtained in Linux using these commands:

cvs -d:pserver:[email protected]:/cvsroot/freeorion login (if it asks for password, just hit enter)

cvs -z3 -d:pserver:[email protected]:/cvsroot/freeorion co FreeOrion

Note: Sometimes, the SourceForge CVS-server is under heavy load. If the commands above fail with 'EOF from server', just wait a few minutes and try again.

Tarball: Please use the tarball only as a last resort. Do not download the tarball just because you are too lazy to install CVS! Snapshot of the CVS-Repository

Package

You can also download an older version of the software in a package from the project page. Remember that if you want to help develop, you will need to obtain a copy from CVS.

Compiling in Linux

Once you have the required software, in particular GiGi, installed, you need to compile FreeOrion. You have two options. The first is to run these commands:

  1. If you have the newest autotools-suite (autoconf 2.59, automake 1.7) installed , ./autogen.sh, otherwise use ./update-configure.sh
  2. ./configure
  3. make

If you have trouble with the game appearing to deadlock at places, try the following to build it:

  1. make clean && make CXXFLAGS="-O3 -funroll-loops"

Many people have trouble getting these to work (if you have problems with configure;make, please contact Yoghurt so he can iron out the bugs), so custom makefiles can be downloaded here. To get these working follow these steps:

  1. Extract the three Makefile's into their appropriate directories
  2. Edit each Makefile, changing any folder references to point to your directory structure
  3. Remove references to 'ccache' if you are not using it
  4. Go into server/ client/human/ and client/AI/ and run 'make' in each

After these steps, the files freeorion.exe, freeoriond.exe and freeorionca.exe should each be created in the root directory. Run ./freeorion.exe to play the game.

Windows specific

Software requirements

To compile the latest version of FreeOrion you will need the MSVC compiler (you can use the free one) and the GiGi GUI library. Here are the version numbers for software dependencies:

Those can be found in precompiled format:

  • SDL_mixer - you can use the Win32 binary (SDL_mixer-devel-1.2.5a-VC6.zip)
  • zlib - you can use zlib compiled DLL, version 1.2.1
  • DevIL - you can use DevIL 1.6.5 Windows SDK
  • SDL - there is a Development Library for Win32. I haven't tried them tho.

Those must be compiled from the source:

  • Boost - version 1.30 or later.
  • log4cpp - 0.3.4b. Later versions may work.
  • FreeType - 2.1.7. Later versions may work.
  • GiGi - latest from CVS

Boost is built from the command line with a custom jam util you get from the sourceforge project page.

log4cpp, is built from the Visual C++ IDE. Don't mind the test projects.

GiGi has a couple of dependencies (FreeType, SDL, boost, log4cpp and DevIL) so get them before attempting to compiled GiGi. The debug targets are not completely configured, but you only need the release target for FreeOrion.

Getting the source from CVS

A Windows port of CVS is available. The commands are the same on Linux and Windows. You can also use other CVS tools such as TortoiseCVS for checking out. Mind that they may not be suited for committal because they are said to be prone to converting new line characters.

Compiling in Windows

Once you have the required software, in particular GiGi, installed, you need to compile FreeOrion. These instruction use the Visual C++ IDE.

  1. Open msvc\FreeOrion\FreeOrion.sln
  2. You need to configure the Additional Include Directories (in Project->Properties->C/C++->General) and Additional Library Directories (in Project->Properties->Linker->General) to point to where you installed the required software for all the targets you want to build.
  3. As the configuration assumes the GG's CVS root is in the CVS root of FreeOrion, it may be a good idea to put it there.
  4. use Build->Batch build... to build the three projects' release targets. I didn't get the debug targets to compile.

If you didn't change the Output File (or the $(OutDir) variable), the files will be created in their respective project and target directories. Move them to the root directory and provide the required DLLs (copy them, move them or put them in your path environnement variable). Run freeorion.exe to play the game.

Obtaining Artwork

Some artwork may be missing from the game when you download it. You will probably need to obtain these images. If you are planning to contribute then we can provide you with a link to download the artwork. Contact Tyreth if you need it.

Troubles and Questions

Q. I get an undefined reference to `_vsnprintf'

A. This is a bug in the latest version of Devil. GiGi's configure script should've taken care of it. If it didn't, contact Yoghurt. In the meantime, you can fix the error yourself: Check the il_tiff.c file and add this line at the top:

#define _vsnprintf vsnprintf 

and then recompile [1]

Q. The game seems to freeze at certain places

A. This bug should be fixed now. If you still experience freezes/crashes and are using the autotools (configure & make) system, please contact User:Yoghurt Yoghurt. In the meantime, you can try to build FreeOrion with optimizations turned on:

  • make clean && make CXXFLAGS="-O3 -funroll-loops"

Q. The game crashes when I click on a star

A. Delete the file <FreeOrion Home Directory>/default/art/small/planets/planets.xml