-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_python_debug.sh
25 lines (22 loc) · 1.09 KB
/
install_python_debug.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
DIR=$(pwd)
VERSION=3.7.10
wget https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz
tar -xvzf Python-$VERSION.tgz
cd Python-$VERSION
./configure --with-pydebug --without-pymalloc --with-valgrind --prefix /opt/debugpython/
sudo make OPT=-g && sudo make install
## Add python valgrind suppression file
cp $DIR/Python-$VERSION/Misc/valgrind-python.supp $HOME/workspace/incubator-mxnet
echo "export PATH=/usr/bin:/bin:/opt/debugpython/bin:\$PATH" >> ${HOME}/.bashrc
sudo update-alternatives --install /usr/bin/python python /opt/debugpython/bin/python3 10
/opt/debugpython/bin/python3 -m venv $HOME/virtualenv/pytest
source $HOME/virtualenv/pytest/bin/activate
/opt/debugpython/bin/python3 -m pip install numpy==1.19
/opt/debugpython/bin/python3 -m pip install scikit-learn
/opt/debugpython/bin/python3 -m pip install requests
/opt/debugpython/bin/python3 -m pip install contextvars
/opt/debugpython/bin/python3 -m pip install nose
/opt/debugpython/bin/python3 -m pip install pytest
deactivate
rm ../Python-$VERSION.tgz
echo "Uncomment PyObject_Free and PyObject_Realloc in the valgring suppression file."