nmh-workers
[Top] [All Lists]

Re: Help! Trying to install nmh on ubuntu

2019-11-14 06:44:38
Hi Norm,

Here's what I did to build nmh-1.7.1.tar.gz on Ubuntu 18.04.

In short, install these packages to improve the chance of success.

    sudo apt-get install \
        libncurses5-dev \
        libreadline-dev \
        libgdbm-compat-dev \
        libgdbm-dev \
        libcurl4-openssl-dev \
        libsasl2-dev \
        libssl-dev

  Release:    18.04
  Codename:   bionic
...
I have given up trying to install nmh from a package, deciding instead
to install from the sources.

That might mean either installing from a git clone, or a
nmh-1.7.1.tar.gz.

Either way, the INSTALL file covers what to do next.  Before starting at
step 0 for a git clone, or step 1 for the tar file, it says to check the
MACHINES file for OS-specific instructions.

MACHINES says for Linux that a bunch of packages are required to run,
build, and test nmh.  However, I found none of those exist on
Ubuntu 18.04!

On running ./configure with nmh-1.7.1.tar.gz I get the same error that
you suffer.  To find packages that provide a file called curses.h I did

    $ apt-file find -x '/curses\.h$'
    libncurses5-dev: /usr/include/curses.h
    libncursesw5-dev: /usr/include/ncursesw/curses.h
    $

Examining config.log shows that the #include is

    #include <curses.h>

Given there's no mention of ‘ncursesw’ there I went with the other
option and installed libncurses5-dev.

Next ./configure failure:

    checking for dbm in ndbm.h... no
    checking for dbm in db.h and db... no
    checking for dbm in ndbm.h and db... no
    checking for dbm in ndbm.h and db1... no
    checking for dbm in ndbm.h and ndbm... no
    checking for dbm in db1/ndbm.h and db1... no
    checking for dbm in gdbm/ndbm.h and gdbm... no
    checking for dbm in gdbm/ndbm.h and gdbm_compat -lgdbm... no
    checking for dbm in ndbm.h and gdbm... no
    checking for dbm in ndbm.h and gdbm_compat -lgdbm... no
    checking for dbm in gdbm-ndbm.h and gdbm_compat... no
    configure: error: could not find a working ndbm library/header combination

Searching for the error:

    $ grep 'fatal error' config.log
    ...
    conftest.c:45:10: fatal error: ndbm.h: No such file or directory
    conftest.c:45:10: fatal error: db.h: No such file or directory
    conftest.c:45:10: fatal error: ndbm.h: No such file or directory
    conftest.c:45:10: fatal error: ndbm.h: No such file or directory
    conftest.c:45:10: fatal error: ndbm.h: No such file or directory
    conftest.c:45:10: fatal error: db1/ndbm.h: No such file or directory
    conftest.c:45:10: fatal error: gdbm/ndbm.h: No such file or directory
    conftest.c:45:10: fatal error: gdbm/ndbm.h: No such file or directory
    conftest.c:45:10: fatal error: ndbm.h: No such file or directory
    conftest.c:45:10: fatal error: ndbm.h: No such file or directory
    conftest.c:45:10: fatal error: gdbm-ndbm.h: No such file or directory
    $

    $ apt-file find -x 'ndbm\.h$'
    freebsd-glue: /usr/include/freebsd/ndbm.h
    libace-dev: /usr/include/ace/os_include/os_ndbm.h
    libgdbm-compat-dev: /usr/include/gdbm-ndbm.h
    libgdbm-compat-dev: /usr/include/ndbm.h
    libsingular4-dev-common: 
/usr/include/singular/singular/Singular/links/ndbm.h
    $

libgdbm-compat-dev looks the best bet, providing two of the alternatives
sought.  Installed that.  ./configure still fails the same as before,
but config.log has

    /usr/include/ndbm.h:28:10: fatal error: gdbm.h: No such file or directory
     #include <gdbm.h>

Another search:

    $ apt-file find -x '/gdbm\.h$'
    libgdbm-dev: /usr/include/gdbm.h
    $

Installed libgdbm-dev.  ./configure now succeeds, but at the end shows
support for some parts is disabled.

    nmh configuration
    -----------------
    nmh version                : 1.7.1
    host os                    : x86_64-unknown-linux-gnu
    compiler                   : cc
    compiler flags             :  -g -O2 -Wall -Wextra
    linker flags               :  
    preprocessor flags         : -D_GNU_SOURCE 
    source code location       : .
    binary install path        : /usr/local/nmh/bin
    libexec install path       : /usr/local/nmh/libexec/nmh
    config files install path  : /usr/local/nmh/etc/nmh
    man page install path      : /usr/local/nmh/share/man
    docs install path          : /usr/local/nmh/share/doc/nmh
    RPM build root             : ./RPM
    backup prefix              : ,
    transport system           : smtp
    spool default locking type : fcntl
    default smtp server        : localhost
  → SASL support               : no
  → TLS support                : no
  → OAuth support              : no

Give up.  Obtain source of Ubuntu's package.

    $ apt-get source nmh

See what packages it wants.

    $ grep -i depends nmh-1.7.1~RC3/debian/control
    Build-Depends: debhelper (>= 9.0.0), dh-strip-nondeterminism, 
dh-autoreconf, libncurses5-dev, liblockfile-dev (>= 1.01), libsasl2-dev, 
libdb-dev, flex, libfl-dev, libssl-dev, libcurl4-openssl-dev
    Depends: ${shlibs:Depends}, netbase (>= 3.16-1), ${misc:Depends}, 
mime-support
    $

Install the SSL-related ones.

    sudo apt-get install libsasl2-dev libssl-dev libcurl4-openssl-dev

Re-run ./configure.  It ends with

    nmh configuration
    -----------------
    nmh version                : 1.7.1
    host os                    : x86_64-unknown-linux-gnu
    compiler                   : cc
    compiler flags             :  -g -O2 -Wall -Wextra
    linker flags               :  
    preprocessor flags         : -D_GNU_SOURCE 
    source code location       : .
    binary install path        : /usr/local/nmh/bin
    libexec install path       : /usr/local/nmh/libexec/nmh
    config files install path  : /usr/local/nmh/etc/nmh
    man page install path      : /usr/local/nmh/share/man
    docs install path          : /usr/local/nmh/share/doc/nmh
    RPM build root             : ./RPM
    backup prefix              : ,
    transport system           : smtp
    spool default locking type : fcntl
    default smtp server        : localhost
    SASL support               : yes
    TLS support                : yes
    OAuth support              : yes

Ran ‘make all check’; that succeeded.

But ‘ldd uip/whatnow’ didn't suggest readline support.  (Shouldn't this
be listed in the above table?)  Confirmed with

    $ grep -i readline config.h
    /* Support for using readline() in whatnow */
    /* #undef READLINE_SUPPORT */
    $

Installed libreadline-dev.  Re-ran ‘./configure && make all check’.
Still passed.  whatnow now uses readline.

    $ ldd uip/whatnow
            linux-vdso.so.1 (0x00007ffe3cbcf000)
  →         libreadline.so.7 => /lib/x86_64-linux-gnu/libreadline.so.7 
(0x00007f9e77a0b000)
            libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 
(0x00007f9e777e1000)
            libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9e773f0000)
            /lib64/ld-linux-x86-64.so.2 (0x00007f9e77eb3000)
    $

-- 
Cheers, Ralph.


<Prev in Thread] Current Thread [Next in Thread>