- more closely reflect what the binaries report
- report the installation path
- change PS1 case/separator to roughly correspond to package names
STYLE: adjust README to mention upcoming v2112
- add to wmakeFunctions to ensure it works even without 'make' being
installed. Exit immediately after -show-api for consistency with
-version.
foamEtcFile:
- drop warnings for some old (pre-v1812) defunct options
and simply flag as unknown options.
- handle -version, --version as equivalent to -show-api
- initial split of wmake-related commands into "plumbing" and
"porcelain" akin to how git handles things.
- wmakeBuildInfo (very low-level), now relocated to the wmake/scripts
and accessible for the user as "wmake -build-info".
This satisfies a long-standing desire to access build information
in a fashion similar to the api/patch information.
CONFIG: avoid git information when building with a debian/ directory
- when a 'debian/' directory exists, there is a high probability that
the '.git/' directory is from debian and not from OpenFOAM (ie,
useless here). This corresponds to an implicit '-no-git', which has
no effect when building from pristine sources.
ENH: wmakeCheckPwd becomes scripts/wmake-check-dir
- accessible for the user as "wmake -check-dir" and with 1 or 2
directory names. A wmakeCheckPwd symlink left for compatibility.
- 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.
- simplifies code, covers most cases.
Can use wmake -show-api or wmakeBuildInfo to query the make rules.
STYLE: Allwmake script adjustments
- use bin/foamEtcFile instead of relying on PATH.
The make environment may not have the OpenFOAM bin/ in it.
- simpler shell syntax
- now use findEtcEntry() instead to handle file or directory.
Added findEtcEntries(), which provides provides a common code basis
for findEtcDirs(), findEtcFiles() ...
- 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.
- provide default WM_DIR if not already set, to improve robustness if a
reduced environment is used
- add etc/ to WM_PROJECT_SITE search. This makes the site directory
structure consistent with the OpenFOAM structure.
Eg,
WM_PROJECT_SITE/etc/..
WM_PROJECT_SITE/bin/..
WM_PROJECT_SITE/platforms/..
- Don't set/export WM_OSTYPE. The default is POSIX and is properly
defaulted throughout, including in CMakeLists-OpenFOAM.txt (also for
Catalyst)
- forward command-line arguments for paraview, where they may also be
evaluated (cshrc, POSIX shell)
Eg,
. etc/bashrc ParaView_VERSION=5.4.1-mpipy
source etc/cshrc ParaView_VERSION=5.4.1-mpipy
- export library path for gmp/mpfr from CGAL config files.
This is required when non-system gmp/mpfr libraries are being
used, but not using a ThirdParty compiler installation.
- automatically handle lib/ vs lib64/ (eg, for central installations)
for packages such as boost, CGAL, etc. While the ThirdParty
compilation of these will normally land in lib64/, this may not be
the case when they are supplied by another means.
- reworked the handling of foamEtcFile and foamCleanPath for less
clutter in the configuration files.
Added the bin/tools/lib-dir script to handle logic that is
too complex to easily manage in csh.
- unknown options or missing option values now emit a shorter message
without the entire usage. This makes it easier to identify the errors
and is better aligned with the behaviour of GNU system tools.
====
$ simpleFoam -case
Using: OpenFOAM-plus (see www.OpenFOAM.com)
Build: plus-01234
Error: option '-case' requires an argument
See 'simpleFoam -help' for usage
====
- provide for reduced (-help) and full (-help-full) usage information.
In many cases the reduced usage provided sufficient and easier
to find the information.
- make -srcDoc an alias for -doc-source
- no warnings about option aliases for future dates.
- lazier evaluation of project name and version based on the directory
name. Avoids heuristics based on directory names unless really needed.
- cope with alternative directory locations.
For example, OpenFOAM+VERSION etc.
The combination of the two above appears to be sufficient to open up
the directory naming possibilities.
- additional -list-test option (tests for existence of directory).
- Eg, instead
if file=$(foamEtcFile filename)
then
. $file
fi
can write
eval "$(foamEtcFile -sh filename)"
Also supports -verbose reporting, which is especially useful for csh,
since it allows simplification of aliases and allows the message to
land on stderr instead of stdout.
eval `foamEtcFile -csh -verbose filename`
FOAM_INST_DIR is the location of the OpenFOAM installation which defaults to
the directory containing the etc/bashrc,cshrc file. If this default is
not appropriate FOAM_INST_DIR can be set explicitly.
- alternative to WM_PROJECT_INST_DIR/site for systems with locked down
installation paths (eg, when packaged as RPM or deb)
When "$WM_PROJECT_SITE" is defined, it is used in favour of
"$WM_PROJECT_INST_DIR/site"
For example, within the user ~/.OpenFOAM/<VER>/prefs.sh:
foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile -m go prefs.sh` \
&& _foamSource $foamPrefs
could be used to write a personal adjustment that also includes the
site-wide prefs.