forked from albanD/pytorch_dev_env_setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
all_python.sh
executable file
·34 lines (28 loc) · 986 Bytes
/
all_python.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /bin/bash
set -e
VERSIONS=("3.6" "3.7" "3.8" "3.9")
MODES=("release" "debug")
INSTALL_HOME=${HOME}/local/installs
echo "Installing all pythons in ${INSTALL_HOME}"
for VERSION in "${VERSIONS[@]}"; do
for MODE in "${MODES[@]}"; do
if [ "${MODE}" = "release" ]; then
CONFIG_OPT="--enable-optimizations"
else
CONFIG_OPT="--with-pydebug"
fi
CURR_INSTALL_REPO=${INSTALL_HOME}/python${VERSION}/${MODE}/install
CURR_SOURCE_REPO=${INSTALL_HOME}/python${VERSION}/${MODE}/source
if [ -d ${CURR_SOURCE_REPO} ]; then
continue
fi
git clone [email protected]:python/cpython.git ${CURR_SOURCE_REPO}
pushd ${CURR_SOURCE_REPO}
git checkout ${VERSION}
./configure --prefix=${CURR_INSTALL_REPO} --with-ensurepip=install ${CONFIG_OPT}
make -j$(nproc)
make install
popd
${CURR_INSTALL_REPO}/bin/pip${VERSION} install virtualenv
done
done