Author Topic: Compiling under MacOS: Anyone Successful?  (Read 3768 times)

estefan3112

  • Full Member
  • ***
  • Posts: 35
    • View Profile
    • Retrogaming on my Mac
Compiling under MacOS: Anyone Successful?
« on: March 16, 2022, 05:33:55 AM »
Hi there, as we have a new version of Attract Mode, I tried to compile under MacOS, but get errors both on an Intel Mac (where it worked before) and on my newer M1 Mac Mini (SFML-related errors, though installed via Homebrew). I wonder whether anybody has been successful in compiling AttractMode on a Mac? Any advice would be highly appreciated. Thanks!

Mark Norville

  • Sr. Member
  • ****
  • Posts: 233
    • View Profile
Re: Compiling under MacOS: Anyone Successful?
« Reply #1 on: March 16, 2022, 05:44:45 AM »
You did say any advice?

Switch to windows? lol

Sorry I cannot help you, but hopefully someone can, if you have complied this before without any problems, it might be a bug or something wrong with the new version.

So you might have to report it on the git hub page.

I don't think that I have seen many Mac users to be honest, from what I have seen most of us are on Windows, a few on Pi, but Progrets might have a better understanding of all systems.

Regards

Mark
Well I am back a new PC I7 4790K, 780 TI, 16 Gigs, Windows 10. Hopefully will get delivered at weekend.

Computer Specs : I7 3770K, 780 TI, 16 Gigs, Win 10
HD Specs : 1 x 1 TB SSD + 4 x 8 TB = 33 TB (fullish)
First system : ZX81 (Yes I am an old fart)
PS Network : MarkNorvile
Xbox : Mark Norville

estefan3112

  • Full Member
  • ***
  • Posts: 35
    • View Profile
    • Retrogaming on my Mac
Re: Compiling under MacOS: Anyone Successful?
« Reply #2 on: March 16, 2022, 12:05:10 PM »
Well, I compiled Attract Mode until 2.6.1 and some time beyond, you also see the dmg under Downloads for 2.6.1. AM is one of the very few Mac frontends- and 2.6.1 still works flawlessly. Wanted to ask prior to a GitHub issue. Best, Stefan

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1235
    • View Profile
    • My deviantart page
Re: Compiling under MacOS: Anyone Successful?
« Reply #3 on: March 16, 2022, 11:16:57 PM »
Hi there, as we have a new version of Attract Mode, I tried to compile under MacOS, but get errors both on an Intel Mac (where it worked before) and on my newer M1 Mac Mini (SFML-related errors, though installed via Homebrew). I wonder whether anybody has been successful in compiling AttractMode on a Mac? Any advice would be highly appreciated. Thanks!

Hi, I'm a macOS user, and also an Attract Mode layout developer, as you said I started using AM because there are not many alternatives for macOS, then I got engaged... I never compiled AM for macOS though, but why don't you try the new Attract Mode Plus fork? There are compiled binaries for macOS, they need homebrew installed at the moment, and a bit of tweaking to make it work as a pacakged app, but I've gone through that route so if you need help I can give you some guidance.

estefan3112

  • Full Member
  • ***
  • Posts: 35
    • View Profile
    • Retrogaming on my Mac
Re: Compiling under MacOS: Anyone Successful?
« Reply #4 on: March 18, 2022, 06:09:57 AM »
Many thanks indeed! I was not aware that Oomek did a fork, will try it out and report it in my blog if successful. Great news!

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1235
    • View Profile
    • My deviantart page
Re: Compiling under MacOS: Anyone Successful?
« Reply #5 on: March 18, 2022, 12:42:23 PM »
Many thanks indeed! I was not aware that Oomek did a fork, will try it out and report it in my blog if successful. Great news!

Wait, I just realised that you are the man behind MAME on Modern Macs! Your blog was an invaluable source of information when I decided to use MAME native on my Mac, instead of using Parallels to emulate Windows. I learned the basics of Attract Mode there, and then started this little layout project (Arcadeflow) that is now turning four years old :D thank you for your efforts and keep up the good work!

estefan3112

  • Full Member
  • ***
  • Posts: 35
    • View Profile
    • Retrogaming on my Mac
Re: Compiling under MacOS: Anyone Successful?
« Reply #6 on: March 18, 2022, 02:00:50 PM »
Thanks, a real pleasure! By the way, the AttractPlus does not work for me, as I am on an Apple M1 and AttractPlus needs x64 libraries. I even experimented with a parallel install of homebrew-x64 into usr/local/ - but that goes into nightmares. Without a dmg bundle, I will be out of luck...so staying with 2.6.1 for the time being and crossing fingers... Cheers!

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1235
    • View Profile
    • My deviantart page
Re: Compiling under MacOS: Anyone Successful?
« Reply #7 on: March 19, 2022, 01:46:10 AM »
I have no idea if this will help in the case of an M1, but I had to tweak the attractplus binary to package it into a dmg.

