Commit Graph

46 Commits

Author SHA1 Message Date
Mark Olesen
bcf8a48c68 CONFIG: add build information into shell session
- 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
2021-11-25 17:36:37 +01:00
Mark Olesen
fddf8a8832 ENH: add -help-full option for foamEtcFile 2021-11-02 21:14:41 +01:00
Mark Olesen
c7bde70ecb ENH: robustness, consistency for wmake -show-api, -version
- 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
2021-06-10 08:34:43 +02:00
Mark Olesen
a6e86caa62 ENH: improvements for FOAM_CONFIG_ETC
- handle relative directory names for FOAM_CONFIG_ETC
2020-08-11 13:16:03 +02:00
Mark Olesen
9e3d06853e ENH: add 'subcommand' handling to wmake (#1693)
- 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.
2020-05-12 10:05:24 +02:00
Mark Olesen
5ba2cbc54f CONFIG: improve prefix matching for system libraries (#1607)
- 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.
2020-02-24 16:00:16 +01:00
Mark Olesen
d483123cef STYLE: limit foamEtcFile -show-api to querying the META-INFO/api-info
- 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
2020-02-12 17:48:09 +01:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
2db0db3006 BUG: stringOps etc expansion fails for directories (issue #1121)
- now use findEtcEntry() instead to handle file or directory.

  Added findEtcEntries(), which provides provides a common code basis
  for findEtcDirs(), findEtcFiles() ...
2018-12-13 12:48:31 +01:00
Mark Olesen
6c68c34e1a ENH: update handling of versioning and make control (issue #1010)
- 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.
2018-12-02 18:25:57 +01:00
Mark Olesen
b8c257d6ad CONFIG: adjustments to environment
- 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)
2018-12-03 09:50:48 +01:00
Mark Olesen
7964d31d03 STYLE: remove special '.' version handling in foamEtcFile
- this would automatically change openfoam<digits> into maj.min.rel
  values, thus transforming openfoam1806 into a version "1.8.0.6" !
2018-11-24 00:36:31 +01:00
Mark Olesen
de4a1eeedb CONFIG: improve evaluation of arguments for foamEtcFile
- 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
2018-01-24 12:15:09 +01:00
Mark Olesen
110b00f048 ENH: improved handling of gmp/mpfr library settings (issue #674)
- 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.
2018-01-11 01:30:23 +01:00
Mark Olesen
19c3875a14 CONFIG: update tcsh completion_cache to include finiteArea and cfmesh
- include bash completion for paraFoam, and provision for using
  foamEtcFile as well.
2017-12-18 14:26:49 +01:00
Mark Olesen
5947f9a337 ENH: more succinct output from command-line errors.
- 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.
2017-11-24 10:27:11 +01:00
Mark Olesen
d65ca495d3 STYLE: minor changes in comments 2017-11-22 10:52:42 +01:00
Mark Olesen
c341b22f9d STYLE: use hard-coded user resource directory name for foamEtcFile
- previously used the value of $WM_PROJECT, but this is potentially
  inconsistent with what Foam::etcFiles uses.
2017-03-31 09:54:20 +02:00
Mark Olesen
bad27c45fc ENH: several improvements to foamEtcFile
- 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).
2017-03-23 10:31:05 +01:00
Mark Olesen
ace5565f96 ENH: improve foamEtcFile support for alternative naming conventions
- support names like openfoam-<VERSION> (eg, what spack uses).
- robustness improvements
2017-03-22 09:08:52 +01:00
Mark Olesen
c9e4fd77fd ENH: add options for foamEtcFile and shell evaluation
- 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`
2017-02-23 12:48:43 +01:00
Mark Olesen
cc51def1fd STYLE: minor cleanup of foamEtcFile 2017-02-23 09:17:46 +01:00
Mark Olesen
d3911dd167 STYLE: avoid old-style shell backticks in various places 2017-02-20 09:30:58 +01:00
Chris Greenshields
b5e263be0d foamEtcFile: replaced redundant package directory name 2016-09-09 20:00:26 +01:00
Henry Weller
2b71ea6f58 Update headers 2016-06-06 17:22:23 +01:00
Henry Weller
b7243e2d19 etc/bashrc,cshrc: Simplify and automate the setting of FOAM_INST_DIR
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.
2016-06-06 17:20:10 +01:00
Henry Weller
1d8ef28cb8 foamEtcFile: Add support for openfoamdev 2015-10-26 17:35:27 +00:00
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
Mark Olesen
d8a812ced1 ENH: add '-all' option to foamEtcFile for similar results as findEtcFiles 2011-07-14 11:26:42 +02:00
Mark Olesen
22fae65263 BUG: FOAM_INST_DIR (or prefix) not passed correctly from foamExec 2011-04-28 15:33:38 +02:00
Mark Olesen
debb4b42fd ENH: add foamEtcFile -silent option to suppress stderr
- need to trap possibly weird input within etc/bashrc, etc/cshrc and
  can't easily redirect stderr in csh.
2011-04-27 16:55:32 +02:00
Mark Olesen
9cbc0efca3 ENH: add support for WM_PROJECT_SITE env variable
- 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"
2011-03-11 18:32:18 +01:00
Mark Olesen
56e07de724 STYLE: changed some missed doxygen '@' to '\' 2011-02-14 10:00:48 +01:00
andy
14d1300a36 Revert "STyLE: More 2011 copyright dates (non-code)."
This reverts commit 2e1e671d96.
2011-01-05 18:25:32 +00:00
graham
2e1e671d96 STyLE: More 2011 copyright dates (non-code). 2011-01-05 11:48:24 +00:00
Mark Olesen
48696bdb45 ENH: silently remove leading ~OpenFOAM/ in bin/foamEtcFile
- makes it easier to cut-and-paste from dictionary contents that use
  the Foam::findEtcFile expansion
2010-07-12 11:48:24 +02:00
Mark Olesen
43407380f9 ENH: improve debian handling in foamEtcFile
- remove all corresponding logic from foamExec
2010-07-06 16:33:25 +02:00
Mark Olesen
fd0bcbb480 Merge remote branch 'OpenCFD/master' into olesenm
Conflicts:
	bin/foamExec
2010-07-06 14:30:30 +02:00
Mark Olesen
9745b86ef3 ENH: improve foamEtcFile handling (-prefix, -version options)
- This lets foamExec use foamEtcFile as well, but debian packaging
  still needs some work
2010-07-06 14:01:15 +02:00
Mark Olesen
d29c438657 STYLE: use url for FSF license instead of postal address, switch to GPL v3 2010-03-29 14:07:56 +02:00
Mark Olesen
f1d03a3802 ENH: cleanup shell scripts, BUG: unclosed 'if' in inlineReplace 2010-03-23 14:05:51 +01:00
mattijs
f65fe3244a BUG: foamEtcFile cannot use 'case' inside $( ) construct.
Reverted to using additional variable.
2010-03-22 17:33:56 +00:00
Mark Olesen
3ee8595169 ENH: add -m <mode> option to foamEtcFile to allow chaining.
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.
2010-03-19 13:06:49 +01:00
Mark Olesen
07283ff315 ENH: add -builtin option to paraFoam (VTK builtin OpenFOAM reader)
- Also adjusted formatting of usage to match what argList generates
2010-02-05 08:36:44 +01:00
Mark Olesen
dfd42b6b4a new script - foamEtcFile
- Locate user/site/shipped file with the semantics used in the
  ~OpenFOAM/fileName expansion
2009-07-23 20:26:40 +02:00