I installed Python 3.5 from source on Ubuntu 21.10.
sudo make install
...
...
...
if test "xupgrade" != "xno" ; then \
case upgrade in \
upgrade) ensurepip="--upgrade" ;; \
install|*) ensurepip="" ;; \
esac; \
./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Segmentation fault (core dumped)
make: *** [Makefile:1048: install] Error 139
What could be the reason?
What can I do to debug this?
Similar problem happened when I tried to install python 3.6 from sources on ubuntu 20.10.
Problem is described here: https://bugs.python.org/issue45700
Workaround which worked for me: after ./configure I have modified Makefile and Makefile.pre and changed optimization flags "O3" -> "O2":
OPT= -DNDEBUG -g -fwrapv -O3 -Wall # orig line
OPT= -DNDEBUG -g -fwrapv -O2 -Wall # fixed line
After this modification continue as usual: make, ...
Export PYTHON_CFLAGS with value '-O2', and you will fix installation via pyenv, asdf and probably others:
export PYTHON_CFLAGS='-O2'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With