Build issue on macOS when targetting x64 from ARM mac
I'm seeing the following in my build log, when building with -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" :
-- Default CPU architecture for KFR is neon64 (set KFR_ARCH to override)
Incorrect architecture set by KFR_ARCH: neon64
Most likely the cpu detector should handle rosetta ? Also, I wonder, how is the lib supposed to handle fat macOS binaries ?
thanks !
Fat binaries aren't supported at this moment because KFR requires specific compiler flags to enable SIMD and these flags are platform-specific. CMake doesn't provide a convenient way to set arch-specific flags. So CMAKE_OSX_ARCHITECTURES should be set to either x86_64 or arm64 in a single build. Note that binaries built this way can be easily merged into a fat library.
Hi,
KFR 7 supports fat binaries, see latest release.
How to enable when building: https://github.com/kfrlib/kfr/blob/main/docs/docs/kb.md#how-to-build-kfr-on-macos-with-universal-binaries