Short instruction how to succefully complie cpython from source code on M2.
You need to sure that xcode installed or
xcode-select --install
We need to install with brew:
brew install openssl xz zlib gdbm sqlite gcc
Git clone cpython. My case is heads/v3.9.0b1
git clone https://github.com/python/cpython
CD to cpython folder
Compile:
CPPFLAGS="-I$(brew --prefix zlib)/include" \
LDFLAGS="-L$(brew --prefix zlib)/lib" \
CC=/opt/homebrew/bin/gcc-13 \
arch -x86_64 \
./configure --with-openssl=$(brew --prefix openssl) \
--with-pydebug
Top comments (0)