Tuesday, May 9, 2017

Mame compile on Ubuntu 16.04 is pretty easy

I must be getting better at setting up compiling mame on a ubuntu 16.04 system because it seems pretty easy now.

I get the latest 185 version from http://mamedev.org/release.html

Look for mame0185s.zip MAME 0.185 sources in ZIP format (all platforms) and extract it with Archive Manager.


The instructions at:

http://docs.mamedev.org/initialsetup/compilingmame.html
tell you what you need:

sudo apt-get install git build-essential libsdl2-dev libsdl2-ttf-dev libfontconfig-dev qt5-default

and then I edit the makefile,

where the line says

# QT_HOME = /usr/lib64/qt48/

I just add this line underneath:

QT_HOME = /usr/lib/x86_64-linux-gnu/qt5/


I like to see how long it takes so I run with time and -j4 for 4 processes since I have a quad core machine:

time make -j4

and it fails for some reason at the end, probably some race condition:

...
Archiving liboptional.a...
Compiling src/mame/mame.cpp...
Compiling generated/version.cpp...
Assembler messages:
Fatal error: can't create ../../../../linux_gcc/obj/x64/Release/generated/version.o: No such file or directory
mame.make:295: recipe for target '../../../../linux_gcc/obj/x64/Release/generated/version.o' failed
make[2]: *** [../../../../linux_gcc/obj/x64/Release/generated/version.o] Error 2
make[2]: *** Waiting for unfinished jobs....
Makefile:1006: recipe for target 'mame' failed
make[1]: *** [mame] Error 2
makefile:1244: recipe for target 'linux_x64' failed
make: *** [linux_x64] Error 2

real 37m12.567s
user 91m59.028s
sys 6m14.188s

Running the make again is successful:

time make -j4
GCC 5.4.0 detected
Building driver list...
Compiling generated/version.cpp...
34200 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame64...

real 0m45.262s
user 0m19.616s
sys 0m2.536s

It takes me 38 minutes to compile on a quad core i5-2400 (3.1ghz x 4)

An Intel Core i3-2100 CPU @ 3.10GHz × 4 gives takes about 45 minutes.

real 45m22.111s
user 162m59.016s
sys 8m59.484s


and ./mame64 will run the compiled mame.

1 comment: