Difference between revisions of "User:Solrac776/Gentoo"

From FreeOrionWiki
Jump to: navigation, search
(Boost and its many masks)
(What you've been waiting for: FreeOrion)
 
(25 intermediate revisions by 13 users not shown)
Line 1: Line 1:
=Pre-Reading Note=
+
=Compiling FreeOrion under Gentoo Linux ~x86 [2-Feb-2007]=
 +
* gcc-Version 4.1.1-r3
 +
* svn trunk revision 2002, GG revision 562
 +
I posted my experiences so that they could (hopefully) be of help to anyone else using Gentoo, I found these things out through trial-and-error and by hitting up the 'Net.
  
Currently this article details how to compile a pre-v0.3 CVS version of FreeOrion.  So it does not detail any extra steps or issues since then (though I would guess that everything still holds true, bar minor changes).  This section will be updated for the current version (v0.3 and bug-fix candidates) before the end of January 2006. 
+
==sdl log4cpp boost graphviz devil==
  
=Compiling FreeOrion under Gentoo Linux [7-May-2005]=
+
The gentoo ebuild for sdl is called libsdl and you need log4cpp, boost, graphviz and devil aswell,
 +
so the command becomes
 +
# emerge -av log4cpp libsdl boost graphviz devil
  
I posted my experiences so that they could (hopefully) be of help to anyone else using Gentoo, I will directly help anyone I can, but keep in mind that no matter how knowledge-able I might sound on this page, I'm no guru. I found these things out through trial-and-error and by hitting up the 'Net.
+
by me it looks like:
  
==Quickies: log4cpp sdl fmod & DevIL==
+
dev-libs/log4cpp-0.3.5_rc3  USE="threads -doc"
 +
 +
media-libs/libsdl-1.2.11-r1  USE="X aalib alsa libcaca nas opengl xinerama xv -arts -dga -directfb
 +
-esd -fbcon -ggi -noaudio -noflagstrip -nojoystick -novideo -oss -svga"
 +
 +
dev-libs/boost-1.33.1-r1  USE="threads -bcp -bjam -debug -doc -icu% -pyste -threadsonly"
 +
 +
media-gfx/graphviz-2.8-r2  USE="X cairo java lua perl python tcltk -guile -ocaml -php -ruby -static"
 +
 +
media-libs/devil-1.6.7-r1  USE="X gif jpeg mng opengl png sdl tiff -allegro -xpm"
  
These guys were easy.  Just do:
+
'''Note:''' the devil allegro use flag must be disabled!
emerge log4cpp sdl fmod
+
And Gentoo portage takes care of the rest.
+
  
[EDIT 24-JAN-2006 by Anset]
+
'''Note:''' At the time of this entry, GiGi depends on >=dev-lib/boost-1.35 which is masked testing in portage.
  
The gentoo ebuild for sdl is called libsdl and you need devil aswell, so the command becomes
+
  # ACCEPT_KEYWORDS="~x86" emerge --oneshot -av \>=dev-lib/boost-1.35
  emerge log4cpp libsdl fmod devil
+
Should get this problem solved quick and dirty.
Furthermore, the fmod ebuild is version 3.74. The FreeOrion download instruction say you need fmod 3.5.
+
Lets hope it is enough to have a 3.x version of fmod.
+
I am installing now. I'll append to this when I'm done.
+
  
[/EDIT]
+
# echo =dev-lib/boost-1.35.0-r1 ~x86 >> /etc/portage/packages.keywords
 +
# echo =dev-lib/boost-build-1.35.0-r1 ~x86 >> /etc/portage/packages.keywords
 +
# emerge -av boost
 +
Pulls no testing dependencies of boost in (except boost-build, which is needed no matter what.), as only boost accepts the testing keyword.
  
==Boost and its many masks==
+
For more information on masked packages refer to the emerge man pate, or the Gentoo Handbook.
[EDIT 16-MAR-2006 by ZveanturZ]
+
--[[User:V|V]] 02:45, 20 August 2008 (EDT)
  
It seems that actual GiGi SVN need Boost 1.33.1 If you try to scons GiGi SVN with boost 1.32.0 or 1.32.0-r1 you will have An error
+
==fmod & Scons==
localhost GG # scons
+
scons: Reading SConscript files ...
+
Configuring for POSIX system...
+
Checking for C++ header file boost/shared_ptr.hpp... yes
+
Checking Boost version >= 1.33.1... no
+
Boost configuration... failed
+
  
You just have to do now
+
You need also the fmod libary -> Version 3.75 or higher.
  
  emerge boost
+
  # emerge -av fmod
 +
 +
media-libs/fmod-3.75
  
[/EDIT]
+
and Scons to Compile Freeorion
  
[EDIT 24-JAN-2006 by Anset]
+
  # emerge -av scons
 
+
Boost 1.33 does not work with GiGi and there is no 1.32 ebuild available anymore. I was able to work around it as follows:
+
cd /usr/portage/dev-libs/boost
+
cp boost-1.33.0.ebuild boost-1.32.0.ebuild
+
ebuild boost-1.32.0.ebuild digest
+
echo =dev-libs/boost-1.32.0 ~x86 >> /etc/portage/package.keywords
+
  emerge =dev-libs/boost-1.32.0
+
I put a RFE on gentoo bugzilla to get the old ebuild back...
+
 
+
[/EDIT]
+
 
+
[3-DEC-2005] Boost 1.33 is marked stable now. So a simple "emerge boost" should do the trick
+
 
+
Boost is a bit more interesting.
+
 
+
FreeOrion needs at least v1.32, but my system would only install v1.31 because v1.32 is masked.  To get it you need to edit ''/etc/portage/package.keywords''
+
echo "dev-libs/boost ~x86" >> /etc/portage/package.keywords
+
I then had a look at [http://www.gentoo-portage.com/dev-libs/boost Gentoo Portage Boost] and guessed that v1.32-r1 would be the least problematic
+
cd /usr/portage/dev-libs/boost && emerge boost-1.32.0-r1.ebuild
+
 
+
==GraphViz==
+
 
+
[EDIT 24-JAN-2006 by Anset] GraphViz version 2.2 now has a ~x86 masked ebuild that you can install. I went with the 2.2.1-r1 ebuild.
+
 
+
As with Boost, Gentoo will install an older version than what FreeOrion requires.  I thought that the solution would be to do ''echo "media-gfx/graphviz ~x86" >> /etc/portage/package.keywords'' (just like with boost) and then I'd get v2.2 instead of v1.13.  But when compiling FO, it complained about not finding "-ldotneato".
+
 
+
So instead, I got GraphViz v2.2 directly from [http://www.graphviz.org/Download_source.php Graphviz CVS].
+
cvs -d :pserver:[email protected]:/home/cvsroot login
+
Password: anoncvs
+
cvs -d :pserver:[email protected]:/home/cvsroot co graphviz
+
Now compile & install
+
./autogen.sh && ./configure && ./make
+
(as root): make install
+
[/EDIT]
+
 
+
===Issues===
+
 
+
Manually installing GraphViz instead of emerging it, won't necessarily update your lib-path.  If this happens, then when you run FO it will complain about not finding "libdotneato.so.0".
+
Other distributions just need to do (in bash)''export LDPATH=$LDPATH:/usr/local/lib/graphviz''.  In Gentoo, you need to update ''/etc/env.d/'' and your env variables like this:
+
echo LDPATH=\"/usr/local/lib/graphviz\" >> /etc/env.d/99graphviz
+
env-update
+
...and in each open shell run:
+
source /etc/profile
+
 
+
'''Note'''This is assuming that the GraphViz libraries are at ''/usr/local/lib/graphviz''.
+
To check where they are on your system, run:
+
find / -name libdotneato.so.0
+
...and use that path instead.
+
 
+
==Compiling [[GiGi]] from CVS==
+
 
+
Follow the easy instructions in [[GiGi]] on getting GiGi from CVS.
+
 
+
Then:
+
./autogen.sh && ./configure && ./make
+
(as root): make install
+
 
+
[EDIT 24-Jan-2006 by Anset] things have changed. Now, in the GG directory do:
+
  scons
+
  (as root): scons install
+
[/EDIT]
+
 
+
===Issues===
+
 
+
After ''./configure'', the script complained about my having DevIL linked with Allegro.  I guess Allegro doesn't play nice with others.  The script suggests: "If you want to be able to use GiGi in Allegro-programs, run configure with the '--disable-allegro-hack' option."
+
 
+
Since I don't, and I don't remember what Allegro was for, I did:
+
emerge unmerge allegro && emerge devil
+
Then compile GiGi that you got from CVS:
+
./autogen.sh && ./configure && ./make
+
(as root): make install
+
 
+
If some packages become unstable, then I'll know that it's my fault and to emerge allegro again.
+
 
+
====GiGi & Allegro (Quoting [Yoghurt])====
+
 
+
'''In short:''' If you don't use Allegro and GiGi in the same program, this is a non-issue.
+
 
+
"The issue is that Allegro has a macro that redefines main so that int main() will automatically call InitAllegro (and you can use main instead of WinMain on windows-programs).
+
 
+
And for some internal reasons, Allegro must know where the REAL main starts (or something like that), and therefore Allegro defines a Macro END_OF_MAIN that has to be used, that defines a symbol that is called __address_of_main (or something like that).
+
 
+
Now, if you use SDL and DevIL, and DevIL was compiled with allegro-support, this strange symbol has to be there, or you will get an undeclared symbol error while linking. GiGi's configure therefore defines this symbol to 0xdeadbeef, to get rid of the warning. However, Programs that will use GiGi and Allegro will now probably crash, because the symbol is wrong. Hence the warning."
+
  
 
==What you've been waiting for: FreeOrion==
 
==What you've been waiting for: FreeOrion==
  
Get FreeOrion via [[CVS]] (also see the below comment about data files).  Then we do as the [[Compile]] page says for Linux:
+
Get FreeOrion via [[Subversion]].
  ./autogen.sh
+
  $ svn co https://freeorion.svn.sourceforge.net/svnroot/freeorion/trunk freeorion
  ./configure
+
Then we do as the [[Compile]] page says for Linux:
  make
+
  $ cd freeorion
 
+
  $ cd FreeOrion
[EDIT 24-01-2006 by Anset]Eh, no. This has changed also. In the FreeOrion directory, just do:
+
  $ cd GG
  scons
+
  $ scons
[/EDIT]
+
  # scons install
 
+
  $ cd ..
To play (-f is for full-screen):
+
  $ scons -j2
  ./freeorion -f
+
 
+
===Data Files===
+
 
+
If FreeOrion crashes before you even see the start-up splash screen and includes something about "default/data/..." then you need to install the artwork as well. Usually not included in CVS, but you can get it [http://freeorion.org/index.php/Compile#Obtaining_Artwork here].   
+
 
+
Download the zipped data-files, then extract them into your FreeOrion/default directory.  You should now see a directory named "data" in default. 
+
 
+
That's the fix.  Run ''./freeorion'' again and you should be sorted.
+
  
===CCache===
+
To play:
 +
./freeorion [-f for full-screen (doesn't seem to work, but you can set it in the options menu)]
  
If you compile FreeOrion often, using ccache helps to decrease the compile times. ([http://www.freeorion.org/forum/viewtopic.php?t=298&highlight=ccache ccache rocks])
+
:This is a [http://sourceforge.net/tracker/index.php?func=detail&aid=1635626&group_id=75752&atid=544942 reported bug] [[User:Geoff the Medio|Geoff the Medio]] 06:55, 2 Feb 2007 (EST)
  
I'm not sure how to change "./autogen.sh" or "Makefile.am" in order to include ccache automatically in the makefile.  Can someone please post here how to do so?  Right now, I just edit the generated makefile.
+
Well, at the moment there are many segmentation faults and other oddities, if you have a spare time, fix or [http://freeorion.org/forum/ report] them.
  
=Gentoo 'emerge info'=
+
:The segfaults are also a [http://sourceforge.net/tracker/index.php?func=detail&aid=1625064&group_id=75752&atid=544942. reported bug], believed to be due to a bug in the Boost-Signals library. [[User:Geoff the Medio|Geoff the Medio]] 06:55, 2 Feb 2007 (EST)
  
Here're my Gentoo settings (i.e. emerge info) for those who find it useful.
+
==CCache==
 +
If you compile FreeOrion often, using ccache and/or -jX helps to decrease the compile times.
  
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.4.20041102-r1, 2.6.10-gentoo-r6 i686)
+
Look at '''scons -h''' and '''scons -H'''.
------
+
System uname: 2.6.10-gentoo-r6 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHzGentoo Base System version 1.4.16
+
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Apr 27 2005, 22:45:39)]
+
ccache version 2.3 [enabled]
+
dev-lang/python:    2.3.5
+
sys-apps/sandbox:    [Not Present]
+
sys-devel/autoconf:  2.59-r6, 2.13
+
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
+
sys-devel/binutils:  2.15.92.0.2-r7
+
sys-devel/libtool:  1.5.16
+
virtual/os-headers:  2.6.8.1-r2
+
ACCEPT_KEYWORDS="x86"
+
AUTOCLEAN="yes"
+
CFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
+
CHOST="i686-pc-linux-gnu"
+
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config
+
/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config
+
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
+
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
+
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
+
CXXFLAGS="-march=pentium4 -O3 -pipe -fomit-frame-pointer"
+
DISTDIR="/home/gentoo/distfiles"
+
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict userpriv usersandbox"
+
MAKEOPTS="-j2"
+
PKGDIR="/home/gentoo/packages"
+
PORTAGE_TMPDIR="/portage/var/tmp"
+
PORTDIR="/usr/portage"
+
PORTDIR_OVERLAY="/usr/local/portage"
+
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
+
USE="x86 3dnow X acpi aim alsa apache2 arts avi berkdb bitmap-fonts bonobo bzlib cdparanoia crypt
+
curl dga div4linux encode esd fam fbcon flac gcj gd gdbm gif gnome gpm gstreamer gtk gtk2 hardened
+
hardenedphp imap imlib ipv6 java jikes jpeg junit kde ldap libg++ libwww mad maildir mikmod mime
+
mono motif mozilla mp3 mpeg msn mysql mysqli ncurses nls offensive ogg oggvorbis opengl oscar oss
+
pam pcmcia pdflib perl php pic png pnp python qt quicktime readline samba sdl slang sndfile spell
+
spl ssl svg svga tcpd tetex tiff truetype truetype-fonts type1-fonts unicode usb v4l vhosts videos
+
vorbis win32codecs xine xml xml2 xmms xv xvid zlib video_cards_radeon userland_GNU kernel_linux
+
elibc_glibc"
+
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
+

Latest revision as of 09:51, 4 April 2014

Compiling FreeOrion under Gentoo Linux ~x86 [2-Feb-2007]

* gcc-Version 4.1.1-r3
* svn trunk revision 2002, GG revision 562

I posted my experiences so that they could (hopefully) be of help to anyone else using Gentoo, I found these things out through trial-and-error and by hitting up the 'Net.

sdl log4cpp boost graphviz devil

The gentoo ebuild for sdl is called libsdl and you need log4cpp, boost, graphviz and devil aswell, so the command becomes

# emerge -av log4cpp libsdl boost graphviz devil

by me it looks like:

dev-libs/log4cpp-0.3.5_rc3  USE="threads -doc"

media-libs/libsdl-1.2.11-r1  USE="X aalib alsa libcaca nas opengl xinerama xv -arts -dga -directfb
-esd -fbcon -ggi -noaudio -noflagstrip -nojoystick -novideo -oss -svga"

dev-libs/boost-1.33.1-r1  USE="threads -bcp -bjam -debug -doc -icu% -pyste -threadsonly"

media-gfx/graphviz-2.8-r2  USE="X cairo java lua perl python tcltk -guile -ocaml -php -ruby -static"

media-libs/devil-1.6.7-r1  USE="X gif jpeg mng opengl png sdl tiff -allegro -xpm"

Note: the devil allegro use flag must be disabled!

Note: At the time of this entry, GiGi depends on >=dev-lib/boost-1.35 which is masked testing in portage.

# ACCEPT_KEYWORDS="~x86" emerge --oneshot -av \>=dev-lib/boost-1.35

Should get this problem solved quick and dirty.

# echo =dev-lib/boost-1.35.0-r1 ~x86 >> /etc/portage/packages.keywords
# echo =dev-lib/boost-build-1.35.0-r1 ~x86 >> /etc/portage/packages.keywords
# emerge -av boost

Pulls no testing dependencies of boost in (except boost-build, which is needed no matter what.), as only boost accepts the testing keyword.

For more information on masked packages refer to the emerge man pate, or the Gentoo Handbook. --V 02:45, 20 August 2008 (EDT)

fmod & Scons

You need also the fmod libary -> Version 3.75 or higher.

# emerge -av fmod

media-libs/fmod-3.75

and Scons to Compile Freeorion

# emerge -av scons

What you've been waiting for: FreeOrion

Get FreeOrion via Subversion.

$ svn co https://freeorion.svn.sourceforge.net/svnroot/freeorion/trunk freeorion 

Then we do as the Compile page says for Linux:

$ cd freeorion
$ cd FreeOrion
$ cd GG
$ scons
# scons install
$ cd ..
$ scons -j2

To play:

./freeorion [-f for full-screen (doesn't seem to work, but you can set it in the options menu)]
This is a reported bug Geoff the Medio 06:55, 2 Feb 2007 (EST)

Well, at the moment there are many segmentation faults and other oddities, if you have a spare time, fix or report them.

The segfaults are also a reported bug, believed to be due to a bug in the Boost-Signals library. Geoff the Medio 06:55, 2 Feb 2007 (EST)

CCache

If you compile FreeOrion often, using ccache and/or -jX helps to decrease the compile times.

Look at scons -h and scons -H.