Basically I took an old attract mode dmg and substituted the executable with attractplus, then I added the SFML libraries compiled by Oomek in the package and changed the rpath of attractplus to point to them. Now I have a "packaged" dmg for attractplus that relies on homebrew only for libjpeg, fontconfig and ffmpeg@4.

Not sure if this can help you, I can share the dmg on my server if you want to try it, but if the issue is using homebrew provided libraries with an x86 executable then we are out of luck... would it be better if all the libraries were included in the dmg? Because I tried in the past but I failed miserably in changing all the library pointers :D

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1235
    • View Profile
    • My deviantart page
Re: Compiling under MacOS: Anyone Successful?
« Reply #8 on: March 20, 2022, 12:42:58 PM »
Thanks, a real pleasure! By the way, the AttractPlus does not work for me, as I am on an Apple M1 and AttractPlus needs x64 libraries. I even experimented with a parallel install of homebrew-x64 into usr/local/ - but that goes into nightmares. Without a dmg bundle, I will be out of luck...so staying with 2.6.1 for the time being and crossing fingers... Cheers!

Estefan, I was able to package a veriosn of attractplus into a dmg, with all the needed libraries in the dmg package. Do you think this can help you in testing on the M1 mac, or the fact that these are still x86 libs will be a problem?

estefan3112

  • Full Member
  • ***
  • Posts: 35
    • View Profile
    • Retrogaming on my Mac
Re: Compiling under MacOS: Anyone Successful?
« Reply #9 on: March 22, 2022, 07:02:26 AM »
That‘s the problem: The dylibs compiled for x64 must not be mixed with Silicon dylibs (error). So the pre-compiled libraries must be completed with the missing dylibs in x64 - and for this I would have to install Hombrew x64 in parallel. I tried it, and it‘s a bit of overkill and nightmare. This is why a fully packaged dmg containing all x64 libraries would be required for running it in Rosetta2.

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1235
    • View Profile
    • My deviantart page
Re: Compiling under MacOS: Anyone Successful?
« Reply #10 on: March 22, 2022, 07:28:12 AM »
That‘s the problem: The dylibs compiled for x64 must not be mixed with Silicon dylibs (error). So the pre-compiled libraries must be completed with the missing dylibs in x64 - and for this I would have to install Hombrew x64 in parallel. I tried it, and it‘s a bit of overkill and nightmare. This is why a fully packaged dmg containing all x64 libraries would be required for running it in Rosetta2.

So, correct me if I'm wrong, but when you say that _all_ dylibs must be in x64 you mean not only the SFML compiled by Oomek and homebrew libraries used by AM like ffmpeg etc, but also all standard macOS libraries?

This is the link to the dmg with SFML and homebrew libraries included, not sure if other dylibs are missing http://www.mixandmatch.it/AF/amplus/AttractPLUS.app.zip

estefan3112

  • Full Member
  • ***
  • Posts: 35
    • View Profile
    • Retrogaming on my Mac
Re: Compiling under MacOS: Anyone Successful?
« Reply #11 on: March 25, 2022, 02:58:17 PM »
Many thanks, but I am still missing libbz2.dylib, and there might be more missing. Still hoping for a nice dmg from here, I see that further commits come in...

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1235
    • View Profile
    • My deviantart page
Re: Compiling under MacOS: Anyone Successful?
« Reply #12 on: March 27, 2022, 11:57:32 PM »
Many thanks, but I am still missing libbz2.dylib, and there might be more missing. Still hoping for a nice dmg from here, I see that further commits come in...

I didn't change libbz2.dylib source because it pointed to /usr/lib and I thought this was part of the OS, but from your feedback it seems that I have to package _all_ x86 libraries, included system ones, not just the ones that come with Homebrew?

estefan3112

  • Full Member
  • ***
  • Posts: 35
    • View Profile
    • Retrogaming on my Mac
Re: Compiling under MacOS: Anyone Successful?
« Reply #13 on: March 29, 2022, 10:35:00 AM »
Yes, this is how I understand it: For X64 applications on M1, all required libraries need to be available in their x64 version as well. That‘s why x64 dmg packages are so crucial on M1 systems - they are self sufficient. Separate dylibs are a messy venture.

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1235
    • View Profile
    • My deviantart page
Re: Compiling under MacOS: Anyone Successful?
« Reply #14 on: July 12, 2022, 11:36:23 PM »
Yes, this is how I understand it: For X64 applications on M1, all required libraries need to be available in their x64 version as well. That‘s why x64 dmg packages are so crucial on M1 systems - they are self sufficient. Separate dylibs are a messy venture.

A user forked attractplus and made a version for Apple Silicon, maybe you can try it and report if it works :O https://github.com/oomek/attractplus/discussions/13