Getting Wesnoth 1.11 on Ubuntu (solved)

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Post Reply
User avatar
Captain_Wrathbow
Posts: 1664
Joined: June 30th, 2009, 2:03 pm
Location: Guardia

Getting Wesnoth 1.11 on Ubuntu (solved)

Post by Captain_Wrathbow »

Hullo all!

I recently ditched Windows and installed Ubuntu on my computer. In the past, (when using Windows) I've always been spoiled by having Wesnoth installation binaries served to me on a platter, but it seems that it's not that easy in Linux. The development branch isn't available through the Ubuntu Software Center, and the most recent stable version is 1.10.2.

I'm guessing that means I have to compile it myself, which sounds like a fun and exciting new challenge. Unfortunately, I don't have the slightest clue how to do that. This forum contains stickies relating to compiling on Windows and Mac OS, but nothing for Ubuntu. I imagine the process involves downloading the source code and typing in some arcane commands at the terminal, but, previously being a sissy Windows user and being rather new to the Linux command prompt world in general, I'm at a loss as to how to do that.

So, essentially what this boils down to is that, pitiful as it sounds, I'm asking some kind, generous Linux guru to provide me with the Dummies' Guide and hold my hand and walk me through the process of compiling Wesnoth 1.11.5 on Ubuntu. Or perhaps just point me to some documentation on that process, which I somehow failed to find...

EDIT: Aha, found this. But I'm still so lost... what are these libraries and how do I install them so that I can compile Wesnoth? Through the Ubuntu Software Center? or with terminal commands?

EDIT 2: Changed topic title to mark as solved.
Last edited by Captain_Wrathbow on July 8th, 2013, 4:52 pm, edited 1 time in total.
User avatar
lipk
Posts: 637
Joined: July 18th, 2011, 1:42 pm

Re: A New Adventure (for me): Compiling Wesnoth on Ubuntu

Post by lipk »

First and foremost, you can install the dev branch from Rhonda's ppa:

Code: Select all

sudo add-apt-repository ppa:rhonda/wesnoth-devel
sudo apt-get update
sudo apt-get install wesnoth-1.11
Or, if you insist on compiling it yourself:

Code: Select all

sudo apt-get build-dep wesnoth
cd /path/to/extracted/wesnoth/sources
cmake .
make
sudo make install
Good luck!

EDIT: If you have a multicore processor, you may want to append " -jN" to the "make" command, where N is the number of cores.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: A New Adventure (for me): Compiling Wesnoth on Ubuntu

Post by AI »

The reason we have threads on this stuff for OS X and windows (especially windows) is that you have to jump through a lot of hoops to get all the libraries installed and your build environment set up correctly. On linux it tends to just be a few commands, regardless of which distro you're using. (assuming it's not several years out of date)

We do seem to assume things that aren't entirely obvious to new people, so if you can think of a way to reword that page so it would have helped you better, the next person might thank you for it.
User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: A New Adventure (for me): Compiling Wesnoth on Ubuntu

Post by Crow_T »

EDIT: If you have a multicore processor, you may want to append " -jN" to the "make" command, where N is the number of cores.
This isn't exactly right? From http://wiki.blender.org/index.php/Dev:2 ... untu/CMake

Code: Select all

Parallel Builds
	For multi-core / multi processor systems you can build much faster by passing the jobs argument to make: -j(1+number_of_cores).

For example put "-j3" if you have a dual-core or "-j5" if you have a quad-core.
For Shell-scripts use GNU-Syntax: expr `nproc` + 1 or Bash-Syntax: $((`nproc`+1))
If it's still not using all your CPU power, leave out the number: "-j" to spawn as many as possible build processes (usually 64).
Note that it may build faster, but make your system lag in the meanwhile.
Either way it's a great tip, I just built Wesnoth super fast :shock:
User avatar
Captain_Wrathbow
Posts: 1664
Joined: June 30th, 2009, 2:03 pm
Location: Guardia

Re: A New Adventure (for me): Compiling Wesnoth on Ubuntu

Post by Captain_Wrathbow »

lipk wrote:First and foremost, you can install the dev branch from Rhonda's ppa:

