diff --git a/.gitlab/issue_templates/bug.md b/.gitlab/issue_templates/bug.md index 9865f5a4fbaf106f3d454e67d63929cc9efac396..92c0451be659baabb5db5f51843b81de4493f5bb 100644 --- a/.gitlab/issue_templates/bug.md +++ b/.gitlab/issue_templates/bug.md @@ -49,7 +49,7 @@ <!-- Providing details of your set-up can help us identify any issues, e.g. - OpenFOAM version : v1806|v1812|v1906|v1912|v2006|v2012|v2106 etc + OpenFOAM version : v2112|v2106|v2012|v2006|v1912|v1906 etc Operating system : ubuntu|openSUSE|centos etc Hardware info : any info that may help? Compiler : gcc|intel|clang etc diff --git a/README.md b/README.md index cbfa00c6610ebb496803784efbcf68da8da70bfc..0aa0088095e653a2933ed719f8d2f7e7e03f9933 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,9 @@ Violations of the Trademark are monitored, and will be duly prosecuted. If OpenFOAM has already been compiled on your system, simply source the appropriate `etc/bashrc` or `etc/cshrc` file and get started. -For example, for the OpenFOAM-v2106 version: +For example, for the OpenFOAM-v2112 version: ``` -source /installation/path/OpenFOAM-v2106/etc/bashrc +source /installation/path/OpenFOAM-v2112/etc/bashrc ``` ## Compiling OpenFOAM @@ -127,8 +127,8 @@ These 3rd-party sources are normally located in a directory parallel to the OpenFOAM directory. For example, ``` /path/parent -|-- OpenFOAM-v2106 -\-- ThirdParty-v2106 +|-- OpenFOAM-v2112 +\-- ThirdParty-v2112 ``` There are, however, many cases where this simple convention is inadequate: @@ -136,7 +136,7 @@ There are, however, many cases where this simple convention is inadequate: operating system or cluster installation provides it) * When we have changed the OpenFOAM directory name to some arbitrary - directory name, e.g. openfoam-sandbox2106, etc.. + directory name, e.g. openfoam-sandbox2112, etc.. * When we would like any additional 3rd party software to be located inside of the OpenFOAM directory to ensure that the installation is @@ -156,9 +156,9 @@ when locating the ThirdParty directory with the following precedence: 2. PREFIX/ThirdParty-VERSION * this corresponds to the traditional approach 3. PREFIX/ThirdParty-vAPI - * allows for an updated value of VERSION, *eg*, `v2106-myCustom`, + * allows for an updated value of VERSION, *eg*, `v2112-myCustom`, without requiring a renamed ThirdParty. The API value would still - be `2106` and the original `ThirdParty-v2106/` would be found. + be `2112` and the original `ThirdParty-v2112/` would be found. 4. PREFIX/ThirdParty-API * same as the previous example, but using an unadorned API value. 5. PREFIX/ThirdParty-common diff --git a/bin/foamEtcFile b/bin/foamEtcFile index 3011e3cfe946058fb443d6c7c843a0d390097023..b62a5b2da3ba115d07b010d33e28ffa34eca0876 100755 --- a/bin/foamEtcFile +++ b/bin/foamEtcFile @@ -46,6 +46,9 @@ # The '-show-api' and '-show-patch' options extract values from # the "META-INFO/api-info" file # +# The '-show-build' options extract values from +# the "META-INFO/build-info" file +# # SeeAlso # META-INFO/README.md for other routines that also use META-INFO. # @@ -71,6 +74,7 @@ options: -etc=[DIR] set/unset FOAM_CONFIG_ETC for alternative etc directory -show-api Print META-INFO api value and exit -show-patch Print META-INFO patch value and exit + -show-build Print META-INFO build value and exit -with-api=NUM Specify alternative api value to search with -quiet (-q) Suppress all normal output -silent (-s) Suppress stderr, except -csh-verbose, -sh-verbose output @@ -155,6 +159,14 @@ getApiInfo() } +# Get 'build' from META-INFO/build-info +getBuildValue() +{ + value="$(sed -ne 's@^build *= *\([^ ]*\).*@\1@p' "$projectDir"/META-INFO/build-info 2>/dev/null)" + echo "$value" +} + + #------------------------------------------------------------------------------- unset shellOutput verboseOutput unset optAll optConfig optList projectApi @@ -177,6 +189,10 @@ do getApiInfo patch exit $? ;; + -show-build) # Show build information and exit + getBuildValue + exit $? + ;; -with-api=*) projectApi="${1#*=}" ;; diff --git a/bin/tools/source-bashrc b/bin/tools/source-bashrc index e4fec4062bc419606b3f8e147886d2f95fefa435..e95460fbfd27daf0535b02a85f1e74cafb7b44a7 100644 --- a/bin/tools/source-bashrc +++ b/bin/tools/source-bashrc @@ -5,7 +5,7 @@ # \\ / A nd | www.openfoam.com # \\/ M anipulation | #------------------------------------------------------------------------------ -# Copyright (C) 2019-2020 OpenCFD Ltd. +# Copyright (C) 2019-2021 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. @@ -68,26 +68,48 @@ then # Some feedback if [ -n "$PS1" ] && [ -d "$WM_PROJECT_DIR" ] then - info="$("$WM_PROJECT_DIR"/bin/foamEtcFile -show-patch 2>/dev/null)" - - # echo "Using: OpenFOAM-$WM_PROJECT_VERSION ($FOAM_API${info:+ patch=$info}) - visit www.openfoam.com" 1>&2 - echo "Using: OpenFOAM-$WM_PROJECT_VERSION${info:+ (patch=$info)} - visit www.openfoam.com" 1>&2 + _foam_api="$("$WM_PROJECT_DIR"/bin/foamEtcFile -show-api 2>/dev/null)" + _foam_patch="$("$WM_PROJECT_DIR"/bin/foamEtcFile -show-patch 2>/dev/null)" + _foam_build="$("$WM_PROJECT_DIR"/bin/foamEtcFile -show-build 2>/dev/null)" + + if [ "${_foam_patch:-0}" = 0 ] + then + unset _foam_patch + fi + if [ -n "$_foam_build" ] + then + # Everything there - format like binary -help output + _foam_build="${_foam_build}${_foam_patch:+ (patch=${_foam_patch})}" + _foam_verinfo="${_foam_api}" + else + # Missing build info - combine api and patch info together + _foam_verinfo="${_foam_api}${_foam_patch:+ patch=${_foam_patch}}" + fi + + echo "Using: OpenFOAM-$WM_PROJECT_VERSION (${_foam_verinfo}) - visit www.openfoam.com" 1>&2 + if [ -n "$_foam_build" ] + then + echo "Build: ${_foam_build}" 1>&2 + fi echo "Arch: $WM_OPTIONS (mpi=$FOAM_MPI)" 1>&2 + # Arch: LSB;label=32;scalar=64 - ## echo "$WM_PROJECT_DIR" 1>&2 ## echo 1>&2 # Set prompt as reminder that this is a shell session # Chalmers likes this one: - # PS1="OpenFOAM${FOAM_API:+-$FOAM_API}:"'$(foamPwd)\n\u\$ ' + # PS1="openfoam${_foam_api}:"'$(foamPwd)\n\u\$ ' - PS1="OpenFOAM${FOAM_API:+-$FOAM_API}:"'\w/\n\u\$ ' + PS1="openfoam${_foam_api}:"'\w/\n\u\$ ' + unset _foam_api _foam_patch _foam_build _foam_verinfo fi else echo "Could not locate OpenFOAM etc/bashrc in '$projectDir'" 1>&2 fi +echo 1>&2 +echo "openfoam = $WM_PROJECT_DIR" 1>&2 echo "OpenFOAM shell session - use exit to quit" 1>&2 echo 1>&2 diff --git a/doc/BuildIssues.md b/doc/BuildIssues.md index ba7cd8e99afc410fb66e83a3a57dc77bc4a38d22..a1625153dbc02b3d2892e8299d38873246aea74e 100644 --- a/doc/BuildIssues.md +++ b/doc/BuildIssues.md @@ -1,4 +1,4 @@ -## Known Build Issues (v2012, v2106) +## Known Build Issues (v2012, v2106, v2112) ### Windows cross-compilation