Currently Online

Latest Posts

Topic: Compilation under linux minihelp

Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-05-13, 21:35

This is intended as an introduction for new user about linux and about its command line.

First about the terminal:

I have prepared couple of examples, when you look at them you see a '$' that is a prompt, you type a command there and hit enter afterwards :) Your prompt will probably differ and might contain some information usefull for you. In examples below, lines starting with '$' is what you enter (you dont enter $ of course), remaining lines are what you get (if anything).

It is important to know where you are so 'Print Working Directory':

$pwd
/home/tibor



also to list the content of current directory

$ls
...
...
...



and to 'Change the Directory':

$cd widelands1
$pwd
/home/tibor/widelands1



'cd' without any arguments takes you into home directory

$cd 
$pwd
/home/tibor



Some jobs must be done as root (ubuntu usually has the account disabled and is using sudo, but still), so to find out who you are now:

$whoami
tibor


So this was general introduction, now preparation for installation itself

First of all, make sure you have everything installed with command

$sudo apt-get install bzr cmake g++ gettext libboost-dev libboost-regex-dev libboost-signals-dev libboost-test-dev libglew-dev libpng-dev libsdl1.2-dev libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev libsdl2-dev libsdl2-gfx-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev liblua5.1-dev ninja-build python zlib1g-dev 


I got list of packages from https://wl.widelands.org/wiki/Building%20Widelands/#ubuntu__debian this list tends to change over time....

(note that you do not type, just copy paste from here to console - it works in graphical interface at least). To copy, it should be enough to higlight the source text, go to terminal and middle-click it to paste highlighted text.

Some of listed packages are already installed, some of them have to be installed.

Some distributions do not have sudo and have standart root user, so then you use su comand

$su -
Password:



Installation of widelands itself:

First, you can have multiple installations in separate directories. So let presume first installation will be in directory /home/tibor/widelands1.

#cd
$mkdir widelands1
$cd widelands1
$pwd
/home/tibor/widelands1



Now download the branch you are to compile (you should still be in /home/tibor/widelands1 directory):

$bzr branch  lp:~widelands-dev/widelands/bug-1451147



Wait 10-20 minutes and unless it complains about anything, use 'ls' to verify that you have the directory with source code created

$ls
bug-1451147



enter it

$cd bug-1451147



and run the compilation:

$./compile.sh



and wait and read the output. You should get at the end (might differ, take it as example):

-- Removed runtime path from "/home/tibor/widelands1/bug-1451147/widelands"
-- Installing: /home/tibor/widelands1/bug-1451147/wl_render_richtext
-- Removed runtime path from "/home/tibor/widelands1/bug-1451147/wl_render_richtext"
-- Installing: /home/tibor/widelands1/bug-1451147/wl_map_info
-- Removed runtime path from "/home/tibor/widelands1/bug-1451147/wl_map_info"


So compiled binary is here /home/tibor/widelands1/bug-1451147/widelands. As usual, copy it with mouse to prompt and hit enter.

And if it starts, you made it! :)


"Housekeeping"

maybe you will need to delete entire installation later, there is command for it 'rm':

$cd
$rm -rf widelands1


It will take couple of seconds till you get a prompt...

In fact widelands1 directory itself is not necessary, it would work to have just directories like
/home/tibor/bug-1451147
/home/tibor/bug-1475187

and so on, it is up to you...

I hope this will encourage somebody to try the linux and compilation of widelands there. Though this does not cover installation of linux itself that can be a trouble for windows-only user :)

I will gladly answer any questions. Or somebody else here I believe
Edited: 2015-05-22, 18:37

Top Quote
fk
Avatar
Joined: 2013-07-30, 21:58
Posts: 151
Ranking
At home in WL-forums
Posted at: 2015-05-14, 08:42

The link to the package lists does not work. I actually hoped to find the list of libs for r18.

Secondly, if I compile WL in a certain directory than I can't change the name of the directory anymore or the next compilation will fail. I think that it helps to know this in advance.

"installation of linux itself that can be a trouble"

That is still true for some obscure versions, but the installation of Ubuntu, Mint etc. has become a matter of entering a DVD of USB.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 19:48
Posts: 2442
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-05-14, 09:15

Try this link: /wiki/Building Widelands/#ubuntu__debian


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-05-14, 09:29

Great guide face-smile.png

If you want to play with multiple branches, instead of:

$./install.sh

Do this:

$./compile.sh

Then, still in the same directory, you can run widelands like this:

$./widelands

Busy indexing nil values

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-05-14, 18:42

Gyus, thanks for feedback!

If you are going run widelans with

$./widelands