Code: Select all

sudo add-apt-repository ppa:rhonda/wesnoth-devel
sudo apt-get update
sudo apt-get install wesnoth-1.11
What sorcery is this? I have no idea what those commands mean, but I just typed them in the terminal, and now I have Wesnoth 1.11! (Although, it is 1.11.4.)
Thank you very much! That's exactly what I was looking for. But, could you possibly explain what those commands meant? I really am curious about actually learning how this works, rather than just blindly typing in text that's meaningless to me.
User avatar
lipk
Posts: 637
Joined: July 18th, 2011, 1:42 pm

Re: A New Adventure (for me): Compiling Wesnoth on Ubuntu

Post by lipk »

apt-get is a program that installs software from a remote server. Ubuntu comes with some such servers (so-called "repositories" or "software sources") preconfigured for your convenience, but you can also add other ones. One option is using a PPA (Personal Package Archive). PPA is a service by Canonical (the company behind Ubuntu) which allows people to create their own repositories and upload packages for others to use. The first command adds the ppa called rhonda/wesnoth-devel to your repository list. The sudo prefix indicates that you're performing the operation as root (which is almost always required when you're modifying stuff outside your home directory). APT stores some offline info about each package (description, dependencies and such). apt-get update updates that database, so that it now includes the packages from rhonda/wesnoth-devel. And lastly, apt-get install wesnoth-1.11... well, that's pretty straightforward, I guess.
User avatar
Captain_Wrathbow
Posts: 1664
Joined: June 30th, 2009, 2:03 pm
Location: Guardia

Re: A New Adventure (for me): Compiling Wesnoth on Ubuntu

Post by Captain_Wrathbow »

Ah! Thank you again!
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: A New Adventure (for me): Compiling Wesnoth on Ubuntu

Post by AI »

Crow_T wrote:
EDIT: If you have a multicore processor, you may want to append " -jN" to the "make" command, where N is the number of cores.
Either way it's a great tip, I just built Wesnoth super fast :shock:
Be careful with that. Wesnoth can use quite a bit of memory when compiling and compiling 5 things at the same time uses 5 times as much memory. Don't do crazy stuff like compiling with -j9 on a hyperthreaded quad-core unless you have at least 8 GiB of RAM (and preferably more), otherwise the swapping will only slow you down again.
User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: Getting Wesnoth 1.11 on Ubuntu (solved)

Post by Crow_T »

Be careful with that. Wesnoth can use quite a bit of memory when compiling and compiling 5 things at the same time uses 5 times as much memory. Don't do crazy stuff like compiling with -j9 on a hyperthreaded quad-core unless you have at least 8 GiB of RAM (and preferably more), otherwise the swapping will only slow you down again.
I have 8 GB and my total memory usage barely went over 1.2 GB and it didn't touch the swap during compile (I was watching the system monitor to make sure I had done it right).
User avatar
Captain_Wrathbow
Posts: 1664
Joined: June 30th, 2009, 2:03 pm
Location: Guardia

Re: Getting Wesnoth 1.11 on Ubuntu (solved)

Post by Captain_Wrathbow »

On the original topic, is there something similar I can do to install the latest stable version? (the most recent version available through the Ubuntu Software Center is 1.10.2.)
User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: Getting Wesnoth 1.11 on Ubuntu (solved)

Post by Crow_T »

You can either build it from source (which is easy once you do it) or use a ppa as described above. I'm actually having issues with the 1.11.5 source though, I am getting freezes https://gna.org/bugs/?20951 so maybe the ppa is the better way to go- looks like the Rhonda ppa is still on 11.4
User avatar
lipk
Posts: 637
Joined: July 18th, 2011, 1:42 pm

Re: Getting Wesnoth 1.11 on Ubuntu (solved)

Post by lipk »

Captain_Wrathbow wrote:On the original topic, is there something similar I can do to install the latest stable version? (the most recent version available through the Ubuntu Software Center is 1.10.2.)
A quick search on launchpad.net (where PPA's are hosted) shows me that vincent-c/wesnoth has 1.10.6.
Post Reply