Skip to content

Conversation

@sleepyeye
Copy link

When installing simpleimageio via pip on an Apple M1 (arm64) MacBook,
the build failed because the CMake configuration unconditionally enabled
x86-specific SSE compiler flags (-msse4.1 and -mpclmul).

These flags are not supported on non-x86 systems and cause compilation
errors such as:

clang++: error: unsupported option '-msse4.1' for target 'arm64-apple-darwin'
clang++: error: unsupported option '-mpclmul' for target 'arm64-apple-darwin'

This PR updates Core/CMakeLists.txt to skip adding the x86‐specific
compiler flags -msse4.1 and -mpclmul on non-x86 platforms
(e.g. macOS arm64).
These flags caused build failures on Apple Silicon (tested with M1).

Changes

  • Detect processor architecture with CMAKE_SYSTEM_PROCESSOR.
  • Apply -msse4.1 / -mpclmul only when building for x86_64/AMD64.
  • Define FPNG_NO_SSE=1 when building on other architectures.

With this change simpleimageio now builds successfully on macOS arm64.

@pgrit
Copy link
Owner

pgrit commented Oct 22, 2025

Thanks for the PR.
I suppose you are using clang, and not AppleClang, as your default C++ compiler? Because AppleClang ignores those flags and compiles fine.

@sleepyeye
Copy link
Author

Yes. My default compiler is Homebrew clang.

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

Successfully merging this pull request may close these issues.

2 participants