building ne: libncursesw5-dev or libncurses5-dev?

628 views
Skip to first unread message

John Gabriele

unread,
May 29, 2012, 12:08:08 AM5/29/12
to nicee...@googlegroups.com
Hi,

Just downloaded the 2.4 source to build ne.

My (Xubuntu 12.04) system already has the libncurses5 and libncursesw5
packages installed.

To build ne, since I first need the ncurses dev package installed, I
grabbed it; however, there's 2 of them: libncurses5-dev and
libncursesw5-dev.

My understanding is that libncursesw is for "wide character" aka utf-8
unicode support, and I want utf-8 support, so that's the one I
installed.

I can see it provides a curses.h file:

~~~
john@garnet:~/opt/src/ne-2.4$ dpkg -L libncursesw5-dev | grep 'curses\.h'
/usr/include/ncursesw/curses.h
/usr/include/ncursesw/ncurses.h
~~~

However, when I try to run the `make PREFIX=/home/john/opt` command,
it tells me:

~~~
john@garnet:~/opt/src/ne-2.4$ make PREFIX=/home/john/opt
(cd src; make clean; make NE_GLOBAL_DIR=/home/john/opt/share/ne)
make[1]: Entering directory `/home/john/opt/src/ne-2.4/src'
rm -f *.o *.gcda *.gcda.info *.gcno core
make[1]: Leaving directory `/home/john/opt/src/ne-2.4/src'
make[1]: Entering directory `/home/john/opt/src/ne-2.4/src'
cc -D_GNU_SOURCE -D__USE_GNU -DSTDC_HEADERS -Dinline=__inline__
-O3 -DNDEBUG -c -o actions.o actions.c
In file included from actions.c:22:0:
ne.h:41:20: fatal error: curses.h: No such file or directory
compilation terminated.
make[1]: *** [actions.o] Error 1
make[1]: Leaving directory `/home/john/opt/src/ne-2.4/src'
make: *** [build] Error 2
john@garnet:~/opt/src/ne-2.4$
~~~

It should be finding that curses.h file, no?

Thanks,
---John

Sebastiano Vigna

unread,
May 29, 2012, 12:12:46 AM5/29/12
to nicee...@googlegroups.com
On May 28, 2012, at 9:08 PM, John Gabriele wrote:

> My understanding is that libncursesw is for "wide character" aka utf-8
> unicode support, and I want utf-8 support, so that's the one I
> installed.


No, because ne does not use curses. It uses just the terminfo database. So the standard version is the right one. Well, at least try it out :).

Ciao,

seba

Jason Gian

unread,
May 29, 2012, 12:22:01 PM5/29/12
to nicee...@googlegroups.com
thx :)

John

unread,
May 29, 2012, 12:21:31 AM5/29/12
to niceeditor
By the way, sorry for the sub-optimal subject line for this thread. I
went and removed libncursesw5-dev and installed libncurses5-dev, and
then tried building again, and this time got further. Though, it ended
up failing further down:

~~~
{...snip various files getting successfully compiled, ... then}

cc -lm actions.o ansi.o autocomp.o buffer.o clips.o cm.o command.o
display.o edit.o errors.o exec.o ext.o hash.o help.o input.o
inputclass.o keys.o menu.o names.o navigation.o ne.o prefs.o regex.o
request.o search.o signals.o streams.o support.o syn_hash.o
syn_regex.o syn_utf8.o syn_utils.o syntax.o term.o undo.o utf8.o -
lcurses -o ne
menu.o: In function `draw_status_bar':
menu.c:(.text+0x1416): undefined reference to `floor'
menu.c:(.text+0x15c1): undefined reference to `floor'
collect2: ld returned 1 exit status
make[1]: *** [ne] Error 1
make[1]: Leaving directory `/home/john/opt/src/ne-2.4/src'
make: *** [install] Error 2
~~~

Any suggestions on why this step is failing? The menu.c file compiled
just fine. (Note, I've recently re-installed my OS, and so it's
possible I'm missing a dev package or two. But I've got make and gcc,
and `ld` is on my path.)

Thanks,
---John

Sebastiano Vigna

unread,
May 29, 2012, 12:26:30 AM5/29/12
to nicee...@googlegroups.com
On May 28, 2012, at 9:21 PM, John wrote:

> Any suggestions on why this step is failing? The menu.c file compiled
> just fine. (Note, I've recently re-installed my OS, and so it's
> possible I'm missing a dev package or two. But I've got make and gcc,
> and `ld` is on my path.)


It's linking with -lm and it doesn't find floor()?

I don't know what to say...

Ciao,

seba

John Gabriele

unread,
May 29, 2012, 12:28:59 AM5/29/12
to nicee...@googlegroups.com
Hm. Well, if it matters, this is a 64-bit machine (x86_64).

Also:

~~~
john@garnet:~/docs$ locate libm.so
/lib/x86_64-linux-gnu/libm.so.6
/usr/lib/x86_64-linux-gnu/libm.so
~~~

John Gabriele

unread,
May 29, 2012, 12:34:15 AM5/29/12
to nicee...@googlegroups.com
On Tue, May 29, 2012 at 12:26 AM, Sebastiano Vigna <vi...@dsi.unimi.it> wrote:
>
>
> It's linking with -lm and it doesn't find floor()?
>
> I don't know what to say...
>

Also, if I install ne via apt (which gets me ne version 2.3.1), I see this:

~~~
$ ldd `which ne`
linux-vdso.so.1 => (0x00007fff76fff000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f29b7416000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f29b711c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f29b6d5e000)
/lib64/ld-linux-x86-64.so.2 (0x00007f29b7650000)
~~~

John Gabriele

unread,
May 29, 2012, 10:26:34 AM5/29/12
to nicee...@googlegroups.com
On Tue, May 29, 2012 at 12:26 AM, Sebastiano Vigna <vi...@dsi.unimi.it> wrote:
> On May 28, 2012, at 9:21 PM, John wrote:
>
>> Any suggestions on why this step is failing? The menu.c file compiled
>> just fine. (Note, I've recently re-installed my OS, and so it's
>> possible I'm missing a dev package or two. But I've got make and gcc,
>> and `ld` is on my path.)
>
>
> It's linking with -lm and it doesn't find floor()?
>

Fixed, thanks to Lionel Le Folgoc on ubuntu-devel-discuss!
<https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2012-May/013644.html>

I opened src/makefile and did this:

~~~
$ diff ne-2.4/src/makefile ne-2.4.mine/src/makefile
105c105
< LIBS=$(if $(NE_TERMCAP)$(NE_ANSI),,-lcurses)
---
> LIBS=$(if $(NE_TERMCAP)$(NE_ANSI),,-lm -lcurses)
108c108
< $(CC) -lm $(OPTS) $(LDFLAGS) $(if $(NE_TEST), -coverage,) $^
$(LIBS) -o $(PROGRAM)
---
> $(CC) $(OPTS) $(LDFLAGS) $(if $(NE_TEST), -coverage,) $^ $(LIBS) -o $(PROGRAM)
~~~

(Aside: that src/makefile had some extra tabs on line 77.)

---John

John Gabriele

unread,
May 29, 2012, 10:53:49 AM5/29/12
to nicee...@googlegroups.com
On Tue, May 29, 2012 at 12:12 AM, Sebastiano Vigna <vi...@dsi.unimi.it> wrote:
> On May 28, 2012, at 9:08 PM, John Gabriele wrote:
>
>> My understanding is that libncursesw is for "wide character" aka utf-8
>> unicode support, and I want utf-8 support, so that's the one I
>> installed.
>
>
> No, because ne does not use curses. It uses just the terminfo database. So the standard version is the right one.

Since building ne requires that I have libncurses5-dev installed (a
number of the source files include curses.h), I think it would be
valuable if you included in the README or INSTALL file the distinction
between using ncurses and needing ncurses for terminfo.

Thanks,
---John

Sebastiano Vigna

unread,
May 29, 2012, 11:19:56 AM5/29/12
to nicee...@googlegroups.com

On May 29, 2012, at 7:53 AM, John Gabriele wrote:

> Since building ne requires that I have libncurses5-dev installed (a
> number of the source files include curses.h), I think it would be
> valuable if you included in the README or INSTALL file the distinction
> between using ncurses and needing ncurses for terminfo.


Currently we say

For installation (i.e., "make install), a POSIX compliant machine with a
terminfo database should be sufficient.

What about

For installation (i.e., "make install), a POSIX compliant machine with a
terminfo database should be sufficient. Note that terminfo might come
bundled in a package named "curses", "ncurses" or some variant of it.
Choose the simplest variant, as ne does not actually use curses (a virtual
screen library), but just the underlying terminfo database.


Ciao,

seba

John Gabriele

unread,
May 29, 2012, 11:45:18 AM5/29/12
to nicee...@googlegroups.com
I might change that to:

| For installation (i.e., "make install"), a POSIX compliant machine with a
| terminfo database should be sufficient. Note that terminfo might come
| bundled in a package named "curses", "ncurses" or some variant of it,
| which you may need to install (for example, on Debian-based systems,
| "sudo apt-get install libncurses5-dev").
| Choose the simplest variant of this package, as ne does not actually
use curses (a virtual
| screen library), but just the underlying terminfo database.

(Also, note the minor typo in the README: missing closing double-quote
after "make install".)

One last thing: in the INSTALL doc, it says

~~~
make
sudo make install
~~~

but further down says that `make install` will build then install. So,
it would seem that you don't even need that first `make` step...

Also, if specifying a PREFIX, would you also need to do that in the
plain `make` step (along with the `make install` step)? If so, I'd
suggest that 2nd section at the top of INSTALL be filled out to look
like:

~~~
make PREFIX=/home/<you>/opt
make PREFIX=/home/<you>/opt install
~~~

And then to avoid repitition, below, where it says "which will be its
global directory. For example:", I think you can remove the "For
example: make PREFIX=/home/myname/opt" and just add a "(see above)"
to the paragraph, like so:

"The PREFIX make variable (see above) decides where ne will be
installed and which will be its global directory."

---John

Sebastiano Vigna

unread,
May 29, 2012, 11:51:11 AM5/29/12
to nicee...@googlegroups.com
On May 29, 2012, at 8:45 AM, John Gabriele wrote:

> I might change that to:

Well, I prefer not to have system-specific instructions.

>
> ~~~
> make
> sudo make install
> ~~~
>
> but further down says that `make install` will build then install. So,
> it would seem that you don't even need that first `make` step...

That's now:

----
1. To build and install into /usr/local:

# unpack distribution
cd ne-x.y.z
make install

Note that you must have adequate privileges.
----

> And then to avoid repitition, below, where it says "which will be its
> global directory. For example:", I think you can remove the "For
> example: make PREFIX=/home/myname/opt" and just add a "(see above)"
> to the paragraph, like so:
>
> "The PREFIX make variable (see above) decides where ne will be
> installed and which will be its global directory."


Done. Thanks!

Ciao,

seba

John Gabriele

unread,
May 29, 2012, 12:04:37 PM5/29/12
to nicee...@googlegroups.com
On Tue, May 29, 2012 at 11:51 AM, Sebastiano Vigna <vi...@dsi.unimi.it> wrote:
> On May 29, 2012, at 8:45 AM, John Gabriele wrote:
>
>> > For installation (i.e., "make install), a POSIX compliant machine with a
>> > terminfo database should be sufficient. Note that terminfo might come
>> > bundled in a package named "curses", "ncurses" or some variant of it.
>> > Choose the simplest variant, as ne does not actually use curses (a virtual
>> > screen library), but just the underlying terminfo database.
>>
>> I might change that to:
>>
>> | For installation (i.e., "make install"), a POSIX compliant machine with a
>> | terminfo database should be sufficient. Note that terminfo might come
>> | bundled in a package named "curses", "ncurses" or some variant of it,
>> | which you may need to install (for example, on Debian-based systems,
>> | "sudo apt-get install libncurses5-dev").
>> | Choose the simplest variant of this package, as ne does not actually
>> | use curses (a virtual
>> | screen library), but just the underlying terminfo database.

> Well, I prefer not to have system-specific instructions.
>

I see it as important to tell the user that they may need to install
the ncurses development files. When you write, "Choose the simplest
variant", the reader may not know what you're talking about. How
about:

: For installation (i.e., "make install"), a POSIX compliant machine with a
: terminfo database should be sufficient. Note that terminfo might come
: bundled in a package named "curses", "ncurses" or some variant of it,
: and you may need to install the ncurses development files.
: Choose the simplest variant of these, as ne does not actually use
curses (a virtual
: screen library), but just the underlying terminfo database.

---John
Reply all
Reply to author
Forward
0 new messages