be sure you are in the directory where you made the compilation. In other words, 'ls' command must show also widelands file in the current directory

Let me elaborate it a bit:

You might wonder what './' is for - this means 'search for following binary in current directory'. Without it it would search for executable in PATH - that is couple of directories where operation systems searches for executables by default (Hint: type 'echo $PATH' to terminal)

In case you have widelands installed also via package manager, just package's executable would be run and you would be probably bit confused what is going on.
Edited: 2015-05-14, 20:57

Top Quote
hjd

Joined: 2011-06-12, 19:24
Posts: 164
Ranking
At home in WL-forums
Location: bugs.launchpad.net/widelands
Posted at: 2015-05-16, 11:46

fk wrote: The link to the package lists does not work. I actually hoped to find the list of libs for r18.

Like others mentioned, see the section on dependencies on Building Widelands.

I haven't looked over the dependencies for all distributions recently, but apart from FreeBSD* most of them should be a mix of dependencies for trunk and build18. So you install the whole list and then you should be able to compile either version.

Can I ask why you might be looking for a list of dependencies for build18? face-smile.png The drawback with having a combined list is of course that it requires people installing several libraries they don't need. As a prime example since build18 used SDL1.2, but trunk has switched to SDL2, anyone installing the list gets both libraries when they probably only need one. For this reason I have been pondering either splitting it into two lists (which I'm afraid might make things more confusing) or simply list the dependencies for latest trunk. If people do need instructions for build18 it will always be available in the page history, and from what I can see most (if not all) distributions have packaged and shipped build18 some time ago so it should be available in the standard archives.

I don't want to remove things without first checking if people are still using it though, in case it is still useful.

*As mentiond on the page, the list of FreeBSD dependencies are only for trunk, since build18 is available in the ports archive (and needed some patches to build).

Edited: 2015-05-16, 11:47

Ships!

Top Quote
fk
Avatar
Joined: 2013-07-30, 21:58
Posts: 151
Ranking
At home in WL-forums
Posted at: 2015-05-16, 13:06

hjd

Can I ask why you might be looking for a list of dependencies for build18?

Yes, but I will try to stay on topic. I don't particularly like build19 and I only wanted to improve the AI a bit, so build18 was the better choice. Besides of that I had problems with the compilation of build19 with Kubuntu, although it worked again after I had upgraded to the newest version. I have switched to Linux Mint and I can again not compile build19, although they also have an upgrade. That might work but I haven't needed it so far.


Top Quote
hjd

Joined: 2011-06-12, 19:24
Posts: 164
Ranking
At home in WL-forums
Location: bugs.launchpad.net/widelands
Posted at: 2015-05-16, 19:01

Besides of that I had problems with the compilation of build19 with Kubuntu, although it worked again after I had upgraded to the newest version. I have switched to Linux Mint and I can again not compile build19, although they also have an upgrade. That might work but I haven't needed it so far.

Keep in mind that build19 doesn't exist yet. There is a development version though, which have seen various major changes which also means the requirements and dependencies for building Widelands has changed. The only thing I know which would be a straight-up blocker is that we dropped support for Ubuntu 12.04 some time back, so you would need Ubuntu 14.04 (or something based on that release) or newer in order to build Widelands. We've tried to keep the documentation on the building page up to date and we also have a PPA which for the most part have continuously built Widelands for recent Ubuntu releases.

As you say this is getting off-topic, but if you have or run into any particular building errors, please open a thread here or stop by the IRC chat and we'll sort it out. face-smile.png

I don't particularly like build19 and I only wanted to improve the AI a bit, so build18 was the better choice.

Ok, I'm sorry to hear that. It's hard to tell what you're unhappy with, without details though. Unless you've done so already (I rarely read the forum, so apologies in advance) could you elaborate a bit on this?

I would like to note though, that if someone wants to integrate your AI changes to a future build, that might be harder due to all the changes which have happened since build18 was released.

All right, let's get back to topic.


Ships!

Top Quote
Tibor

Topic Opener
Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-05-16, 20:41

@fk,

as hjd said above, dont bother with build18, there was so much changes since, that you changes could end up nontransferable to current trunk.


Top Quote
fk
Avatar
Joined: 2013-07-30, 21:58
Posts: 151
Ranking
At home in WL-forums
Posted at: 2015-05-16, 20:58

hjd wrote:

could you elaborate a bit on this?

I don't think that it would help, it is clear that I have a different idea of how a game should work and perhaps also a different taste than the current builders/developers. But we can still learn from each other.

Tibor wrote:

dont bother with build18, there was so much changes since, that you changes could end up nontransferable to current trunk.

That is a loss for that trunk, not for my version.


Top Quote