-
Notifications
You must be signed in to change notification settings - Fork 239
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
macOS Apple Silicon support #415
Conversation
You need to fix the Windows build. The transcodetest build is exiting due to a multiply defined symbol in basisu_c_binding.lib and ktx.lib. It's the etc1s global codebook. There is a cmake/c program to detect the cpu type: cmake/cputypetest.cmake. It needs fixing to recognize the M1. Clearly it is currently returning x86_64 because the SSE option in CMake is disabled for every other case. Please look at fixing it. It's a bit of a hack right now for reasons explained in comments there. |
When I switched the CI build to Xcode 12.4 it started overrunning Travis's 4MB log file limit so I changed it to use cmake --build . --config Release -- -quiet |
As well as fixing the Windows build, please add info about building for the M1 to BUILDING.md. Do we need to change anything in the iOS build for the new m1 iPad? One thing that comes to mind for both macOS and iOS is the set of transcode targets supported. The M1 supports all modern formats and PVRTC so we should include all transcoders. It will be good for testing. |
For whatever reason, iOS on M1 does not support BC* formats. |
…ject libraries, so I turned them to static libraries.
…n). Requires recent Xcode 12.
…hitecture while the CLI tools and libraries are still multi-arch
…ilds, because Apple Silicon (arm64) won't compile. The disadvantage is that the Intel (x86_64) architecture won't support it either. see BinomialLLC/basis_universal#123 (comment)
I think I found a way around this difference in linking behaviour.. let's see what the CI results in.
I agree, but I don't see how this can be fixed at configuration time (only) for universal libraries. That's why I think BasisU should do some sort of compile time feature detection. |
I'll look at it.
My rather uninformed gut feeling answer would be no. and I feel a bit confirmed by @lexaknyazev saying iOS/M1 doesn't support BC*.
Good point. I'll have a look. |
Done
As far as I can see there is no configuration time preselection of supported transcode targets (except for WebGL). It would be good if we can make a smart per-platform preselection and offer CMake options that users can tweak, but:
|
I added detection of Apple Silicon to this script. This is now used to prevent cross compiling load tests apps on M1 to Intel. Still, this only detects the host's architecture and not the target architecture(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good except from several typos in BUILDING.md
. There are also a couple of questions in the review. The one on build_macos.sh
definitely needs an answer.
Caveats: * Load tests apps only support Intel macs. * SSE support is disabled in Universal binary builds due to absence of run-time detection.
Caveats: * Load tests apps only support Intel macs. * SSE support is disabled in Universal binary builds due to absence of run-time detection.
Caveats: * Load tests apps only support Intel macs. * SSE support is disabled in Universal binary builds due to absence of run-time detection.
Caveats: * Load tests apps only support Intel macs. * SSE support is disabled in Universal binary builds due to absence of run-time detection.
Caveats: * Load tests apps only support Intel macs. * SSE support is disabled in Universal binary builds due to absence of run-time detection.
This patch enables building macOS binaries that support Apple Silicon (arm64) platform or universal binaries supporting both Intel (x86_64) and Apple Silicon Macs.
There's a catch:
Basis Universal SSE support has to be disabled, in arm builds and even in universal builds. SSE support is detected at configuration time, but a fat arm/intel binary would require detecting it at compile time per architecture.
I've changed the CI build to create universal binaries and disabled SSE for now Alternative solutions could be:
I've mentioned this to BasisU in this comment.