Error compiling Python3.11.1 on rockylinux

I am able to compile python 3.10 but not 3.11. I get errors such as:

/usr/bin/ld: cannot find Programs/_freeze_module.o: No such file or directory
/usr/bin/ld: cannot find Modules/getpath_noop.o: No such file or directory
/usr/bin/ld: cannot find Parser/token.o: No such file or directory
/usr/bin/ld: cannot find Parser/pegen.o: No such file or directory
/usr/bin/ld: cannot find Parser/pegen_errors.o: No such file or directory
/usr/bin/ld: cannot find Parser/action_helpers.o: No such file or directory
/usr/bin/ld: cannot find Parser/parser.o: No such file or directory
/usr/bin/ld: cannot find Parser/string_parser.o: No such file or directory
/usr/bin/ld: cannot find Parser/peg_api.o: No such file or directory
/usr/bin/ld: cannot find Parser/myreadline.o: No such file or directory
/usr/bin/ld: cannot find Parser/tokenizer.o: No such file or directory
/usr/bin/ld: cannot find Objects/abstract.o: No such file or directory

I am using docker and rockylinux. This is my build process including docker commands

docker pull rockylinux:9.1.20221221-minimal
docker run --name pydev -it rockylinux:9.1.20221221-minimal bash
microdnf -y update
microdnf -y install gcc
microdnf -y install openssl-devel
microdnf -y install tar
microdnf -y install bzip2-devel
microdnf -y install libffi-devel
microdnf -y install zlib-devel
microdnf install -y findutils

cd /tmp
curl -OL https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tgz
tar xzf Python-3.11.1.tgz
cd Python-3.11.1
./configure --prefix=/usr/local --enable-optimizations --enable-shared LDFLAGS=“-Wl,–rpath=/usr/local/lib”
make -j$(nproc) altinstall

If you can edit the title, add ‘on rocklinux’.

1 Like