Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add native support for Apple M1 chips #1058

Closed
xycaleth opened this issue Nov 20, 2020 · 15 comments · Fixed by #1164
Closed

Add native support for Apple M1 chips #1058

xycaleth opened this issue Nov 20, 2020 · 15 comments · Fixed by #1164

Comments

@xycaleth
Copy link
Member

My guess is there are some assumptions in the code that Apple means x86/x86_64. Would be good to remove all of these assumptions so that OpenJK can compile/run on Apple's new M1 devices which are ARM based.

@smcv
Copy link
Contributor

smcv commented Jan 25, 2021

These games are from the era in which Apple was synonymous with PowerPC hardware (Quake III Arena: 1999, Jedi Outcast: 2002, Jedi Academy: 2003, Apple transition to x86: 2006) so it would surprise me if there are "Apple = x86" assumptions.

As far as I know, the Apple M1 is a reasonably normal aarch64 (ARMv8A) CPU. OpenJK is regularly compiled for aarch64 Linux on Debian's infrastructure; I don't know of anyone actually testing the result (I don't have an aarch64 myself).

@xycaleth
Copy link
Member Author

Perhaps there weren't any assumptions at the time, but there's certainly a few since we ported the code to Mac (e.g. the binary extensions are assumed to be x86_64 for Mac). I had a quick try a few weeks ago and had to make a few changes. I didn't get very far cause I can't download the dependencies for the arm architecture.

@ghost
Copy link

ghost commented Mar 1, 2021

I'm not sure if it might be of any help but this guy got Jedi Academy running on an M1 Macbook Air via Rosetta 2 and SDL2, he used EternalJK, but I'm assuming it could be done with OpenJK as well. Now, I know you probably meant native support but this might be a good solution in the mean time.

@ensiform
Copy link
Member

ensiform commented Mar 1, 2021

SDL2 has native binary for aarch64 m1 chip via homebrew so just should not be an issue still. But plenty of places assume intel/x86* on mac.

@ghost
Copy link

ghost commented Mar 1, 2021

SDL2 has native binary for aarch64 m1 chip via homebrew so just should not be an issue still.

When I said "native" I meant without needing Rosetta or SDL2.

@ensiform
Copy link
Member

ensiform commented Mar 1, 2021

SDL2 is always going to be used in this project. It's integrated on all platforms.

@ghost
Copy link

ghost commented Mar 1, 2021

SDL2 is always going to be used in this project. It's integrated on all platforms.

Well, just without Rosetta then.

@ghost
Copy link

ghost commented Mar 1, 2021

This is the tutorial he mentioned in the video, according to him, the only extra step needed is to install Rosetta 2.

@xycaleth
Copy link
Member Author

xycaleth commented Mar 1, 2021

I'm not sure if it might be of any help but this guy got Jedi Academy running on an M1 Macbook Air via Rosetta 2 and SDL2, he used EternalJK, but I'm assuming it could be done with OpenJK as well. Now, I know you probably meant native support but this might be a good solution in the mean time.

I don't see any reason why OpenJK wouldn't run on Rosetta on an M1 Mac so I think we're in agreement there. This issue is just about having OpenJK run natively

@xycaleth xycaleth changed the title Support Apple M1 chips Add native support for Apple M1 chips Mar 1, 2021
@ghost
Copy link

ghost commented Mar 1, 2021

I don't see any reason why OpenJK wouldn't run on Rosetta on an M1 Mac so I think we're in agreement there. This issue is just about having OpenJK run natively

Ah, to be honest, I don't really care about it running natively, I just wanted a feasible way to run it on an M1 Mac, you should probably add a tutorial on the README for installing and running OpenJK on an M1 Mac, in case anyone else wants to play Jedi Academy on theirs, at least until you find a way to run it natively.

@eduardodesigner
Copy link

It is possible to run the latest compiled OpenJK OSX version from https://builds.openjk.org/ in a Macbook Air M1. All you need to do is find a libsdl2-2.0.0.dylib from another project and place it in /usr/local/lib.
I used the libsdl2-2.0.0.dylib from https://github.com/shinyquagsire23/OpenJKDF2

@jaiko
Copy link

jaiko commented Jan 28, 2022

#1115

@shinra-electric
Copy link

Users can download signed and notarised Universal 2 builds of OpenJK and OpenJO from Mac Source Ports, so this issue can probably be closed.

@ArminiusTux
Copy link

ArminiusTux commented Dec 27, 2023

I wonder how MacSilicon builds managed to take this compilation hurdle (MP only):

timing h_OpenJK

#1131

@shinra-electric
Copy link

I wonder how MacSilicon builds managed to take this compilation hurdle (MP only):

you can check you changes made on their github fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants