Open MPI logo

Hardware Locality Users' Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Users mailing list

Subject: Re: [hwloc-users] hwloc 1.2 compilation problems
From: Carl Smith (cs_at_[hidden])
Date: 2011-06-20 18:44:09

> But then we'd use curses instead of ncurses on all systems and never
> use ncurses, which is a regression.

        I'm just pointing out what worked for us. Since the right approach
for all might unfortunately necessitate ugly platform-groveling code to
correctly select the working combinations, I thought it prudent to leave
such code to the developers. For more detail on the necessary groveling,
see below.

> There must be a way to make the ncurses.h+libncurses combination work,
> else AIX wouldn't ship them.

        One might think so, and perhaps it's true. However, it's there
because it's freeware,

$ ls -l /usr/include/ncurses* /usr/lib/libncurses.a
lrwxrwxrwx 1 root system 34 Jan 28 2008 /usr/include/ncurses -> ../../opt/freeware/include/ncurses
lrwxrwxrwx 1 root system 36 Jan 28 2008 /usr/include/ncurses.h -> ../../opt/freeware/include/ncurses.h
lrwxrwxrwx 1 root system 35 Jan 28 2008 /usr/lib/libncurses.a -> ../../opt/freeware/lib/libncurses.a

not because there's any reason to think IBM believes it will work. :-(
They are not a part of any installed filesets whereas the curses versions

$ lslpp -w "*ncurses*"
$ lslpp -w "*curses*"
  File Fileset Type
  /usr/ccs/lib/libxcurses.a bos.rte.libcur File
  /usr/lib/libcurses.a bos.rte.libcur Symlink
  /usr/lib/libxcurses.a bos.rte.libcur Symlink
  /usr/ccs/lib/libcurses.a bos.rte.libcur Symlink
  /usr/lib/nls/msg/en_US/ bos.msg.en_US.rte File
  /usr/include/curses.h bos.adt.include File

and in /usr/include, only curses.h includes the problematic term.h (which
contains the cur_(bools|nums|strs) references unresolved by libncurses).
Seems like it's lstopo-text.c's assumption that /usr/include/term.h is
appropriate to include with ncurses support that's causing the cross-pollution.
Looking further, I saw a bunch of ncurses changes attributable to tparm and it
looks like that's why ncurses normally also supplies an option to install
some header files whose content has been adjusted for ncurses in a separate
directory (/usr/include/ncurses/ in this machine's case) - see the ncurses
--disable-overwrite configuration option.
        hwloc didn't adjust the include path if ncurses was found, so I
tried a simple experiment without my last suggested change but a different
include path,

$ ./
$ ./configure CC=/usr/vac/bin/cc CPPFLAGS="-I/usr/include/ncurses"

and it configured and built correctly.