Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panel.h is not found even if it's installed on various flavours of SUSE #56480

Open
vclaudic mannequin opened this issue Jun 6, 2011 · 14 comments
Open

panel.h is not found even if it's installed on various flavours of SUSE #56480

vclaudic mannequin opened this issue Jun 6, 2011 · 14 comments
Labels
build The build process and cross-build

Comments

@vclaudic
Copy link
Mannequin

vclaudic mannequin commented Jun 6, 2011

BPO 12271
Nosy @doko42
Files
  • Building_error_SLES11SP1_ia64.txt.gz: Builind process + list of installed packages
  • find-panel-on-opensuse.patch
  • ken_ncurses.patch: patch
  • ken-ncurses-suse-update.patch: patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2011-06-06.13:00:37.899>
    labels = ['build']
    title = "panel.h is not found even if it's installed on various flavours of SUSE"
    updated_at = <Date 2019-10-11.10:39:29.840>
    user = 'https://bugs.python.org/vclaudic'

    bugs.python.org fields:

    activity = <Date 2019-10-11.10:39:29.840>
    actor = 'fbauzac'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Build']
    creation = <Date 2011-06-06.13:00:37.899>
    creator = 'v.claudic'
    dependencies = []
    files = ['22263', '26291', '29594', '29608']
    hgrepos = []
    issue_num = 12271
    keywords = ['patch']
    message_count = 9.0
    messages = ['137737', '137754', '137762', '161402', '164837', '185334', '185529', '185564', '354436']
    nosy_count = 6.0
    nosy_names = ['doko', 'catalin.iacob', 'v.claudic', 'hm', "Kenneth.O'Brien", 'fbauzac']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue12271'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    @vclaudic
    Copy link
    Mannequin Author

    vclaudic mannequin commented Jun 6, 2011

    Hello everybody,

    With the same build/compile command, I'm able to have "my" runing python version (2.6.x or 2.7.x) on IA64 server runing SLES 10 SP2/SP3,not on IA64 server runing SLES 11 SP1. I've try with 2.7, 2.7.1 and 2.7.2rc1 version without success.

    On both configuration types, I've installed all the available libraries, but on SLES 11 SP1, the make resulting message is the following (the complete building messages are in the joined gzip text file):

    ------------------
    ...
    Python build finished, but the necessary bits to build these modules were not found:
    _bsddb _sqlite3 _ssl
    _tkinter bsddb185 bz2
    dl imageop readline
    sunaudiodev zlib
    To find the necessary bits, look in setup.py in detect_modules() for the module's name.

    Failed to build these modules:
    _curses_panel

    running build_scripts
    ------------------

    Any advice will be welcome.

    Thanks a lot for your attention and your process.

    All the best,

    Vincent

    @vclaudic vclaudic mannequin added build The build process and cross-build labels Jun 6, 2011
    @skrah
    Copy link
    Mannequin

    skrah mannequin commented Jun 6, 2011

    panel.h is not found. You'll need to install the package that
    provides libpanel together with the header files:

    error: panel.h: No such file or directory

    This does not look like a Python bug, so I'll set the issue to
    'pending'. You can still respond to the issue if you think otherwise.

    @skrah skrah mannequin added the invalid label Jun 6, 2011
    @vclaudic
    Copy link
    Mannequin Author

    vclaudic mannequin commented Jun 6, 2011

    Hello Stefan,

    Thanks a lot for your time and answer, but here are some additional information regarding the requires "panel.h" file. I've just launched a find command onto my ia64 server, and here is the result:

    hesione:/ # find / -name "panel.h"
    /usr/include/ncurses/panel.h
    /usr/include/ncurses6/ncurses/panel.h
    /usr/include/ncurses6/ncursesw/panel.h
    /usr/include/ncursesw/panel.h
    /usr/src/linux-2.6.32.12-0.7-obj/ia64/default/include/config/panel.h

    As you may have also observed, the build command is claiming also ncurses, which is installed.

    hesione:~ # rpm -qa|grep ncurses
    yast2-ncurses-pkg-2.17.16-0.1.77
    libncurses6-5.6-90.55
    ncurses-devel-5.6-90.55
    libncurses5-5.6-90.55
    yast2-ncurses-2.17.17-0.4.38
    ncurses-utils-5.6-90.55
    libncurses5-x86-5.6-90.55
    libncurses6-x86-5.6-90.55

    Any further information will be welcome.

    Thanks again for your patience, time and answer.

    All the best,

    Vincent

    @hm
    Copy link
    Mannequin

    hm mannequin commented May 23, 2012

    I just stumbled upon the same problem with Python 2.7.3 on SLES 11 SP1 amd64.

    Obviously, SuSE puts the needed header file into /usr/include/ncurses/, and one can either create a symlink in /usr/include/ or apply a patch to _curses_panel.c:

    --- Modules/_curses_panel.c.orig        2012-05-23 13:34:17.000000000 +0200
    +++ Modules/_curses_panel.c     2012-05-23 13:34:27.000000000 +0200
    @@ -14,7 +14,7 @@
     
     #include "py_curses.h"
     
    -#include <panel.h>
    +#include <ncurses/panel.h>
     
     static PyObject *PyCursesError;
     

    Maybe some logic could be put into the build process to automatically handle this? Apparently, configure already knows about the different locations...

    Regards,
    Holger

    @pitrou pitrou removed the invalid label May 23, 2012
    @cataliniacob
    Copy link
    Mannequin

    cataliniacob mannequin commented Jul 7, 2012

    The same happens on OpenSUSE 12.1 so Python can't be fully built there which is a bit of a shame.

    OpenSUSE uses this patch for their packages, but that would break other distributions so it's not a good solution:
    -#include <panel.h>
    +#include <ncurses/panel.h>

    Here's a list of all curses related files in /usr/include on my OpenSUSE 12.1:
    catalin@linux-vo6z:~/cpython/issue12271> find /usr/include/ -regex '.*curses.*' -and \( -type f -or -type l \) -exec ls -lh {} \;
    -rw-r--r-- 1 root root 4.1K May 10 15:28 /usr/include/python2.7/py_curses.h
    lrwxrwxrwx 1 root root 16 Nov 20 2011 /usr/include/curses.h -> ncurses/curses.h
    -rw-r--r-- 1 root root 75K Oct 29 2011 /usr/include/ncurses/curses.h
    -rw-r--r-- 1 root root 6.5K Oct 29 2011 /usr/include/ncurses/cursesapp.h
    -rw-r--r-- 1 root root 27K Oct 29 2011 /usr/include/ncurses/cursesf.h
    -rw-r--r-- 1 root root 20K Oct 29 2011 /usr/include/ncurses/cursesm.h
    -rw-r--r-- 1 root root 8.3K Oct 29 2011 /usr/include/ncurses/cursesp.h
    -rw-r--r-- 1 root root 49K Oct 29 2011 /usr/include/ncurses/cursesw.h
    -rw-r--r-- 1 root root 7.2K Oct 29 2011 /usr/include/ncurses/cursslk.h
    -rw-r--r-- 1 root root 2.9K Oct 29 2011 /usr/include/ncurses/eti.h
    -rw-r--r-- 1 root root 9.1K Oct 29 2011 /usr/include/ncurses/etip.h
    -rw-r--r-- 1 root root 18K Oct 29 2011 /usr/include/ncurses/form.h
    -rw-r--r-- 1 root root 12K Oct 29 2011 /usr/include/ncurses/menu.h
    -rw-r--r-- 1 root root 4.0K Oct 29 2011 /usr/include/ncurses/nc_tparm.h
    lrwxrwxrwx 1 root root 8 Nov 20 2011 /usr/include/ncurses/ncurses.h -> curses.h
    -rw-r--r-- 1 root root 3.9K Oct 29 2011 /usr/include/ncurses/ncurses_dll.h
    -rw-r--r-- 1 root root 4.0K Oct 29 2011 /usr/include/ncurses/panel.h
    -rw-r--r-- 1 root root 40K Oct 29 2011 /usr/include/ncurses/term.h
    -rw-r--r-- 1 root root 7.2K Oct 29 2011 /usr/include/ncurses/term_entry.h
    -rw-r--r-- 1 root root 3.5K Oct 29 2011 /usr/include/ncurses/termcap.h
    -rw-r--r-- 1 root root 13K Oct 29 2011 /usr/include/ncurses/tic.h
    -rw-r--r-- 1 root root 3.1K Oct 29 2011 /usr/include/ncurses/unctrl.h
    lrwxrwxrwx 1 root root 17 Nov 20 2011 /usr/include/ncurses.h -> ncurses/ncurses.h
    lrwxrwxrwx 1 root root 16 Nov 20 2011 /usr/include/ncurses6/curses.h -> ncurses/curses.h
    -rw-r--r-- 1 root root 75K Oct 29 2011 /usr/include/ncurses6/ncurses/curses.h
    -rw-r--r-- 1 root root 6.5K Oct 29 2011 /usr/include/ncurses6/ncurses/cursesapp.h
    -rw-r--r-- 1 root root 27K Oct 29 2011 /usr/include/ncurses6/ncurses/cursesf.h
    -rw-r--r-- 1 root root 20K Oct 29 2011 /usr/include/ncurses6/ncurses/cursesm.h
    -rw-r--r-- 1 root root 8.3K Oct 29 2011 /usr/include/ncurses6/ncurses/cursesp.h
    -rw-r--r-- 1 root root 49K Oct 29 2011 /usr/include/ncurses6/ncurses/cursesw.h
    -rw-r--r-- 1 root root 7.2K Oct 29 2011 /usr/include/ncurses6/ncurses/cursslk.h
    -rw-r--r-- 1 root root 2.9K Oct 29 2011 /usr/include/ncurses6/ncurses/eti.h
    -rw-r--r-- 1 root root 9.1K Oct 29 2011 /usr/include/ncurses6/ncurses/etip.h
    -rw-r--r-- 1 root root 18K Oct 29 2011 /usr/include/ncurses6/ncurses/form.h
    -rw-r--r-- 1 root root 12K Oct 29 2011 /usr/include/ncurses6/ncurses/menu.h
    -rw-r--r-- 1 root root 4.0K Oct 29 2011 /usr/include/ncurses6/ncurses/nc_tparm.h
    lrwxrwxrwx 1 root root 8 Nov 20 2011 /usr/include/ncurses6/ncurses/ncurses.h -> curses.h
    -rw-r--r-- 1 root root 3.9K Oct 29 2011 /usr/include/ncurses6/ncurses/ncurses_dll.h
    -rw-r--r-- 1 root root 4.0K Oct 29 2011 /usr/include/ncurses6/ncurses/panel.h
    -rw-r--r-- 1 root root 40K Oct 29 2011 /usr/include/ncurses6/ncurses/term.h
    -rw-r--r-- 1 root root 7.2K Oct 29 2011 /usr/include/ncurses6/ncurses/term_entry.h
    -rw-r--r-- 1 root root 3.5K Oct 29 2011 /usr/include/ncurses6/ncurses/termcap.h
    -rw-r--r-- 1 root root 13K Oct 29 2011 /usr/include/ncurses6/ncurses/tic.h
    -rw-r--r-- 1 root root 3.1K Oct 29 2011 /usr/include/ncurses6/ncurses/unctrl.h
    lrwxrwxrwx 1 root root 17 Nov 20 2011 /usr/include/ncurses6/ncurses.h -> ncurses/ncurses.h
    -rw-r--r-- 1 root root 92K Oct 29 2011 /usr/include/ncurses6/ncursesw/curses.h

    If we look just for panel.h we get:
    catalin@linux-vo6z:~/cpython/issue12271> find /usr/include/ -regex '.*curses.*' -and \( -type f -or -type l \) -exec ls -lh {} \; | grep panel.h
    -rw-r--r-- 1 root root 4.0K Oct 29 2011 /usr/include/ncurses/panel.h
    -rw-r--r-- 1 root root 4.0K Oct 29 2011 /usr/include/ncurses6/ncurses/panel.h
    -rw-r--r-- 1 root root 4.0K Oct 29 2011 /usr/include/ncurses6/ncursesw/panel.h
    -rw-r--r-- 1 root root 4.0K Oct 29 2011 /usr/include/ncursesw/panel.h

    There is some specific code that appends '/usr/include/ncursesw' to the include list in setup.py but that doesn't get triggered here because curses_library == 'ncurses' because readline is built against that.

    The attached patch makes it build and the curses tests pass but it feels kind of hack-ish. panel.h is there so Python should find it somehow therefore this is a genuine bug. Ideas for a better solution?

    @cataliniacob cataliniacob mannequin changed the title Python 2.7.x on IA64 running SLES 11 SP1 panel.h is not found even if it's installed on various flavours of SUSE Jul 7, 2012
    @KennethOBrien
    Copy link
    Mannequin

    KennethOBrien mannequin commented Mar 27, 2013

    I have created a simple patch that solves this problem. Depending on whether panel.h or ncurses/panel.h are found, the appropriate one is included.

    @KennethOBrien
    Copy link
    Mannequin

    KennethOBrien mannequin commented Mar 30, 2013

    Removed generated files from patch. Requesting review.

    @doko42
    Copy link
    Member

    doko42 commented Mar 30, 2013

    hard coding ncurses seems to be wrong, as in most cases, you do want ncursesw.

    @fbauzac
    Copy link
    Mannequin

    fbauzac mannequin commented Oct 11, 2019

    I have been hit by the same issue today.
    Kenneth's patch seems fine. Why not integrate it?

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @RazerM
    Copy link
    Contributor

    RazerM commented Nov 30, 2023

    This seems not so easily patched for Python 3.12

    The configure script uses pkg-config, but only if it finds panel.h, even though pkg-config would help find where panel.h actually is:

    $ pkg-config --libs --cflags ncursesw
    -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw -lncursesw -ltinfo
    $ pkg-config --libs --cflags ncurses
    -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncurses -lncurses -ltinfo
    $ pkg-config --libs --cflags panel
    -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncurses -lpanel
    $ pkg-config --libs --cflags panelw
    -D_GNU_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw -lpanelw
    

    @RazerM
    Copy link
    Contributor

    RazerM commented Nov 30, 2023

    My knowledge of configure scripts is not sufficient to fix this properly, but the following patch seems to work

    Either:

    • Patch configure.ac

      configure.ac.patch:

      --- configure.ac.old    2023-11-30 10:57:37.883174613 +0000
      +++ configure.ac        2023-11-30 11:03:56.163524954 +0000
      @@ -6440,9 +6440,9 @@
       ])
      
       dnl check for ncurses' panel/panelw library
      -AC_CHECK_HEADERS([panel.h])
      +AC_CHECK_HEADERS([ncurses/panel.h])
      
      -AS_VAR_IF([ac_cv_header_panel_h], [yes], [
      +AS_VAR_IF([ac_cv_header_ncurses_panel_h], [yes], [
      
         if test "$ac_sys_system" != "Darwin"; then
           dnl On macOS, there is no separate /usr/lib/libncursesw nor libpanelw.
      @@ -6475,7 +6475,7 @@
           ])
         ])
      
      -])dnl ac_cv_header_panel_h = yes
      +])dnl ac_cv_header_ncurses_panel_h = yes
      
       dnl pyconfig.h defines _XOPEN_SOURCE=700
       PANEL_CFLAGS=$(echo $PANEL_CFLAGS | sed 's/-D_XOPEN_SOURCE=600//g')
      patch -b configure.ac configure.ac.patch
      make regen-configure
      
    • or patch configure directly if you don't want to regenerate it from the above

      configure.patch:

      --- configure.old       2023-11-30 10:58:01.981521390 +0000
      +++ configure   2023-11-30 11:04:36.583357596 +0000
      @@ -26069,15 +26069,15 @@
      
       fi
      
      -ac_fn_c_check_header_compile "$LINENO" "panel.h" "ac_cv_header_panel_h" "$ac_includes_default"
      -if test "x$ac_cv_header_panel_h" = xyes
      +ac_fn_c_check_header_compile "$LINENO" "ncurses/panel.h" "ac_cv_header_ncurses_panel_h" "$ac_includes_default"
      +if test "x$ac_cv_header_ncurses_panel_h" = xyes
       then :
      -  printf "%s\n" "#define HAVE_PANEL_H 1" >>confdefs.h
      +  printf "%s\n" "#define HAVE_NCURSES_PANEL_H 1" >>confdefs.h
      
       fi
      
      
      -if test "x$ac_cv_header_panel_h" = xyes
      +if test "x$ac_cv_header_ncurses_panel_h" = xyes
       then :
      patch -b configure configure.patch
      

    @bitstreamout
    Copy link

    I suggest to use the tool pkgconf with

    > ncurses6-config --cflags
    -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/ncurses
    > pkgconf --cflags ncursesw
    -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/ncursesw 
    

    or specially for libpanel or libpanelw

    >pkgconf --cflags panel
    -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/ncurses 
    > pkgconf --cflags panelw
    -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/ncursesw
    

    or for forms

    > pkgconf --cflags form
    -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/ncurses 
    > pkgconf --cflags formw
    -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/ncursesw 
    

    @erlend-aasland
    Copy link
    Contributor

    The configure script uses pkg-config, but only if it finds panel.h, even though pkg-config would help find where panel.h actually is

    Yes, this seems non-optimal. I think we should run the pkg-config check for panel/panelw before we try to find panel.h.

    @mcepl
    Copy link
    Contributor

    mcepl commented Apr 1, 2024 via email

    mcepl added a commit to openSUSE-Python/cpython that referenced this issue Apr 3, 2024
    Unfortunately Python 3.6 doesn't include all autoconfig
    infrastructure required for the upstream solution, so we have
    to directly patch Modules/_curses_panel.c
    
    Discussion still continue on gh#python#56480.
    mcepl added a commit to openSUSE-Python/cpython that referenced this issue Apr 4, 2024
    Unfortunately Python 3.6 doesn't include all autoconfig
    infrastructure required for the upstream solution, so we have
    to directly patch Modules/_curses_panel.c
    
    Discussion still continue on gh#python#56480.
    
    Patch: python-3.3.0b1-curses-panel.patch
    mcepl added a commit to openSUSE-Python/cpython that referenced this issue Apr 4, 2024
    Unfortunately Python 3.6 doesn't include all autoconfig
    infrastructure required for the upstream solution, so we have
    to directly patch Modules/_curses_panel.c
    
    Discussion still continues on gh#python#56480.
    
    Patch: python-3.3.0b1-curses-panel.patch
    mcepl pushed a commit to openSUSE-Python/cpython that referenced this issue Apr 4, 2024
    Unfortunately Python 3.6 doesn't include all autoconfig
    infrastructure required for the upstream solution, so we have
    to directly patch Modules/_curses_panel.c
    
    Discussion still continues on gh#python#56480.
    
    Patch: python-3.3.0b1-curses-panel.patch
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    build The build process and cross-build
    Projects
    Status: Build
    Development

    No branches or pull requests

    6 participants