Compile problems on Ubuntu

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
Post Reply
nutzer
Posts: 15
Joined: Sun Oct 15, 2017 10:01 am

Compile problems on Ubuntu

Post by nutzer »

Trying to build 2.6.0 from source on Ubuntu 18.04.

Seeing the install.md docu I assume it has use for an overhaul. There is no talk at all about SDL2 and PNG libraries. I run into configure failure on missing PNG, but have no idea about it nor does "apt install" know anything about it. Surprisingly it also knows nothing about SDL2 which leaves me surprised. Is there going anything wrong here?

Anyway, I think the install instruction could be, or more precisely should be, improved.
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compile problems on Ubuntu

Post by cazfi »

libpng is not a direct dependency of freeciv, except in case of deprecated xaw-client. Gui libraries freeciv uses depend on it. When you install the direct dependencies, the recursive dependencies get installed automatically.

Since you talk about libSDL2, I assume you want to build SDL2-client. When you install libsdl2-image-dev, it should install also libpng-dev and libsdl2-dev.
nutzer
Posts: 15
Joined: Sun Oct 15, 2017 10:01 am

Re: Compile problems on Ubuntu

Post by nutzer »

I have given up on compiling the game and I state the reasons. (Referring to 2.6.0 packages)
a) the English documents don't even have an INSTALL document.
b) when I take the German docs, I try to follow the instructions for GTK2. I run Ubuntu 18.04. I look for the Glib library. When I run "aptitude glib" I get a host of entries without any structure, so I don't know what to install. So I download glib-1.2.10.tar.gz from the GNOME software pages. When I try to compile these and run "./configure" I receive the following

loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for working aclocal... missing
checking for working autoconf... missing
checking for working automake... missing
checking for working autoheader... missing
checking for working makeinfo... missing
checking host system type... Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized

checking build system type... Invalid configuration `x86_64-unknown-linux-gnu': machine `x86_64-unknown' not recognized

checking for ranlib... (cached) ranlib
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for ld used by GCC... (cached) /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... (cached) yes
checking for BSD-compatible nm... (cached) /usr/bin/nm -B
checking whether ln -s works... (cached) yes
loading cache ./config.cache within ltconfig
ltconfig: you must specify a host type if you use `--no-verify'
Try `ltconfig --help' for more information.
configure: error: libtool configure failed

I have no idea how to continue, compile failed!
The German instructions say that
"Compiliert man selbst, sollte (oder muß) folgende Reihenfolge
eingehalten werden: Glib, Gtk+, Imlib".
So I'm stuck with Glib.
-------------------

My impression is that these INSTALL documents need an overhaul to meet current situations with Linux environments. To give you an idea how neatly this can be made I refer you to the Widelands build instructions which show a complete install command for dependent libraries in Ubuntu in one single line. At https://wl.widelands.org/wiki/Building%20Widelands

sudo apt install bzr cmake g++ gcc gettext libboost-dev libboost-regex-dev libboost-test-dev libglew-dev libpng-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev python zlib1g-dev

This is an example of a clear statement and this makes life of the user/player/developer adequately easy. Is this possible for freeciv?
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Compile problems on Ubuntu

Post by cazfi »

nutzer wrote:a) the English documents don't even have an INSTALL document.
It's in the very root directory of the source tree.

You may find ubuntu-18.04 script from http://forum.freeciv.org/f/viewtopic.php?f=8&t=89944 useful.
nutzer
Posts: 15
Joined: Sun Oct 15, 2017 10:01 am

Re: Compile problems on Ubuntu

Post by nutzer »

Thanks for the hint! I had success in compiling after "apt install libgtk2.0-dev".
It puzzles me however that I couldn't compile Glib and the associated error.
Post Reply