MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

jpakkane
MAME Fan
Reged: 09/21/14
Posts: 2
Send PM


Random experiment: compiling Mame with Meson
#332119 - 09/21/14 02:10 AM


Hi

I'm working on a new build system called Meson. Every now and then I look into public projects that have complex build definitions and rewrite them in Meson to test its usability. Mame's build system is quite complex so it provides an interesting challenge.

I ported enough of it so that I can compile Mame with miniosd and all tools. It compiles, links and runs but I have not tested it any further (there may be gremlins there).

The main advantage is that Mame's current Make config takes ~16k lines of code whereas Meson takes just under 10k lines. The biggest savings come from the fact that you don't need to manually write (and keep updating ) the source-header dependencies. Meson extracts them automatically by having the compiler write dependency files (yes, even with msvc).

This is not directly comparable, of course, as Meson does not do all the stuff the Make system does. Most of the lines are source listings that are almost identical for both build systems, a rough estimate is that adding the remaining functionality would take less than 1k lines.

Compile times are roughly the same of around 10 minutes using 8 cores.

Should someone want to try it themselves, get the tarball from here, then get Meson from trunk and follow the instructions.

That's about the jist of it. It was a fun challenge, hopefully someone else will also find it interesting.

Thanks,



drewcifer
One bad Mutha-(shut yo' mouth!)
Reged: 07/01/04
Posts: 427
Loc: Sweden
Send PM


Re: Random experiment: compiling Mame with Meson new [Re: jpakkane]
#332129 - 09/21/14 12:24 PM


Cool stuff, thanks for sharing!

As you may have noticed, certain aspects of the way MAME and MESS are built are a little hokey (it's understandable if you didn't notice though, as some of the most challenging bits are really subtle). I'll forward your work on to the development list so other developers can see what you've done. Maybe it will spark discussion, maybe not, but either way, it's really interesting to see an example of another build system and how it might handle the MAME tree.

/Andrew


> I'm working on a new build system called Meson. Every now and then I look into public
> projects that have complex build definitions and rewrite them in Meson to test its
> usability. Mame's build system is quite complex so it provides an interesting
> challenge.



Anonymous
Unregistered
Send PM


Re: Random experiment: compiling Mame with Meson new [Re: jpakkane]
#332131 - 09/21/14 12:59 PM


> The biggest savings come from the fact that
> you don't need to manually write (and keep updating ) the source-header dependencies.

We don't manually write source-header dependencies, we have a target in the makefile that builds them (make depend).

Edited by smf (09/21/14 01:00 PM)



jpakkane
MAME Fan
Reged: 09/21/14
Posts: 2
Send PM


Re: Random experiment: compiling Mame with Meson new [Re: ]
#332157 - 09/22/14 09:06 AM


If you look at the makefiles, they have lots of manually written dependencies. As an example, src/mame/mame.mak ends with dozens of lines that look like this:

$(VIDEO)/namcos2.o: $(MAMESRC)/includes/namcos2.h

These seem to be different than the depend target which is written to depend_ume.mak. Maybe these are remnants and not used?

But, more importantly, with Meson there is no "make depend" step, the dependency info db is created and updated automatically.



Anonymous
Unregistered
Send PM


Re: Random experiment: compiling Mame with Meson new [Re: jpakkane]
#332158 - 09/22/14 10:09 AM


> These seem to be different than the depend target which is written to depend_ume.mak.
> Maybe these are remnants and not used?

I don't know why they are there. IMO they could be deleted.

> But, more importantly, with Meson there is no "make depend" step, the dependency info
> db is created and updated automatically.

We don't automatically do it for performance reasons. We also exclude some .h files that would trigger rebuilding everything.

I'd like to see an unnecessary #include checker, i.e. if you include something you don't rely on then it should warn you. I've previously reduced the dependency list by 50% with some simple changes before.



R. Belmont
Cuckoo for Konami
Reged: 09/21/03
Posts: 9567
Loc: ECV-197 The Orville
Send PM


Re: Random experiment: compiling Mame with Meson new [Re: ]
#332162 - 09/22/14 03:27 PM


> I don't know why they are there. IMO they could be deleted.

They're there to make it safer/more convenient to work on the relevant drivers.

> I'd like to see an unnecessary #include checker, i.e. if you include something you
> don't rely on then it should warn you. I've previously reduced the dependency list by
> 50% with some simple changes before.

Google makes one that's well regarded.



Anonymous
Unregistered
Send PM


Re: Random experiment: compiling Mame with Meson new [Re: R. Belmont]
#332164 - 09/22/14 04:22 PM


> > I don't know why they are there. IMO they could be deleted.
>
> They're there to make it safer/more convenient to work on the relevant drivers.

You could make that argument about all drivers, which is what "make depend" is for.

It seems a little passive aggressive to include them.

Edited by smf (09/22/14 04:23 PM)


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  redk9258, URherenow, Tafoid 
1 registered and 35 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1709