Thank you @jamesobutler for the clarification regarding the current state of macOS arm64 support.
Based on the guidance, I am building 3D Slicer as x86_64 on Apple Silicon and running it under Rosetta 2.
I am working on a custom 3D Slicer application, and below are the exact commands and configuration I am using, followed by the errors I am encountering.
Build environment
-
macOS: 14.x (Apple Silicon, Mac Studio)
-
Architecture: x86_64 (Rosetta 2)
-
Xcode: Installed from /Applications/Xcode.app
-
Qt: 5.15.2 (clang_64)
-
CMake: system-installed
-
Custom Slicer build
CMake configuration used
cd ~/Slicer-Build
# Clean previous build
rm -rf Slicer-build
cmake \
-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=14.0 \
-DCMAKE_OSX_SYSROOT:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DQt5_DIR:PATH=/opt/Qt/5.15.2/clang_64/lib/cmake/Qt5 \
-DSlicer_USE_SYSTEM_QT:BOOL=ON \
-DSlicer_USE_SimpleITK:BOOL=OFF \
-DSlicer_USE_PYTHONQT:BOOL=OFF \
-DSlicer_USE_PYTHON:BOOL=ON \
-S ~/Slicer-Source \
-B .
Build command
cmake --build . -j4 2>&1 | tee build.log
When attempting to build Python explicitly:
cmake --build . --target python -j4 2>&1 | tee python-build.log
Build errors encountered
During the build, I encounter the following error related to Python headers:
/Users/archiwizstudio/Slicer-Source/Base/QTCore/qSlicerCoreApplication.cxx:1216:8:
error: unknown type name 'Py_ssize_t'; did you mean 'ssize_t'?
Additional output:
[ 47%] Built target qMRMLWidgets
make[3]: *** [all] Error 2
make[2]: *** [Slicer-prefix/src/Slicer-stamp/Slicer-build] Error 2
make[1]: *** [CMakeFiles/Slicer.dir/all] Error 2
make: *** [all] Error 2
Attempting to build the Python target directly results in:
make: *** No rule to make target `python'. Stop.
CMake cache confirmation
grep -i "Slicer_USE_PYTHON" CMakeCache.txt
Output:
Slicer_USE_PYTHON:BOOL=ON
Slicer_USE_PYTHONQT:BOOL=OFF
No Python include or library paths appear to be populated:
grep -i "PYTHON" CMakeCache.txt | grep -i "DIR\|INCLUDE\|LIBRARY"
Questions
-
Is this Python error (Py_ssize_t not found) expected when using system Python with Slicer_USE_PYTHON=ON?
-
Is it required to use Slicer SuperBuild–provided Python instead of system Python on macOS?
-
Are there recommended Python versions (e.g., 3.9 / 3.10) known to work reliably for x86_64 Rosetta builds?
-
Does this configuration depend on a specific Xcode version for successful Python integration?
Any guidance or recommended build scripts for resolving Python-related build issues on Apple Silicon (x86_64 via Rosetta) would be greatly appreciated.
this is the systmem information
System
OS: macOS 26.2
Build: 25C56
Kernel: Darwin 25.2.0
Machine Architecture: arm64
Rosetta Translation: NO (sysctl.proc_translated = 0)
Xcode
Xcode Version: 26.2
Xcode Build: 17C52
Xcode Path: /Applications/Xcode.app/Contents/Developer
macOS SDK: MacOSX26.2.sdk
SDK Version: 26.2
Compiler
Compiler: Apple clang
Version: 17.0.0 (clang-1700.6.3.2)
Target: arm64-apple-darwin25.2.0
clang Binary: Universal (x86_64 + arm64e)
Build Tools
CMake Version: 4.2.1
CMake Provider: Kitware
Make Version: GNU Make 3.81
Make Binary: Universal (x86_64 + arm64e)
Ninja Version: 1.13.2
Ninja Binary: arm64 (/opt/local/bin/ninja)
Qt
Qt Version: 5.15.2
QMake Version: 3.1
Qt Path: /opt/Qt/5.15.2/clang_64
Qt Architecture: x86_64
Qt5Core: /opt/Qt/5.15.2/clang_64/lib/libQt5Core.dylib
Python
python: not found
python3 Version: 3.14.2
python3 Path: /opt/homebrew/bin/python3
Python Architecture: arm64
Git
Git Version: (not reported)
Repository: Slicer (custom build)
Slicer Configuration (relevant flags)
Slicer_USE_PYTHON: ON
Slicer_USE_PYTHONQT: OFF
Slicer_USE_SYSTEM_QT: ON
Thank you for your help.