Summary
pyenv で python をインストールすると arm64-apple が認識できない。checking build system type... Invalid configuration `arm64-apple-darwin20.4.0': machine `arm64-apple' not recognized
configure: error: /bin/sh ./config.sub arm64-apple-darwin20.4.0 failed
config.sub を入れ替えて configure
$ cd /var/folders/PATH/TO/python-build.YYYYMMDDhhmmss.xxxxx.XXXXXX/Python3.10.0a5
$ mv config.sub config.sub.bak
$ wget https://raw.githubusercontent.com/gcc-mirror/gcc/master/config.sub
$ cd ..
$ ./configure --prefix=$(pyenv root)/versions/3.10.0a5 \
--enable-unicode=ucs4 \
--with-openssl=$(brew --prefix openssl) \
--enable-optimizations
$ make
$ make install
symlinkを作成
$ cd $(pyenv prefix)/bin
$ ln -s python3.10 python
$ ln -s pydoc3.10 pydpc
$ ln -s idle3.10 idle
$ ln -s pip3.10 pip
確認
$ pyenv global 3.10.0a5
$ python --version
Python3.10.0a5
$ lipo -archs $(pyenv prefix)/bin/python3.10
arm64
課題: Universal binary でmakeできていない
PATH/TO/Python-3.x.x/Mac/README.rst を参照$ ./configure --enable-universalsdk \
--with-universal-archs=universal2