Компиляция Python (3.13) с использованием собственного пути к библиотеке ncursesPython

Программы на Python
Ответить
Anonymous
 Компиляция Python (3.13) с использованием собственного пути к библиотеке ncurses

Сообщение Anonymous »

Я хотел бы скомпилировать Python 3.13 (на CentOS 7.9), но мои скомпилированные библиотеки ncurses находятся в нестандартном расположении (

Код: Выделить всё

~/custom/gcc-14.2/lib/
).
Следуя документации по конфигурации, я определяю CURSES_LIBS

Код: Выделить всё

# I use a custom compiler:
export CC=gcc-14.2 CXX=g++-14.2

# PWD is Python3.13.0
# I compile in a subfolder:
mkdir build && cd build

CURSES_LIBS="-L$HOME/custom/gcc-14.2" ../configure \
--prefix=$HOME/custom/gcc-14.2 \
--enable-loadable-sqlite-extensions \
--enable-optimizations --with-lto \
--with-platlibdir=lib64 \
--with-ensurepip=install \
--enable-shared
но стандартный вывод содержит следующие строки:

Код: Выделить всё

checking for ncursesw... no
checking for ncurses... no
checking for ncursesw/curses.h... no
checking for ncursesw/ncurses.h... no
checking for ncursesw/panel.h... no
checking for ncurses/curses.h... no
checking for ncurses/ncurses.h... no
checking for ncurses/panel.h... no
checking for curses.h... no
checking for ncurses.h... no
а затем при запуске make я получаю следующие ошибки (сокращенно):

Код: Выделить всё

[...]

gcc-14.2 -pthread  -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall    -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c11 -Wext
ra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-generate -I../Include/internal -I../Include/i
nternal/mimalloc -IObjects -IInclude -IPython -I.  -I../Include   -fPIC -fPIC -c ../Modules/_cursesmodule.c -o Modules/_cursesmodule.o
In file included from ../Modules/_cursesmodule.c:116:
../Include/py_curses.h:80:5: error: unknown type name ‘WINDOW’
80 |     WINDOW *win;
|     ^~~~~~
../Modules/_cursesmodule.c:173:36: error: ‘FALSE’ undeclared here (not in a function)
173 | static int initialised_setupterm = FALSE;
|                                    ^~~~~
../Modules/_cursesmodule.c: In function ‘PyCursesCheckERR’:
../Modules/_cursesmodule.c:213:17: error: ‘ERR’ undeclared (first use in this function); did you mean ‘ERA’?
213 |     if (code != ERR) {
|                 ^~~
|                 ERA

[...]

../Modules/_cursesmodule.c: In function ‘_curses_start_color_impl’:
../Modules/_cursesmodule.c:4228:1: warning: control reaches end of non-void function [-Wreturn-type]
4228 | }
| ^
../Modules/_cursesmodule.c: In function ‘_curses_meta_impl’:
../Modules/_cursesmodule.c:3624:1: warning: control reaches end of non-void function [-Wreturn-type]
3624 | }
| ^
make[2]: *** [Modules/_cursesmodule.o] Erreur 1
make[1]: *** [profile-gen-stamp] Erreur 2
make: *** [profile-run-stamp] Erreur 2
Кроме того, исполняемый файл, установленный с помощью make install, не может быть запущен:

Код: Выделить всё

$ ~/custom/gcc-14.2/bin/python3.13 -c 'print("Hello")'

Код: Выделить всё

Could not find platform independent libraries 
Could not find platform dependent libraries 
Fatal Python error: Failed to import encodings module
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007fd963713780 (most recent call first):

Есть идеи, как правильно определить CURSES_LIBS? Или еще что-то нужно настроить?


Подробнее здесь: https://stackoverflow.com/questions/792 ... brary-path
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»