All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dylan Baker <dylan@pnwbakers.com>
To: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "mesa-dev@lists.freedesktop.org" <mesa-dev@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [RFC libdrm 0/2] Replace the build system with meson
Date: Thu, 16 Mar 2017 14:57:34 -0700	[thread overview]
Message-ID: <148970145490.15211.5441796070604281398@localhost.localdomain> (raw)
In-Reply-To: <CAKb7UvhG+r3B+cPaLxfL=Ct9WEp_d5iBWC4pAqsHEvMB+Fow0g@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4671 bytes --]

Quoting Ilia Mirkin (2017-03-16 14:32:09)
> On Thu, Mar 16, 2017 at 5:25 PM, Dylan Baker <dylan@pnwbakers.com> wrote:
> > Why bother, and why would we want this?                                                              │~
> >
> > First it's written in python, which means the potential developer base
> > is massive. And it provides a recursive view for humans, but a
> > non-recursive view for the system. This is the best of both worlds,
> > humans can organize the build system in a way that makes sense, and the
> > machine gets a non-recursive build system. It also uses ninja rather
> > than make, and ninja is faster than make inherently. Meson is also a
> > simpler syntax than autotools or cmake it's not Turing Complete by
> > design nor does it expose python, again, by design. This allows meson
> > itself to be reimplemented in a another language if python becomes a
> > dead-end or a bottle-neck. It also makes it much easier to understand
> > what the build system is doing.
> >
> > What's different about using meson?
> >
> > Well, apart from a faster builds and less magic in the build system? The
> > configure flags are different, it uses -D<opt>=<value> more like cmake
> > than the --enable or --with flags of autotools, although oddly it uses
> > --prefix and friends when calling meson, but not with mesonconf, there's
> > a bug opened on this. Meson also doesn't support in-tree builds at all;
> > all builds are done out of tree. It also doesn't provide a "make dist"
> > target, fortunately there's this awesome tool called git, and it
> > provides a "git archive" command that does much the same thing. Did I
> > mention it's fast?
> >
> > Here are the performance numbers I see on a 2 core 4 thread SKL, without
> > initial configuration, and building out of tree (using zsh):
> >
> > For meson the command line is:
> > time (meson build -Dmanpages=true && ninja -C build)
> >
> > For autotools the command line is:
> > time (mdkir build && cd build && ../autotools && make -j5 -l4)<Paste>
> 
> Probably mkdir...

derp, yeah.

> 
> >
> > meson (cold ccache):     13.37s user 1.74s system 255% cpu  5.907 total
> > autotools (cold ccache): 26.50s user 1.71s system 129% cpu 21.835 total
> > meson (hot ccache):       2.13s user 0.39s system 154% cpu  1.633 total
> > autotools (hot ccache):  13.93s user 0.73s system 102% cpu 14.259 total
> >
> > That's ~4x faster for a cold build and ~10x faster for a hot build.
> >
> > For a make clean && make style build with a hot cache:
> > meson:     4.64s user 0.33s system 334% cpu 1.486 total
> > autotools: 7.93s user 0.32s system 167% cpu 4.920 total
> >
> > Why bother with libdrm?
> >
> > It's a simple build system, that could be completely (or mostly
> > completely) be ported in a very short time, and could serve as a tech
> > demo for the advantages of using meson to garner feedback for embarking
> > on a larger project, like mesa (which is what I'm planning to work on
> > next).
> >
> > tl;dr
> >
> > I wrote this as practice for porting Mesa, and figured I might as well
> > send it out since I wrote it.
> >
> > It is very likely that neither of these large patches will show up on the
> > mailing list, but this is available at my github:
> > https://github.com/dcbaker/libdrm wip/meson
> 
> I haven't looked at meson or your patches in detail, but autotools
> supports 2 very important use-cases very well:
> 
> 1. ./configure --help
> 2. Cross-compilation with minimal requirement from the project being built
> 
> Can you comment on how these are handled in meson?
> 
> Cheers,
> 
>   -ilia

