2018-07-17 14:31 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002642OpenFOAM[All Projects] Bugpublic2017-08-01 09:46
Assigned Tohenry 
Platformx86_64OSSlackwareOS Version14.2
Product Version5.0 
Target VersionFixed in Versiondev 
Summary0002642: extend OpenFOAM compilation compatibility on Linux platforms: readline needs -lncurses if ncurses is installed
Descriptionin order to compile OpenFOAM on Linux with unmodified version of GNU readline, it is necessary to modify row 16 of the file:

 export LINK_FLAGS="-lreadline"

 export LINK_FLAGS="-lreadline -lncurses"

Steps To Reproducecopile OpenFOAM on Slackware following the official compilation instructions
Additional Informationhttp://www.linuxquestions.org/questions/slackware-14/readline-problem-bug-4175479543/
Attached Files




henry (manager)

How many Linux distributions have you tested this change on? Do you know if there are any on which it does not work?


lorenzotrevisan (reporter)

Dear Henry, i tested this change for OpenFOAM 4.0 4.1 and 5.0 on Slackware 14.2 64 and 32 bit; Deabian and RedHat like distributions should modify the system readline source in order not to need this change. Now i do not have the resources to test on Ubuntu but i estimate that the change should not affect the standard compilation of OpenFOAM: do You want that i try? Thank You in advance for Your attantion. Best regards


henry (manager)

ncurses in not installed by default on Ubuntu and so your proposed change would cause a compilation failure of OpenFOAM.

It may be possible to test the availablity of ncurses in the same manner as readline by checking for the existence of


and add -lncurses to the link line if it does. This would work for Ubuntu and OpenSuSE Tumbleweed but I don't know about the others.


lorenzotrevisan (reporter)

Dear Henry, i think that Your suggestion should be a smart solution that would work for RHEL-clones too.

I am not a programmer, but if i have well understood, the change that You propose shoul be something similar to:

if [ -f /usr/include/readline/readline.h ]
    echo " found <readline/readline.h> -- enabling readline support."
    if [ -f /usr/include/ncurses.h ]
        echo " found <ncurses.h> -- enabling readline with ncurses support."
        export LINK_FLAGS="-lreadline -lncurses"
        export LINK_FLAGS="-lreadline"

Thank You very much for the help.


henry (manager)

Resolved by commit 1081f8c0465b9ecdf1016976059353717faf3465

-Issue History
Date Modified Username Field Change
2017-07-31 10:24 lorenzotrevisan New Issue
2017-07-31 10:24 lorenzotrevisan Tag Attached: compilation
2017-07-31 13:59 henry Note Added: 0008484
2017-07-31 15:04 lorenzotrevisan Note Added: 0008485
2017-07-31 15:10 henry Note Added: 0008486
2017-07-31 16:49 lorenzotrevisan Note Added: 0008487
2017-08-01 09:46 henry Assigned To => henry
2017-08-01 09:46 henry Status new => resolved
2017-08-01 09:46 henry Resolution open => fixed
2017-08-01 09:46 henry Fixed in Version => dev
2017-08-01 09:46 henry Note Added: 0008489
+Issue History