Commit Graph

16 Commits

Author SHA1 Message Date
Mark Olesen
139a8fc6ff STYLE: use SPDX-style for scripts 2023-05-10 18:23:13 +02: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
bef508dedc ENH: make use of FOAM_API for environment as well (issue #1158)
- 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
2019-01-10 12:21:19 +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
9e094f1f07 ENH: relocate WM_PROJECT_SITE default (issue #1050)
- was PREFIX/site, now PROJECT/site

  This avoids several issues when installing OpenFOAM in clusters
  without an intermediate OpenFOAM-specific installation prefix.

  The 'site' directory may have a reserved meaning in these situations
  and it is undesirable to 'leak' upwards into the parent directory to
  look for configuration files.

  Placing the default within the project directory avoids this.
  Alternative locations can be given via the WM_PROJECT_SITE variable.
2018-11-29 18:04:44 +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
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01: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
f691fe7896 STYLE: more consistent use of stderr for script usage 2011-02-15 16:48:26 +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
0f58ac5a9b ENH: abort if rsync is missing - foamCopySettings, foamNewCase 2010-04-12 11:12:51 +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
andy
5332347887 ENH: minor typo 2010-03-17 14:57:26 +00:00
Mark Olesen
1fe4264f3f ENH: add foamNewCase script
Create a new case from a template for particular applications
2010-03-03 10:49:12 +01:00