Home Page

Mac compile fails

Posted By: CRP

Mac compile fails - 11/12/19 07:41 PM

Hi, I compile mame for macos myself by cloning the github source, then running make. Lately, I keep getting errors like this:

Code
Archiving libformats.a...
fatal error: /Library/Developer/CommandLineTools/usr/bin/ranlib: can't move the output file to its final location: ../../../../osx_clang/bin/x64/Release/mame_mame/libformats.a (Resource busy)
/Library/Developer/CommandLineTools/usr/bin/ar: internal ranlib command failed
make[2]: *** [../../../../osx_clang/bin/x64/Release/mame_mame/libformats.a] Error 1
make[1]: *** [formats] Error 2
make: *** [macosx_x64_clang] Error 2


If I run make again it fails at a different point. Not sure what's wrong here... any ideas?
Posted By: will

Re: Mac compile fails - 11/12/19 08:43 PM

I just compiled mame from the GitHub source yesterday without a problem. I'm running 10.15.1 and SDL 2.0.10

Have you installed the latest Xcode? Tell us which macOS version you're running and what kind of Mac you have.
Posted By: CRP

Re: Mac compile fails - 11/12/19 09:00 PM

macos ver 10.15.1

Mac Mini 2018
3 GHz 6-Core Intel Core i5

I am using Command Line Tools

clang -v
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Posted By: will

Re: Mac compile fails - 11/12/19 09:07 PM

I have a slightly newer clang (?) - don't know if installing latest Xcode would help.

clang -v
Apple clang version 11.0.0 (clang-1100.0.33.12)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Posted By: R. Belmont

Re: Mac compile fails - 11/12/19 09:13 PM

Is MAME running when you're trying to compile? That's usually what "Resource busy" means. I build at least once a day on my MacBook Pro and haven't had any problems.
Posted By: CRP

Re: Mac compile fails - 11/13/19 07:32 PM

no, mame is not running. I am really at a loss about these errors...
Posted By: CRP

Re: Mac compile fails - 11/14/19 07:32 PM

I was compiling with the source files on my NAS. If I compile with files on the local HD everything works fine. Not sure what the NAS is doing, but it generates those Resource Busy messages...
Posted By: belegdol

Re: Mac compile fails - 11/14/19 08:39 PM

Probably the latency introduced by the NAS is causing race conditions.
Posted By: Robert Hildinger

Re: Mac compile fails - 11/14/19 09:03 PM

Agreed. You can try adjusting your parallel build level to see if you can accomplish a build from NAS. Of course -j1 should avoid race conditions, but will be very, very slow...
Posted By: R. Belmont

Re: Mac compile fails - 11/14/19 09:23 PM

Is the NAS mounted via NFS or SMB? In my experience, NFS on macOS got flakey somewhere around 10.9 or 10.10 and hasn't improved since. I switched my MacBook to use SMB mounts instead of NFS and it's been totally stable (and gotten faster transfers).
Posted By: CRP

Re: Mac compile fails - 11/30/19 12:50 PM

I have tried remounting the NAS as smb, then I have re-cloned the git repository, and finally I run "make -j 1". compile always fails with the following message:

Generating ../build/projects/sdl/mame/gmake-osx-clang/mame.make...
Done. Generated 364/364 projects.
Creating ../../../../osx_clang/bin/x64/Release
Precompiling src/emu/emu.h...
Compiling src/emu/drivers/empty.cpp...
fatal error: malformed or corrupted AST file: 'malformed block record in AST file'
1 error generated.
make[2]: *** [../../../../osx_clang/obj/x64/Release/src/emu/drivers/empty.o] Error 1
make[1]: *** [precompile] Error 2
make: *** [macosx_x64_clang] Error 2
Posted By: R. Belmont

Re: Mac compile fails - 11/30/19 03:55 PM

That's an internal Clang error. Apparently it can happen if there's bad/stale data in ~/Library/Developer/Xcode/DerivedData/ModuleCache, so deleting the contents of that directory can help.
Posted By: CRP

Re: Mac compile fails - 11/30/19 04:37 PM

Thanks, I found a similar suggestion online, but there is no Developer folder in my Library. btw I am just using Command Line tools (which has always worked in the past for me). Do I need a full XCode installation?
Posted By: R. Belmont

Re: Mac compile fails - 11/30/19 05:19 PM

No, you shouldn't need a full install. I guess for now the advice is to only compile MAME on your Mac's internal drive, and then move it to external afterwards.
Posted By: CRP

Re: Mac compile fails - 11/30/19 05:37 PM

I will do that, thanks for your help!
© 2020 Forums