Wireshark mailing list archives

Compiling with ninja


From: Dario Lombardo <dario.lombardo.ml () gmail com>
Date: Tue, 4 Nov 2014 15:12:22 +0100

Hi list
Some days ago I played a bit with ninja and I found useful info I'd like to
share with you.
Ninja is a compilation system similar to make. It's advantage is that it
was built with parallelism in mind, to take advantage of multi-core CPUs.
Wireshark uses cmake that has a generator for ninja, so I decided to make
some tests.

1) cmake and make
This a very common way to compile stuff, and wireshark too. The advantage
of using cmake and make is that you get a progress of the compilation. Very
useful! The disadvantage is that this progress runs bad with parallel make
(-j). Not only the output is a mess, but sometimes compilation breaks. I
think that cmake doesn't manage well parallel gcc instances. Autotools
manage well parallel make, but afaik the cmake subsystem in wireshark has a
better support.

With this setup I'm able to compile wireshark in about 10m.

2) cmake and ninja
To speed up things I made a second setup for ninja, on my ubuntu 14.04

sudo apt-get install ninja-build
mkdir build-ninja
cd build-ninja
cmake -GNinja ..
ninja

The compilation went well and the compilation took about 2.5m! I lost the
progress in term of percentage, but I still have a progress in term of
#compiled/#total. But the BIG advantage is the speed: only 25% of the other
setup on the same machine. The other advantage is that, using cmake, you
can have separate build dirs, that don't pollute each other.

Hope it helps people who like faster compilation :).

Dario.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: