CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Possible Missing Tab Completion in OFv1712? (https://www.cfd-online.com/Forums/openfoam-bugs/197310-possible-missing-tab-completion-ofv1712.html)

HakikiCanakkaleli January 1, 2018 13:45

Possible Missing Tab Completion in OFv1712?
 
Hi,

Has anyone else also been experiencing the lack of tab completion (command line completion) for the options of OpenFOAM commands in version 1712?

As you may remember, this functionality was added in version 1706?: Bash shell completion

wyldckat January 1, 2018 13:54

Quick questions:
  1. Which shell are you using? bash, dash, tcsh or something else?
  2. How are you keeping OpenFOAM versions separate from each other? For example, are you starting a new terminal whenever you need a new version?

HakikiCanakkaleli January 1, 2018 13:56

1. I use bash.
2. Currently, I removed the other versions. Yet in general I keep the versions separate through ~/.bashrc. For instance:
Code:

alias ofcv='source /scratch/kb8e10/OpenFOAM/OpenFOAM-v1706/etc/bashrc'
alias ofcd='source /scratch/kb8e10/OpenFOAM/OpenFOAM-v1712/etc/bashrc'

I assume that you do not experience the issue I am experiencing? Otherwise, I would like to raise a bug ticket.

wyldckat January 1, 2018 14:04

Everything looks correct in your description... I haven't tried installing it yet, so I haven't tested it yet... let me download and check...

OK, so when I first source the script, I get a warning:
Code:

$ source etc/bashrc
No completion added for /home/bmss/OpenFOAM/OpenFOAM-v1712/platforms/linux64GccDPInt32Opt/bin

because I haven't built it yet.

I've taken a look into the script and it seems like it will silently complain that it needs at least Bash 4.2. What does this give you?
Code:

bash --version

HakikiCanakkaleli January 1, 2018 14:12

For me,
Code:

bash --version
gives this:

Code:

GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Let me check if there is a warning in the website regarding this.

HakikiCanakkaleli January 1, 2018 14:13

Sytem requirements

Therein, no such requirement was mentioned.

HakikiCanakkaleli January 1, 2018 14:17

I assume you meant the following piece of code under etc/config.sh/bash_completion:

Code:

# Uses 'declare -gA' for the implementation
# The '-A' requires bash >= 4.0 and the '-g' requires bash >= 4.2
if [ "${BASH_VERSINFO[0]:-0}${BASH_VERSINFO[1]:-0}" -ge 42 ]
then
    # Global associative array (cached options for OpenFOAM applications)
    declare -gA _of_complete_cache_;

    # Clear existing cache and reassign bash completions.
    # But for tcsh wrapper make use of caching and avoid this overhead.
    if [ -z "$_of_complete_tcsh" ]
    then
        _of_complete_cache_=()

        # Generate completions for predefined directories
        foamAddCompletion $FOAM_APPBIN
        # And a few scripts from bin/
        foamAddCompletion paraFoam
    fi 
else
    # Bash version is too old.
    ## echo "No bash completions - requires bash >= 4.2" 1>&2

    unset -f foamAddCompletion 2>/dev/null
    foamAddCompletion()
    { 
        echo "foamAddCompletion disabled - requires bash >= 4.2" 1>&2
    } 

    unset -f _of_complete_ 2>/dev/null
fi

In the version 1706, under etc/config.sh/bashcompletion, no such piece of code exists.

I now wonder where this warning message is supposed to appear? During the installation?

PS: I cannot update the bash version while I work in a cluster. Nevermind. I think this is very likely old-version issue. Many thanks for your help! :)

wyldckat January 1, 2018 14:30

Quote:

Originally Posted by HakikiCanakkaleli (Post 676601)
Code:

[...]
    # Bash version is too old.
    ## echo "No bash completions - requires bash >= 4.2" 1>&2

    unset -f foamAddCompletion 2>/dev/null
    foamAddCompletion()
    { 
        echo "foamAddCompletion disabled - requires bash >= 4.2" 1>&2
    } 

    unset -f _of_complete_ 2>/dev/null
fi

In the version 1706, under etc/config.sh/bashcompletion, no such piece of code exists.

I now wonder where this warning message is supposed to appear? During the installation?

It's a bug in this part of the script and they forgot to document about this limitation. They left the line "No bash completions - requires bash >= 4.2" commented out, which means that there is no visual indication that your bash version 4.1.2 is not supported.

Please report this on their bug tracker at http://develop.openfoam.com


I deduce that they changed how the auto-complete feature is done so that it would be more automatically, instead of using a very large auto-complete file like the one provided by the versions at the OpenFOAM Foundation, for example, over 7000 lines of script code here: https://github.com/OpenFOAM/OpenFOAM...ash_completion

HakikiCanakkaleli January 1, 2018 14:50

I submitted a ticket by quoting you: Issue 690

Many thanks for your help.

olesen January 3, 2018 04:24

Quote:

Originally Posted by wyldckat (Post 676602)
I deduce that they changed how the auto-complete feature is done so that it would be more automatically, instead of using a very large auto-complete file

There are a few reasons behind the move. Dynamic generation, good cleanup (unsetting completions), more flexibility. There are just two shell functions required for handling the completions and the associative array is filled on-demand (which should reduce some of the shell overhead).

It is also trivial for the end-user to add completions for their own OpenFOAM solvers and applications. Eg,

Code:

    foamAddCompletion $FOAM_USER_APPBIN
The suppressed warning about an older bash not being supported is partly due to constraints of the added tcsh support, which uses bash under the hood, and also partly owing to the usual predicament of supplying too many or too few warnings.
On the plus side, it is nice to be warned that your bash is too old. On the minus side, it can be annoying or interfering to have these warnings each time a new shell is opened. Add an extra variable to configure reporting or suppressing these warnings? Again more complexity.
It is probably difficult to find a practical solution to satisfy all situations.

HakikiCanakkaleli January 3, 2018 05:07

Hi,

IMHO, it might then be good at least to warn the prospective users in system requirements regarding the bash preference, if possible? I think, this is the wisest option considering your well-justified point of view?

olesen January 3, 2018 05:30

Quote:

Originally Posted by HakikiCanakkaleli (Post 676775)
Hi,

IMHO, it might then be good at least to warn the prospective users in system requirements regarding the bash preference, if possible? I think, this is the wisest option considering your well-justified point of view?


Yes, I agree - this is definitely required. It may take a day or two to rectify.
Thanks.
/mark

potentialFoam January 4, 2018 07:28

More general question concerning the bug-fixing process:

Will the bug-fixes from https://develop.openfoam.com be inserted into the download-versions on https://openfoam.com/download/?

This would be valuable to achieve an improved code, but then the version, e.g. v1712, changes with time, right?

HakikiCanakkaleli January 4, 2018 07:37

Quote:

Originally Posted by potentialFoam (Post 676916)
More general question concerning the bug-fixing process:

Will the bug-fixes from https://develop.openfoam.com be inserted into the download-versions on https://openfoam.com/download/?

This would be valuable to achieve an improved code, but then the version, e.g. v1712, changes with time, right?

Hi, AFAIK yes.

PS: I misunderstood your Q, sorry. You can obtain OpenFOAM between the main releases through development repositories.

spaceprop May 23, 2018 03:55

I have Bash 4.2 on CentOS 7.5, installed v1712 in /opt, and still get the "No completion added for /opt/OpenFOAM-v1712/platforms/linux64GccDPInt640Opt/bin" warning, before and after installing OpenFOAM. So I don't think it's necessarily Bash version related. It stopped happening after a reboot. I might be interpreting what tab completion means wrong, but it seems to work, e.g. if I type "simple" then hit tab, "simpleFoam" is one of the suggestions.

Quote:

It is also trivial for the end-user to add completions for their own OpenFOAM solvers and applications. Eg,
foamAddCompletion $FOAM_USER_APPBIN
When I try to do "foamAddCompletion $FOAM_USER_APPBIN", it says the command is not found. Also, $FOAM_USER_APPBIN, which seems to be set to "/root/OpenFOAM/<user>-<version>/platforms/linux64GccDPInt640Opt/bin" doesn't exist. That's because it should be "/opt/OpenFOAM-v1712/platforms/linux64GccDPInt640Opt/bin". Not really sure what's going on.

arslanadeel June 13, 2018 00:11

Open FOAM Installation really sucks
 
when i am trying to install OpenFoamV-1712 I get this error


No completion added for /home/arslan/OpenFOAM/OpenFOAM-v1712/platforms/linux64GccDPInt32Opt/bin



I tried many times but nothing changes. I even tried the whole installtion by ignoring the error but in installtion test its says FATAL ERROR icoFOAM....I have read the whole thread above but really could not get the solution out of it.



I am new to linux and open foam. If anyone knows how to solve the issue please help.



thanks in advance.

gorg88 June 13, 2018 04:16

Hello Arsian.


Have you found the solution for this error?. I have the same problem.




Thanks in advance

spaceprop June 13, 2018 05:52

If you're getting a fatal error, it means that something else is going wrong with the installation.

This tab completion error can be ignored (it just means that tab completion won't work because openfoam hasn't been built successfully yet) and should go away after installing correctly and a reboot.

Here is a guide I put together from multiple sources for building OpenFOAM+ v1712 from source on a headnode and compute nodes running CentOS. If you just care about installing OpenFoam v1712 on a workstation, then only follow the headnode instructions. If you want to use the OpenMPI in the thirdparty folder, then skip the OpenMPI portion of the guide. If you aren't using CentOS/RHEL, then you'll have to adjust some of the steps, but the general method should work.

gsiitd July 12, 2018 03:04

I am facing same issue. I have removed the old one and re-installed the new version i.e. v1806. After downloading the tar files (and after extracting) when I go for source the openfoam bashrc (source ~/OpenFoam/OpenFOAM-v1806/etc/bashrc ) it results in:


No completion added for /home/govind/OpenFoam/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/bin
... incorrect platform, or not yet compiled?



I am not understanding what's happening even after reading above discussions? Please let me clarify this doubt.



Govind,
IIT Delhi

spaceprop July 12, 2018 06:27

That error can be ignored until after installation. Did you try the installation? If the installation succeeds, reboot, then see if that error goes away.


All times are GMT -4. The time now is 19:00.