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

macOS: Universal2 build fails on SSE2 #334

Open
ax3l opened this issue Mar 21, 2022 · 4 comments
Open

macOS: Universal2 build fails on SSE2 #334

ax3l opened this issue Mar 21, 2022 · 4 comments

Comments

@ax3l
Copy link
Contributor

ax3l commented Mar 21, 2022

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: openPMD/openPMD-api#1233

@t20100
Copy link
Contributor

t20100 commented Oct 19, 2022

Hi,

There's a similar issue when building hdf5plugin for universal2 Python (see silx-kit/hdf5plugin#186) which include blosc as a HDF5 compression filter.

@kalvdans
Copy link
Contributor

Your reference says "For a list of compiler macros, see the compiler documentation.". Which compiler are you using?

@ax3l
Copy link
Contributor Author

ax3l commented Oct 20, 2022

The latest XCode LLVM that Apple ships aka AppleClang in CMake.

@kalvdans
Copy link
Contributor

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.

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

No branches or pull requests

3 participants