macOS: Universal2 build fails on SSE2
Hi,
We ship openPMD-api as binary wheels for python users containing c-blosc for postprocessing tasks.
With ARM being strong with the Apple M1 processors, we want to build universal2 wheels that contain both x86_64 and arm64 code. We produce them on macOS 11.0 x86_64 GitHub actions runners.
Multi-arch builds for macOS are very easy with CMake, we just need to set:
export CMAKE_OSX_ARCHITECTURES="arm64;x86_64"
Unfortunately, c-blosc SSE2 breaks the build for SSE2. The only alternative I have is to disable SSE2 acceleration altogether at the moment, which means that x86_64 code in the universal binary will not be accelerated either. Is there maybe a way to make this more flexible? :)
Refs.: https://developer.apple.com/documentation/apple-silicon/building-a-universal-macos-binary
X-ref: https://github.com/openPMD/openPMD-api/pull/1233
Hi,
There's a similar issue when building hdf5plugin for universal2 Python (see https://github.com/silx-kit/hdf5plugin/issues/186) which include blosc as a HDF5 compression filter.
Your reference says "For a list of compiler macros, see the compiler documentation.". Which compiler are you using?
The latest XCode LLVM that Apple ships aka AppleClang in CMake.
Thanks, I can't find a list of predefined macros for AppleClang but if you run the compiler like AppleClang --target=... -mcpu=... -E - -dM </dev/null it will output all the pre-defined preprocessor macros (similar works for gcc, too)
Build with make VERBOSE=1 to see the actual compiler binary and correct arch flags it uses.