Mame 64bit compile on RPI4b
Does anyone have a good process/settings on how to compile a 64bit mame to run on a 64bit RPIos? Looking for mame 228 or 229 specifically, not the actual latest. I have been able to compile using 32bit, but 64bit keeps failing. Maybe swap? Or, anyone know how to cross compile a mame 64bit version on a linux host to run on a actual raspberry pi 4 64bit aarch? Cross compile would be amazing to also cut down on how long compiling takes.
@retrolou are you using the build script within retropie? it worked for me on aarch64. please fill out https://retropie.org.uk/forum/topic/3/read-this-first and also include a build log.
@dankcushions yes, I'm kinda using the retropie script, but i wanted specific versions of mame vs the latest. so I have been using the same make flags. The biggest improvement was setting the swap to 8192 or more to be sure. At one point i saw compiling eating up about 7GB, without that no way mame64 compiles on Pi4b even with 4gb memory. Know anyone/or how to compile mame for a pi on a linux host instead of actually compiling mame itself on the pi? I'd love to figure out/know how to do that?
@retrolou you didn't fill out ll out https://retropie.org.uk/forum/topic/3/read-this-first or provide a build-log. although i am curious if it currently builds on aarch64 so am doing that now, but i will only be looking at the buildlog to investigate.
please also provide a copy of your edited script
retrolou last edited by retrolou
@dankcushions it does compile. i'm basically just using this on aarch64.
i use wget to grab the source zip from mamedev, unzip it then
make -j3 NOWERROR=1 ARCHOPTS=-U_FORTIFY_SOURCE PYTHON_EXECUTABLE=python3
GPU mom at 16gb also seems to have helped. I've done 228, 229 and 225 all that way, using the make above with aarch64 buster and swap at 8gb
@retrolou Don't use
-j3, the memory build requirements for recent (post Feb ?) versions have increased considerably and compiling multiple files will - on certain files - exhaust the memory pretty fast.
@mitu yeah i have been able with the 8gb swap, actually compile with j4. have you ever tried cross compiling?
@dankcushions yes, I'm kinda using the retropie script, but i wanted specific versions of mame vs the latest. so I have been using the same make flags. The biggest improvement was setting the swap to 8192 or more to be sure. At one point i saw compiling eating up about 7GB, without that no way mame64 compiles on Pi4b even with 4gb memory.
to clarify, it builds fine with retropie's build scripts (have been building overnight to confirm). note that it uses 8GB swap for 64-bit builds and will use
you could have just adjusted the existing buildscript to point at the specific version you wanted: https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/emulators/mame.sh#L21
elvis last edited by
I have tried cross compiling, however I found the "regenie" portions of the MAME build break for me.
I built a cross compile environment on x86, and regenie tools appeared to build as aarch64 and wouldn't run.
I then attempted to use distcc initiated from the Pi to the cross-compile environment on the x86 box, however distcc occasionally returned x86 objects, and broke the process.
I also looked at a Qemu aarch64 environment running on my x86 system, but it was half the speed of my RPi4, and mostly useless for compiling at that performance (even via distcc, to be honest).
In the end I just compile with -j4 up until the couple of objects that consume enormous amounts of RAM arrive in the queue, Control+C out, resume with -j1, wait for those objects to finish, then Control+C and finish off again with -j4. It still takes a considerable amount of time, but the binaries build fine.
If you want just the version 0.230 binaries, grab them from here (search the page for the word "executable":
@elvis thanks for the feedback about cross compiling. gonna research it a bit
elvis last edited by
I've managed to set up a cross-compile environment, and get a working MAME 0.230 build for Raspbian Buster 32bit armhf.
Documentation is here:
If anyone attempts this, please let me know whether you were successful or not.