diff --git a/applications/test/openmp/Make/options b/applications/test/openmp/Make/options index 5094191b4d..fbd42da1e1 100644 --- a/applications/test/openmp/Make/options +++ b/applications/test/openmp/Make/options @@ -1,4 +1,4 @@ -EXE_INC = $(COMP_OPENMP) /* -UUSE_OMP */ +EXE_INC = $(COMP_OPENMP) /* Mostly do not need to explicitly link openmp libraries */ /* EXE_LIBS = $(LINK_OPENMP) */ diff --git a/applications/test/openmp/Test-openmp.C b/applications/test/openmp/Test-openmp.C index ebb8388590..3acc9e4108 100644 --- a/applications/test/openmp/Test-openmp.C +++ b/applications/test/openmp/Test-openmp.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -41,12 +41,6 @@ Description int main(int argc, char *argv[]) { -#if USE_OMP - std::cout << "USE_OMP defined (" << USE_OMP << ")\n"; -#else - std::cout << "USE_OMP undefined\n"; -#endif - #if _OPENMP std::cout << "_OPENMP = " << _OPENMP << "\n\n"; diff --git a/bin/tools/foamCreateCompletionCache b/bin/tools/foamCreateCompletionCache index c42ac097e6..523ca98d29 100755 --- a/bin/tools/foamCreateCompletionCache +++ b/bin/tools/foamCreateCompletionCache @@ -6,11 +6,10 @@ # \\ / A nd | www.openfoam.com # \\/ M anipulation | #------------------------------------------------------------------------------ -# Copyright (C) 2017-2019 OpenCFD Ltd. +# Copyright (C) 2017-2022 OpenCFD Ltd. #------------------------------------------------------------------------------ # License -# This file is part of OpenFOAM, licensed under GNU General Public License -# . +# This file is part of OpenFOAM, distributed under GPL-3.0-or-later. # # Script # foamCreateCompletionCache @@ -195,7 +194,7 @@ extractOptions() #------------------------------------------------------------------------------ # Default to standard search directories and a few scripts from bin/ -[ "$#" -gt 0 ] || set -- ${searchDirs} paraFoam +[ "$#" -gt 0 ] || set -- ${searchDirs} paraFoam wmake for item do diff --git a/etc/config.sh/bash_completion b/etc/config.sh/bash_completion index 5c940012aa..9a748badde 100644 --- a/etc/config.sh/bash_completion +++ b/etc/config.sh/bash_completion @@ -5,7 +5,7 @@ # \\ / A nd | www.openfoam.com # \\/ M anipulation | #------------------------------------------------------------------------------ -# Copyright (C) 2017-2020 OpenCFD Ltd. +# Copyright (C) 2017-2022 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -44,6 +44,10 @@ fi # Add completion for commands, directories of commands +# -clear +# -list +# -quiet +# -verbose # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ unset -f foamAddCompletion 2>/dev/null foamAddCompletion() @@ -52,12 +56,24 @@ foamAddCompletion() echo "Usage: foamAddCompletion -clear | -list | dir(s) | app(s)" 1>&2 local appName choices + local verboseOnMissing=true + for appName do - if [ "$appName" = "-clear" ] + if [ "$appName" = "-quiet" ] + then + # No message for missing applications + unset verboseOnMissing + + elif [ "$appName" = "-verbose" ] + then + # Report for missing applications + verboseOnMissing="true" + + elif [ "$appName" = "-clear" ] then # Clear cached values - echo "clear cached values" 1>&2 + echo "Clear cached values" 1>&2 _of_complete_cache_=() elif [ "$appName" = "-list" ] @@ -81,7 +97,8 @@ foamAddCompletion() then complete -o filenames -F _of_complete_ "${appName##*/}" # echo "complete ${appName##*/}" 1>&2 - elif [ -n "$appName" ] + + elif [ -n "$appName" ] && [ -n "$verboseOnMissing" ] then echo "No completions for $appName" 1>&2 echo "[ignore if OpenFOAM is not yet compiled]" 1>&2 @@ -236,8 +253,8 @@ then # Completions for predefined directories foamAddCompletion "$FOAM_APPBIN" - # A few scripts from bin/ - foamAddCompletion paraFoam + # Completions for a few common scripts (allowed to be missing) + foamAddCompletion -quiet paraFoam wmake fi else # Bash version is too old. diff --git a/wmake/rules/General/Clang/openmp-gomp b/wmake/rules/General/Clang/openmp-gomp index 1cbfe93220..e989fb0719 100644 --- a/wmake/rules/General/Clang/openmp-gomp +++ b/wmake/rules/General/Clang/openmp-gomp @@ -1,8 +1,9 @@ # Flags for compiling/linking openmp -# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP) # - # Clang provides 'omp' and a link for 'gomp'. # With 'gomp' we can also use system libs. -COMP_OPENMP = -DUSE_OMP -fopenmp +COMP_OPENMP = -fopenmp LINK_OPENMP = -lgomp + +# ----------------------------------------------------------------------------- diff --git a/wmake/rules/General/Clang/openmp-omp b/wmake/rules/General/Clang/openmp-omp index b54782f8cf..b5088598e3 100644 --- a/wmake/rules/General/Clang/openmp-omp +++ b/wmake/rules/General/Clang/openmp-omp @@ -1,5 +1,6 @@ # Flags for compiling/linking openmp -# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP) -COMP_OPENMP = -DUSE_OMP -fopenmp +COMP_OPENMP = -fopenmp LINK_OPENMP = -lomp + +# ----------------------------------------------------------------------------- diff --git a/wmake/rules/General/Gcc/openmp b/wmake/rules/General/Gcc/openmp index cd007d1529..24046b3cb8 100644 --- a/wmake/rules/General/Gcc/openmp +++ b/wmake/rules/General/Gcc/openmp @@ -1,5 +1,6 @@ # Flags for compiling/linking openmp -# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP) -COMP_OPENMP = -DUSE_OMP -fopenmp +COMP_OPENMP = -fopenmp LINK_OPENMP = -lgomp + +# ----------------------------------------------------------------------------- diff --git a/wmake/rules/General/Icc/openmp b/wmake/rules/General/Icc/openmp index b1824a5216..8529c48bba 100644 --- a/wmake/rules/General/Icc/openmp +++ b/wmake/rules/General/Icc/openmp @@ -1,5 +1,6 @@ # Flags for compiling/linking openmp -# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP) -COMP_OPENMP = -DUSE_OMP -qopenmp +COMP_OPENMP = -qopenmp LINK_OPENMP = -qopenmp + +# ----------------------------------------------------------------------------- diff --git a/wmake/rules/General/Icx/openmp b/wmake/rules/General/Icx/openmp index e8e20e81a4..e765f25056 100644 --- a/wmake/rules/General/Icx/openmp +++ b/wmake/rules/General/Icx/openmp @@ -1,5 +1,6 @@ # Flags for compiling/linking openmp -# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP) -COMP_OPENMP = -DUSE_OMP -fiopenmp +COMP_OPENMP = -fiopenmp LINK_OPENMP = -fiopenmp + +# ----------------------------------------------------------------------------- diff --git a/wmake/rules/General/Nvidia/openmp b/wmake/rules/General/Nvidia/openmp index 72ae175519..6f5a342ea8 100644 --- a/wmake/rules/General/Nvidia/openmp +++ b/wmake/rules/General/Nvidia/openmp @@ -1,5 +1,6 @@ # Flags for compiling/linking openmp -# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP) -COMP_OPENMP = -DUSE_OMP -fopenmp +COMP_OPENMP = -fopenmp LINK_OPENMP = -lnvomp + +# ----------------------------------------------------------------------------- diff --git a/wmake/rules/darwin64Clang/general b/wmake/rules/darwin64Clang/general index c305312685..4a5acb5ef9 100644 --- a/wmake/rules/darwin64Clang/general +++ b/wmake/rules/darwin64Clang/general @@ -5,7 +5,7 @@ include $(GENERAL_RULES)/standard # Darwin-specific # ---- -COMP_OPENMP = -DUSE_OMP -Xpreprocessor -fopenmp +COMP_OPENMP = -Xpreprocessor -fopenmp LINK_OPENMP = -lomp # ---- diff --git a/wmake/rules/linuxARM64Fujitsu/general b/wmake/rules/linuxARM64Fujitsu/general index 87084f464a..d8768cb5ed 100644 --- a/wmake/rules/linuxARM64Fujitsu/general +++ b/wmake/rules/linuxARM64Fujitsu/general @@ -5,7 +5,7 @@ include $(GENERAL_RULES)/standard # Fujitsu-specific # ---- -COMP_OPENMP = -DUSE_OMP -fopenmp +COMP_OPENMP = -fopenmp LINK_OPENMP = -lfjomp # ---- diff --git a/wmake/wmake b/wmake/wmake index 3a7e29c693..aef2fecb4a 100755 --- a/wmake/wmake +++ b/wmake/wmake @@ -75,6 +75,7 @@ cat<