Last active
May 7, 2024 22:02
-
-
Save blazewicz/4bf9a656dadb52123a72e69456ae18ec to your computer and use it in GitHub Desktop.
pyenv - Install Python 3.x with optimizations on macOS with macports
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set +x | |
PY_VERSION=3.10.1 | |
export MAKE_OPTS="-j4" | |
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --enable-framework" | |
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-computed-gotos" | |
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-system-expat" | |
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-system-ffi" | |
#export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-ensurepip=no" | |
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --enable-ipv6" | |
# optimizations | |
#export CFLAGS="$CFLAGS -march=native" | |
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --enable-optimizations" | |
#export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-lto" | |
export CFLAGS="$CFLAGS -I$HOME/.pyenv/versions/$PY_VERSION/openssl/include" | |
export CFLAGS="$CFLAGS -I$HOME/.pyenv/versions/$PY_VERSION/readline/include" | |
export CFLAGS="$CFLAGS -I/opt/local/include" | |
export LDFLAGS="$LDFLAGS -L$HOME/.pyenv/versions/$PY_VERSION/openssl/lib" | |
export LDFLAGS="$LDFLAGS -L$HOME/.pyenv/versions/$PY_VERSION/readline/lib" | |
export LDFLAGS="$LDFLAGS -L/opt/local/lib" | |
export PKG_CONFIG=`which pkg-config` | |
pyenv install -v --force $PY_VERSION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the installation script. I am trying to get
pyenv
installing with my MacPorts distribution but I am not able to figure out whichport install
commands are needed to satisfy the dependencies during compilation of Python. Have you anything added to MacPorts such asopenssl
ortcl
to make the compilation work?