View Issue Details

IDProjectCategoryView StatusLast Update
0002642OpenFOAMBugpublic2017-08-01 09:46
Reporterlorenzotrevisan Assigned Tohenry  
PrioritylowSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSSlackwareOS Version14.2
Fixed 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:
$FOAM_UTILITIES/mesh/manipulation/setSet/Allwmake

from:
 export LINK_FLAGS="-lreadline"

to:
 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/
Tagscompilation

Activities

henry

2017-07-31 13:59

manager   ~0008484

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

lorenzotrevisan

2017-07-31 15:04

reporter   ~0008485

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

2017-07-31 15:10

manager   ~0008486

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

/usr/include/ncurses/ncurses.h

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

2017-07-31 16:49

reporter   ~0008487

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 ]
then
    echo " found <readline/readline.h> -- enabling readline support."
    export COMP_FLAGS="-DHAS_READLINE"
    if [ -f /usr/include/ncurses.h ]
    then
        echo " found <ncurses.h> -- enabling readline with ncurses support."
        export LINK_FLAGS="-lreadline -lncurses"
        else
        export LINK_FLAGS="-lreadline"
fi

Thank You very much for the help.

henry

2017-08-01 09:46

manager   ~0008489

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