1. mesonconf <builddir> provides much the same thing. You can also read the
meson_options.txt file, which is generally pretty short. I haven't added
descriptions to the options in this patch.

2. you write a small ini style configuration file, something like:
[binaries]
c = '/usr/bin/aarch64-linux-gnu-gc'
ar = '/usr/bin/aarch64-linux-gnu-gcc-ar'
strip = '/usr/bin/aarch64-linux-gnu-strip'
pkg-config = '/usr/bin/aarch64-linux-gnu-pkgconfig'

Then you just configure with:
meson build --cross-file cross_file.txt

then just ninja like normal

There's a more detailed walkthrough here:
https://github.com/mesonbuild/meson/wiki/Cross-compilation

I was able to cross compile the arm libraries for aarch64 using basically the
above configuration (I had to write a wrapper script for pkg-config to set a
couple of environment variables and install and archlinux aarach64 chroot,
because arch), of course, I don't have access to any arm machines that I could
test with.

Dylan

[-- Attachment #1.2: signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

-----BEGIN PGP SIGNATURE-----

iQEzBAABCAAdFiEEUwPMqo/+5aFHLzU4CJ4WlhQGiO8FAljLCk4ACgkQCJ4WlhQG
iO/aXAf5Aa24b7MDG7XXZEgnjfc7fWw4QtArtz06mUX2srCm7Y9ojT2YjCp9dGkz
vCr5NHcXFExHMl6aUDKkAR3a/pXzG1/iV6I48X2JoKdOfwIG6UnOiv8BU8rZWcbn
I8yLTUWeO2cC3mMPLm2dDAqwA8XCi+GhdgoOou0gMgBBgKPlDmRD8Glno7bJt0ex
vKWYE4jvPj3exCdArX+RN+t2BRITWY9cIK7ivQrWiVcsQvuqbDb2wNTpa4ivrFGb
Pr6Uv4eNOv7H9OkOJITyVRk2p+ULv5NoVR/bmCe2tWZY8AmPNQOH82hqOO4ozXA8
fbDKKlMdZP19K1uj3CPvIiYZujH24g==
=yiYj
-----END PGP SIGNATURE-----

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-03-16 21:57 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 21:25 [RFC libdrm 0/2] Replace the build system with meson Dylan Baker
2017-03-16 21:25 ` [RFC libdrm 1/2] Port build system to meson Dylan Baker
2017-03-16 21:25 ` [RFC libdrm 2/2] remove autotools build Dylan Baker
2017-03-16 21:32 ` [RFC libdrm 0/2] Replace the build system with meson Ilia Mirkin
2017-03-16 21:57   ` Dylan Baker [this message]
2017-03-17 10:05     ` Neil Armstrong
2017-03-16 22:36 ` Marek Olšák
2017-03-16 23:11   ` Dylan Baker
2017-03-17  1:53     ` Marek Olšák
2017-03-17  4:15       ` Dylan Baker
2017-03-17 21:18         ` Marek Olšák
2017-03-22 17:26   ` Jose Fonseca
2017-03-22 17:50     ` [Mesa-dev] " Marek Olšák
2017-03-16 23:35 ` Emil Velikov
2017-03-17  0:21   ` Dylan Baker
2017-03-17  0:41     ` Emil Velikov
2017-03-17  2:03       ` Jason Ekstrand
2017-03-17  2:28         ` Brian Paul
2017-03-22 17:59           ` Jose Fonseca
2017-03-22 20:57             ` [Mesa-dev] " Dylan Baker
2017-03-22 22:02               ` Rob Clark
2017-03-22 22:15                 ` Eric Anholt
2017-03-22 22:33                   ` Dylan Baker
2017-03-24 14:03               ` Jose Fonseca
2017-03-24 14:22                 ` [Mesa-dev] " Daniel Stone
2017-03-24 15:47                   ` Jose Fonseca
2017-03-25 20:15                     ` [Mesa-dev] " Rob Clark
2017-03-24 16:23                 ` Bas Nieuwenhuizen
2017-03-17  4:12         ` Dylan Baker
2017-03-17  6:02           ` Jonathan Gray
2017-03-20 13:55         ` [Mesa-dev] " Emil Velikov
2017-03-20 18:30           ` Matt Turner
2017-03-20 19:39             ` [Mesa-dev] " Emil Velikov
2017-03-20 21:28               ` Timothy Arceri
2017-03-20 21:38                 ` Jason Ekstrand
2017-03-21  5:00                 ` Jonathan Gray
2017-03-21 16:00                   ` Matt Turner
2017-03-23 12:23                   ` Jonathan Gray
2017-03-23 18:31                   ` Emil Velikov
2017-03-21 15:57               ` [Mesa-dev] " Matt Turner
2017-03-21 17:16                 ` Emil Velikov
2017-03-21 18:06                   ` Matt Turner
2017-03-21 18:56                     ` [Mesa-dev] " Emil Velikov
2017-03-21 19:08                       ` Jason Ekstrand
2017-03-21 19:10                       ` [Mesa-dev] " Matt Turner
2017-03-22 17:16                         ` Emil Velikov
2017-03-24 20:59                     ` Chad Versace
2017-03-24 20:44                 ` [Mesa-dev] " Chad Versace
2017-03-28 16:59                   ` Emil Velikov
2017-03-28 23:19                     ` Timothy Arceri
2017-03-21  5:10             ` Jonathan Gray
2017-03-21 16:11               ` [Mesa-dev] " Matt Turner
2017-03-24 16:58             ` randyf
2017-03-20 19:29           ` Rob Clark
2017-03-21 14:44 ` Jani Nikula
2017-03-21 15:13   ` Grazvydas Ignotas
2017-03-21 15:15     ` Ilia Mirkin
2017-03-21 16:16     ` Dylan Baker
2017-03-21 16:22   ` Dylan Baker
2017-03-22  4:23     ` [Mesa-dev] " Jonathan Gray
2017-03-22  8:24     ` Jani Nikula
2017-03-22 21:05       ` Dylan Baker
2017-03-23  8:13         ` Jani Nikula
2017-03-21 16:50 ` Kai Wasserbäch
2017-03-21 17:34   ` Dylan Baker
2017-03-21 18:36     ` [Mesa-dev] " Kai Wasserbäch
2017-03-21 21:16       ` Dylan Baker
2017-03-22 16:40 ` Alex Deucher
2017-03-22 17:07   ` Rob Clark
2017-03-22 20:10     ` [Mesa-dev] " Dylan Baker
2017-03-22 21:48       ` Rob Clark
2017-03-23 21:56         ` Greg Hackmann
2017-03-23 22:14           ` Colin Cross
2017-03-23 23:56             ` Dylan Baker
2017-03-24  0:03               ` [Mesa-dev] " Colin Cross
2017-03-24 16:54                 ` Dylan Baker
2017-03-23  1:18       ` [Mesa-dev] " Jonathan Gray
2017-03-23  1:38         ` Rob Clark
2017-03-24 13:42           ` Jose Fonseca
2017-03-24 17:13             ` Dylan Baker
2017-03-24 17:51               ` Eric Anholt
2017-03-24 18:34                 ` [Mesa-dev] " Daniel Stone
2017-03-24 19:10             ` Kristian Høgsberg
2017-03-24 19:44               ` Jose Fonseca
2017-03-24 20:08                 ` Kristian Høgsberg
2017-03-24 21:16                   ` Jose Fonseca
2017-03-24 21:20                     ` Jason Ekstrand
2017-03-24 21:34                     ` [Mesa-dev] " Rob Clark
2017-03-25  1:25                     ` Dylan Baker
2017-03-24 21:09               ` [Mesa-dev] " Rob Clark
2017-03-23 11:39       ` Emil Velikov
2017-03-23 17:54         ` Dylan Baker
2017-03-25  1:06         ` Kenneth Graunke
2017-03-22 22:30   ` [Mesa-dev] " Eric Anholt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=148970145490.15211.5441796070604281398@localhost.localdomain \
    --to=dylan@pnwbakers.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imirkin@alum.mit.edu \
    --cc=mesa-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.