- previously a function (unlike the csh version) but since bashrc and
setup have been split -> replace with inline definition
STYLE: formatting/wording for openfoam starters
TUT: simplify controlDict modification, add default substitution
ENH: accept '/' for end-of-options terminator (etc/openfoam)
- makes the application or service more apparent.
* eg. /usr/bin/openfoam / blockMesh
* vs. /usr/bin/openfoam -- blockMesh
Accept lone '-' as the end-of-options terminator, as per bash
- Adjust handling of openfoam '-c' option to flag that a command-string
will appear, but continue with option parsing.
Consistent with bash definition.
- ensures that subsequent Allwmake scripts know about it.
ENH: add bin/tools/query-detect wrapper for wmake have_* scripts
CONFIG: use project/ThirdParty without additional sanity checks
- no need to test for Allwmake or platforms/ if ThirdParty is located
within the project directory itself.
COMP: add simple mpi test to 00-dummy
- for testing library linkage, etc.
- use Clang instead of Gcc for Darwin since this is its system
compiler. The user can force use of Gcc by using Gcc92 etc.
- make etc/cshrc sed check more robust.
- replace tcsh (${%var}) syntax with ("${var}" != "")
[Fixes and ideas from Alexey Matveichev]
CONFIG: do not source the gperftools environment by default
- this is now an used feature, but can be re-enabled by advanced users
if required.
- missed detection of system libraries when installed with multiarch
paths like /usr/lib/x86_64-linux-gnu
CONFIG: improve handling of group/user config files (#928)
- changed bashrc handling of FOAM_CONFIG_NOUSER to use
FOAM_CONFIG_MODE instead. Propagate into foamEtcFile to make this
a stickier control.
This change allows better control, but also enables cluster
installations to define their own value within the OpenFOAM prefs.sh
file to prevent users accidentally mis-configuring things if
necessary.
- remove undocumented handling of an (a)ll mode in foamEtcFile to
avoid potential pitfalls.
- add support for FOAM_CONFIG_ETC handling.
This allows injection of an extra search layer when finding
project etc files
ENH: improvements to foamConfigurePaths (#928)
- handle FOAM_CONFIG_ETC implicitly, or explicitly with the new
-etc option.
STYLE: more explicit wording in foamConfigurePaths usage (#1602)
- document that an absolute path (eg, -scotch-path) overrides/ignores
the equivalent ThirdParty setting (eg, -scotch)
- longer options -system-compiler and -third-compiler for -system
and -third, respectively. Clearer as to their purpose.
- adjust the location sanity check to look for META-INFO directory.
- '-c' option (as per shell), '-Dkey[=value]' option to provide
preferences via the command-line. For example,
etc/openfoam -DWM_COMPILER=Clang -int64 ./Allwmake -j -s -l
These can also be combined with other options. Eg,
etc/openfoam -DWM_COMPILER=Clang \
-c 'wmake -show-path-cxx -show-cxxflags'
- relocated from bin/tools/ => etc/ for easier access
- bin/tools/openfoam.in : for autoconfig-style installation
- Auto-detect if the shell script was executed with openfoam and
interpret accordingly.
Simple example,
--------------
#!/usr/bin/openfoam
cd "${0%/*}" || exit # Run -*-sh-*- from this dir
blockMesh
simpleFoam
--------------
Note it is NOT currently possible to provide any other parameters
this way. Eg,
`#!/usr/bin/openfoam -sp` (NOT)
This will either fail to run, or result in infinite recursion.
- was WM_PROJECT_API in the environment and FOAM_API in dictionaries.
Make these both consistently FOAM_API.
This is a non-breaking change, since the value of WM_PROJECT_API
(added in 1812) and/or FOAM_API is purely informative.
For the current correct values, always use
* foamEtcFile -show-api
* wmakeBuildInfo -show-api
- Use the OPENFOAM define (eg, 1806, 1812), which normally corresponds
to a major release, to define an API level. This remains consistent
within a release cycle and means that it is possible to manage
several sub-versions and continue to have a consistent lookup.
The current API value is updated automatically during the build
and cached as meta data for later use, even when the wmake/ directory
is missing or OpenFOAM has not yet be initialized.
The version information reported on program start or with -help
usage adjusted to reflect this. The build tag from git now also
carries the date as being more meaningful to trace than a hash
value.
- Update etc/bashrc and etc/cshrc to obtain the project directory
directly instead of via its prefix directory. The value obtained
corresponds to an absolute path, from which the prefix directory
can be obtained.
The combination of these changes removes the reliance on any
particular directory naming convention.
For example,
With an 1812 version (API level):
WM_PROJECT_VERSION=myVersion
installed as /some/path/somewhere/openfoam-mySandbox
This makes the -prefix, -foamInstall, -projectVersion, -version
values of foamEtcFiles, and similar entries for foamConfigurePaths
superfluous.
WM_PROJECT_INST_DIR is no longer required or used
ENH: improve handling and discovery of ThirdParty
- improve the flexibility and reusability of ThirdParty packs to cover
various standard use cases:
1. Unpacking initial release tar files with two parallel directories
- OpenFOAM-v1812/
- ThirdParty-v1812/
2. With an adjusted OpenFOAM directory name, for whatever reason
- OpenFOAM-v1812-myCustom/
- openfoam-1812-other-info/
3. Operating with/without ThirdParty directory
To handle these use cases, the following discovery is used.
Note PROJECT = the OpenFOAM directory `$WM_PROJECT_DIR`
PREFIX = the parent directory
VERSION = `$WM_PROJECT_VERSION`
API = `$WM_PROJECT_API`, as per `foamEtcFiles -show-api`
0. PROJECT/ThirdParty
- for single-directory installations
1. PREFIX/ThirdParty-VERSION
- this corresponds to the traditional approach
2. PREFIX/ThirdParty-vAPI
- allows for an updated value of VERSION (eg, v1812-myCustom)
without requiring a renamed ThirdParty. The API value
would still be '1812' and the original ThirdParty-v1812/
would be found.
3. PREFIX/ThirdParty-API
- this is the same as the previous example, but using an unadorned
API value. This also makes sense if the chosen version name also
uses the unadorned API value in its naming
(eg, 1812-patch190131, 1812.19W03)
4. PREFIX/ThirdParty-common
- permits maximum reuse for various versions, but only for
experienced user who are aware of potential version
incompatibilities
Directory existence is checked as is the presence of an Allwmake file
or a platforms/ directory. This reduces the potential of false positive
matches and limits the selection to directories that are either
with sources (has the Allwmake file), or pre-compiled binaries (has
the platforms/ directory).
If none of the explored directories are found to be suitable,
it reverts to using a PROJECT/ThirdParty dummy location since
this is within the project source tree and can be trusted to
have no negative side-effects.
ENH: add csh support to foamConfigurePaths
- this removes the previously experienced inconsistence in config file
contents.
REMOVED: foamExec
- was previously used when switching versions and before the
bashrc/cshrc discovery logic was added. It is now obsolete.