WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Lost while trying to compile Python 3.11.1  (Read 1040 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14231
Re: Lost while trying to compile Python 3.11.1
« Reply #15 on: January 21, 2023, 11:10:45 PM »
This seems to cure the ncurses problem:

edit setup.py to read:
curses_includes.append('/usr/local/include/ncursesw')
« Last Edit: January 21, 2023, 11:23:27 PM by Juanito »

Offline elcouz

  • Newbie
  • *
  • Posts: 16
Re: Lost while trying to compile Python 3.11.1
« Reply #16 on: January 25, 2023, 01:28:06 PM »
This seems to cure the ncurses problem:

edit setup.py to read:
curses_includes.append('/usr/local/include/ncursesw')

I forgot to mention this was already done since the beginning.

But anyway I kinda redneck my way through compilation (after many many tries) of Python 3.11.1...

To successfully compile it I needed to ditch the CFLAGS/CXXFLAGS flags.

This is the step I did:

- Extract source files
- edit setup.py to change curses_includes.append path to /usr/local/include/ncursesw
- ./configure --prefix=/usr/local --enable-shared --enable-optimizations <--- slower but worth it
- make -j -l 4
- make altinstall DESTDIR=/tmp/python3.11
- mksquashfs /tmp/python3.11 python3.11.tcz
- cp /tmp/python3.11.tcz /mnt/mmcblkp2/tce/optional

If I added the CFLAGS/CXXFLAGS flags, make will always fail afterward ... I tried many flags settings ... spend two days watching compilation fails :'(

tce-load -i python3.11

all good now ,,, thanks!
« Last Edit: January 25, 2023, 01:31:33 PM by elcouz »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14231
Re: Lost while trying to compile Python 3.11.1
« Reply #17 on: January 25, 2023, 10:30:24 PM »
I just tested on an RPi3 running piCore-13.1 and this works:
Code: [Select]
tce-load -i compiletc sqlite3-dev tk-dev glib2-dev gdbm-dev libEGL-dev readline-dev liblzma-dev openssl-dev

wget https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tar.xz
tar xf *tar*
cd Python-3.11.1

edit setup.py
curses_includes.append('/usr/local/include/ncursesw')

CPPFLAGS="-I/usr/local/include/ncursesw" CC="gcc -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe" CXX="g++ -mtune=-march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -Os -pipe -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local --localstatedir=/var --enable-shared --with-system-expat --with-system-ffi --with-ensurepip=yes

find . -name Makefile -type f -exec sed -i 's/-g -O2//g' {} \;
find . -name Makefile -type f -exec sed -i 's/-g  -O3//g' {} \;
find . -name Makefile -type f -exec sed -i 's/flto-partition=none -g/flto-partition=none/g' {} \;

make [12m 38.39s]
sudo make install