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
How do i compile for Apple Silicon? M1? #486
Comments
I have a fork here that reportedly works with Apple Silicon, you build the makefile for arm64: https://github.com/tomkidd/ioq3/tree/xcode There's also an updated Xcode project in the I don't have an M1 processor myself but I have at least one report of it working. There's a PR with it we haven't merged yet, if you wouldn't mind please report back here on how well works for you. |
./make-macosx.sh arm64 Opening the ioquake3.xcworkspace in misc/xcode and building the target ioqake3 on an M1 Mac results in several errors: /ioq3/misc/xcode/renderer_opengl1.xcodeproj The linked library 'libSDL2-2.0.0.dylib' is missing one or more architectures required by this target: arm64. |
If you have cloned my particular fork (tomkidd/ioq3) make sure you have switched to the "xcode" branch. |
Thank you for the response. It compiled successfully, however running ioq3/build/release-darwin-arm64/ioquake3.app results in
|
Yeah this is pretty much where we're at - it doesn't like the code signing of the SDL library. However the error you're pasting there is different than what I've seen before (and I recently updated it) so that's progress. Some reading indicates that macOS on M1 are less forgiving about unsigned libraries (the Intel version loads the unsigned library fine) so I can try something and do another checkin later. Until I can get real hardware this "toss it over the wall" approach is all we've got. |
I can try to look at the codesigning and see if I can figure it out. If I
do, I’ll make a PR
|
Interestingly enough, the Xcode project throws different errors when targeting the M1 Mac (my Mac):
|
lipo -archs /Users/*/Library/Developer/Xcode/DerivedData/ioquake3-gfvzchdfjqprxbgkpemjmvmyrzvv/Build/Products/Debug/renderer_opengl1.dylib Returns only x86_64. Looking into it now. |
In the Xcode project be sure to build the "all ioquake3" scheme before firing off the "ioquake3 - baseq3" scheme (the one with the icon) This is how the project has always worked but I may change that. But the "all ioquake3" scheme should be building the renderers, etc. for ARM64. |
Yep, I just figured that out. Had to also clean the build folder and it's now successfully compiling. I'm going to see if I can use the ioquake3.app file with Urban Terror |
Note that, for reasons I haven't sussed out yet, the "ioquake3.app" that Xcode comes up with (as in, what it buries in DerivedData) won't actually run outside of being attached to an Xcode debugger. This happens on Intel too. In the interim you can fire off mods with either command line arguments in the scheme editor or (possibly) the mods menu in the game. My guess is that the reason you don't get the code signing error on SDL2 when running from Xcode is that Xcode is just signing the thing for you well enough for it to use it. |
IT WORKS! I tried both plain Quake 3 and also Urban Terror. For those getting here looking for Urban Terror, you need to set the hunk megs in the command console (using tilde ~), before you launch the mod from the menu. I could not get the UT mod to launch using the scheme editor's launch argument. Performance seemed better than before, but not as good as the Intel MacBook. Agreed on the code signing error vs running it from Xcode. I tried archiving it with code signing, but got an error with not finding cgame.dylib |
Some information I'm reading says that dylibs on M1 have to be at least ad hoc signed. I don't know if me doing that will fix it for everyone or not but in any event I've gone in and ad hoc signed libSDL2-2.0.0.dylib and checked it in, if you could try the makefile version of the build I'd appreciate it. |
make-macosx.sh arm64 outputs a binary that just works! Do you have a link of the source you found that helped with this re: ad hoc signing? |
Guys, for xcode beginners (as myself), a step by step tutorial on how the build process should be executed would be welcomed |
I found a couple of things mentioning it and gave them a shot https://bogo.wtf/arm64-to-sim-dylibs.html https://discourse.panda3d.org/t/pip-install-om-m1-mac-works-after-some-pain/27360/6 So, are you saying that when running |
One we get everything sorted out with this that will be something we address, though for right now the short version is To build the ioquake3.app for your architecture of choice The result will be in the The actual Xcode project is a different affair, you use that if you want to do debugging or have an IDE to edit files with. The scripts above use the Makefile, the Xcode project does not. |
An M1 build is now available! https://ioquake3.org/ioquake3/legacy-and-m1-macos-ioquake3-support/ |
The code to compile for M1 is now in the main branch. |
Is it possible to compile for the Apple Silicone M1 chip? If is, how do I proceed with that?
The text was updated successfully, but these errors were encountered: