0

I am building cmake on RHEL with gcc and ncurses placed in a custom location /path/to/gcc/and/ncurses which contains the standard /usr structure i.e.

/path/to/gcc/and/ncurses
    bin
    include
    include/ncurses
    lib
    lib64

Both my CPATH and *LIBRARY_PATH variables are pointing to appropriate directories.

I am not sure how to debug the process. The verbose output of bootstrap simply says:

-- Checking for curses support
-- Checking for curses support - Failed

When I grep for curses in the build directory I find a few references particularly in Source/Checks/Curses-build/CMakeCache.txt

//Path to a library.
CURSES_CURSES_LIBRARY:FILEPATH=CURSES_CURSES_LIBRARY-NOTFOUND

//Path to a library.
CURSES_FORM_LIBRARY:FILEPATH=CURSES_FORM_LIBRARY-NOTFOUND

//Path to a file.
 CURSES_INCLUDE_PATH:PATH=/gpfs/panther/local/apps/dev/core/gcc/9.2.0/include/ncurses

//Path to a library.
CURSES_NCURSES_LIBRARY:FILEPATH=CURSES_NCURSES_LIBRARY-NOTFOUND

and in CMakeFiles/CMakeError.log:

Checking for curses support failed with the following output:
Change Dir: /path/to/build/Source/Checks/Curses-build

The configure and build steps are executed as follows:

${SRC_DIR}/configure \
    --prefix=${INSTALL_DIR} \
    --verbose \
    --parallel=16 \
    && make -j16 && make install

This really seems like some sort of minor omission, but I could not reproduce it on a similar RHEL machine were the same build script and cmake version build fine.

Please advise.

  • 1
    You provide so little description for the problem which even you have failed to reproduce except on a specific machine... Start with providing the **exact** error message and the logs where you have found "that the headers have been correctly found but not the library". – Tsyvarev Sep 23 '19 at 21:30
  • Apologies, I added some detail now. I don't really know how to debug the bootstrapping as I am not sure where to look for warning and error logs in bootstrap dir structure. Hope this helps. – Robert Manson-Sawko Sep 24 '19 at 07:58
  • @Tsyvarev I found an answer to my problem, although I don't know why I had to update the scripts with respect to my other machine. The problem may be too specific for SO. If you feel this way, please feel free to close and delete the whole post. Not sure if this advice is useful to anyone. – Robert Manson-Sawko Sep 24 '19 at 12:22
  • "The problem may be too specific for SO." - Since some time, the reason "too localized" has been removed from the close reasons on Stack Overflow. Actually, your question has a problem stated ("cmake doesn't find ncurses") with basic information (error message) and even some extended information (`CMakeError.log`, `CMakeCache.txt` files) describing the situation. So, why do we need to close it? Supplied with an answer, the question could be useful for others who will face with the similar problem. This perfectly reflects the SO purpose: Q/A which could be useful for others. – Tsyvarev Sep 24 '19 at 12:39

1 Answers1

0

Right, I have managed to solve the problem by forcing curses through cmake options. Turns out that the bootstrap program can take cmake options after the --. This is what I did:

${SRC_DIR}/configure \\
    --prefix=${INSTALL_DIR} \
    --verbose \
    --parallel=16 -- \
   -DBUILD_CursesDialog=ON \
   -DCURSES_LIBRARY=${COMPILER_PREFIX}/lib/libncurses.so.6 \
   -DCURSES_INCLUDE_PATH=${COMPILER_PREFIX}/include/ncurses \
   && make -j16 && make install

where $COMPILER_PREFIX prefix was pointing to /path/to/gcc/and/ncurses. Doing this way allowed me to see better which bit is failing. Before I was trying to navigate an obscure (to me!) directory structure of the build directory.