Commit Graph

41 Commits

Author SHA1 Message Date
Mark Olesen
d086cc5a0e COMP: stricter handling of openmp vs no-openmp
- give precedence to ~openmp (-no-openmp) over +openmp (-openmp)
  in the general rules and in the Makefile. This makes it robuster
  when specifying +openmp in general, but ~openmp for specific build
  components.

- disable openmp for OSspecific and Pstream components.
  Neither should contain any openmp code anyhow.

  Additionally, since OSspecific is generally built as a static
  object, it can become problematic (eg, with AMD ROCm) if the
  compiler generates information that openmp is required but then uses
  static linkage.
2023-12-11 15:56:00 +01:00
Mark Olesen
778796853d CONFIG: enable use of stricter deprecation warnings
- selected with '+strict' in WM_COMPILE_CONTROL or 'wmake -strict', it
  enables the FOAM_DEPRECATED_STRICT() macro, which can be used to
  mark methods that are implicitly deprecated, but are not yet marked
  as full deprecated (eg, API modification is too recent, generates
  too many warnings).  Can be considered a developer option.
2023-08-21 08:39:36 +02:00
Mark Olesen
9f7cfa9419 ENH: support libz disabling via WM_COMPILE_CONTROL (as ~libz)
- eg, for partially incomplete systems (without libz devel header)

ENH: clearer binding of dummy Pstream in OpenFOAM/Make/options

- link of dummy stub Pstream now contingent on linking libOpenFOAM as
  well. This makes the purpose slightly clearer

ENH: cleaner option naming/handling in wmake script

- allow special purpose -no-openfoam option.
  Eg, compiling test programs without OpenFOAM and Pstream libraries
  but using the rest of the wmake system.

ENH: add +openmp support into WM_COMPILE_CONTROL (#2633)

- this adds compile/link flags for openmp.
  For single-use, can also use 'wmake -openmp'.

  If both +openmp and ~openmp are specified in WM_COMPILE_CONTROL
  the ~openmp will have priority.

  This is actually done indirectly since ~openmp will set empty
  COMP_OPENMP, LINK_OPENMP internal variables, which the +openmp then
  adds to the c++FLAGS and linkexe targets (ie, won't actually add
  anything).

ENH: add +ccache or ccache=... support into WM_COMPILE_CONTROL (#2633)

- with the first version (+ccache), simply use ccache from the path
  without any extra options.

- with the second version (ccache=...), can be more specific about
  what is called.

  Using "+ccache" is identical to "ccache=ccache", but the later could
  be used in other ways. For example,

     ccache=/strange/install/path/ccache
     ccache=</path/my-tooling --option>

  Have the choice of unquoted, single or double quoted or '< >' quoted

STYLE: relocate FOAM_EXTRA_LDFLAGS in general makefile

- removes clutter for different linkers (eg, gold, mold, ldd)
  making it easier to extend for other linkers.

STYLE: protect makefile checks with 'strip' function
2022-11-15 14:00:18 +01:00
Mark Olesen
2c77514417 CONFIG: support wmake -debug-O0, -debug-O1 etc.
- rearranged order of flags so that FOAM_EXTRA_CXXFLAGS is added
  after the WARN/OPT/DBUG flags

CONFIG: drop wmake rules for PGI compiler (defunct)
2022-06-02 22:37:00 +02:00
Mark Olesen
8624d65c5a ENH: support alternative build-root location (#2286)
- specify any of these

    ./Allwmake -build-root=...
    wmake -build-root=...
    FOAM_BUILDROOT=... wmake

  these specify an alternative root where build artifacts are to land.
  Currently only used as an alternative for the 'build/' hierarchy
  since the 'platforms/' target normally includes inputs as well.

  Possible use:
  ```
  (
      export WM_MPLIB="%{foam_mplib}"
      export FOAM_MPI="%{foam_mpi}"
      export MPI_ARCH_PATH="%{mpi_prefix}"

      export FOAM_BUILDROOT=/tmp/mpibuild
      export FOAM_MPI_LIBBIN="$FOAM_BUILDROOT/platforms/$WM_OPTIONS/lib/$FOAM_MPI"

      src/Pstream/Allwmake-mpi
   )
   ```
2021-12-03 17:10:22 +01:00
Mark Olesen
e681c127f2 CONFIG: accept module-prefix 'none' as equivalent to 'false' (ie, disabled) 2021-05-31 11:14:49 +02:00
Mark Olesen
e58b59ed6f CONFIG: pass through -prefix=false (ie, disable) 2020-12-21 23:52:28 +01:00
Mark Olesen
66c8607d5f CONFIG: trap -with-bear, but continue argument processing
- makes it easier to combine with -log options etc.
2020-11-30 10:21:57 +01:00
Mark Olesen
9c86b5d722 ENH: robustness improvements for wmakeFunctions
- relocated module-prefix handling to wmakeFunctions
2020-11-26 12:54:46 +01:00
Mark Olesen
a50047bbcc ENH: add hook for bear frontend to create json output (#1936)
Example usage,

   wmake -with-bear src/OpenFOAM
   src/Allwmake -with-bear -s -j

- bin/tools/vscode-settings

  Emit some json content suitable for setting up Visual Studio Code
  for use with OpenFOAM.

  For example,
      bin/tools/vscode-settings > .vscode/settings.json

Ideas from Volker Weissman
2020-11-26 12:54:46 +01:00
Mark Olesen
37895095d7 ENH: also support --prefix for AllwmakeParseArguments
- corresponds to general conventions/expectations
2020-06-24 16:10:41 +02:00
Mark Olesen
5d364f886a BUG: swallowed -fromWmake argument 934d0bd743
- should pass onwards to other Allwmake scripts
2020-06-08 15:57:03 +02:00
Mark Olesen
934d0bd743 ENH: support FOAM_MODULE_PREFIX to guide location of module builds (#1721)
- When compiling additional modules or user code, we need more control
  for the installation locations beyond the usual FOAM_USER_LIBBIN,
  FOAM_SITE_LIBBIN, FOAM_LIBBIN, and wish to have these values be
  modifiable without editing files.

- provide wmake rules for handling standard defaults:
    * GENERAL_RULES/module-path-user
    * GENERAL_RULES/module-path-group
    * GENERAL_RULES/module-path-project
  which are incorporated as follows:

  Make/options:
      include $(GENERAL_RULES)/module-path-user

  Make/files:
      LIB = $(FOAM_MODULE_LIBBIN)/libMyLibrary

  By default these would compile into FOAM_USER_{APPBIN,LIBBIN} but
  could be adjusted at compilation time. For example,

```
wmake -module-prefix=/path/my-install-location
```
Or
```
./Allwmake -module-prefix=/path/my-install-location
./Allwmake -prefix=/path/my-install-location
```
Or
```
FOAM_MODULE_PREFIX=/path/my-install-location ./Allwmake
```

ENH: add -no-recursion option for AllwmakeParseArguments

- more descriptive naming than the -fromWmake option (still supported)

- remove wmake/scripts/wmake.{cmake,wmake}-args since the -prefix
  handling and -no-recursion is now directly handled by AllwmakeParseArguments
2020-06-08 13:51:26 +02:00
Mark Olesen
816e96e0f2 ENH: tuning wmake behaviour (#1647)
- preferentially handle Allwmake.override, which allows packaging
  tools to define alternative make scripts, or selectively disable
  components.

- remove legacy handling of 'Optional' directory.
  Conditionals have since migrated into scripts themselves and/or
  use the wmake/scripts/have_* framework.

BUG: missed passing -debug for Allwmake scripts
2020-03-25 10:41:29 +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
Mark Olesen
ec7e3c88e4 ENH: test for WM_PROJECT_DIR being set/unset in scripts 2019-11-06 09:18:51 +01:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
fc11c40841 ENH: add wmake -debug option
- forces c++DBUG='-DFULLDEBUG -g -O0' for the compilation, to allow
  localized debugging during development without file editing and
  while retaining the WM_COMPILE_OPTION (eg, Opt)

  Note that switching between 'wmake' and 'wmake -debug' will not
  cause existing targets to be rebuilt. As before, these are driven by
  the dependencies. An intermediate wclean may thus be required.
2019-06-03 10:16:31 +02:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
65e94fde66 DEFEATURE: remove wmakeScheduler (issue #1178)
- was for parallel compilation across multiple hosts, but less useful
  with modern CPUs with higher number of cores and/or hyperthreading.

  Fragile use and dependent on a 'lockfile' utility that is not often
  installed.
2019-01-23 12:43:41 +01:00
Mark Olesen
de72a04aeb ENH: make it easier to switch between the various make dependencies programs.
- However, the new ragel-based parser is much faster
  than the others, and does not cause 'too many open files' error
  that the flex-based parser does (issue #784).

  The timings (using src/sampling as being somewhat representative)

    $ wclean; wmakeLnInclude -u .; time wmake -s dep

        3.4s  wmkdepend (ragel) [now default]
        5.7s  wmkdep (flex)
        6.1s  cpp -M

- The makeDepend script is for testing purposes only, but could used as
  a hook for other dependency generation systems (eg, ninja).
  It simply wraps 'cpp -M' in a form that is calling compatible with
  wmkdepend.

BUG: wmkdepend parser was missing optional leading space on #include match

STYLE: use -G2 (goto-based) option for wmkdepend state machine

- the machine is compact with few states and lends itself to this
2018-04-12 10:14:03 +02: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
Andrew Heather
436ec1cf1f MRG: Integrated Foundation code to commit ba4dbed 2017-03-23 12:11:49 +00:00
Henry Weller
f92862a42c Allwmake: Provides clearer message when OpenFOAM environment is not loaded
Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2424
2017-01-28 17:57:13 +00:00
Mark Olesen
608bb5d83b COMP: update lnInclude directories when building (issue #364)
- Could be related to interrupted builds.
  So if there are any parts of the build that rely on an explicit
  'wmakeLnInclude', make sure that the contents are properly updated.

--

ENH: improved feedback from top-level Allwmake

- Report which section (libraries, applications) is being built.

- Provide final summary of date, version, etc, which can be helpful
  for later diagnosis or record keeping.

- The -log=XXX option for Allwmake now accepts a directory name
  and automatically appends an appropriate log name.
  Eg,
      ./Allwmake -log=logs/  ->> logs/log.linux64GccDPInt32Opt

  The default name is built from the value of WM_OPTIONS.

--

BUG: shell not exiting properly in combination with -log option

- the use of 'tee' causes the shell to hang around.
  Added an explicit exit to catch this.

--

- Detecting the '-k' (-non-stop) option at the top-level Allwmake, which
  may improve robustness.

- Explicit continue-on-error for foamyMesh (as optional component)

- unify format of script messages for better readability

COMP: reduce warnings when building Pstream (old-style casts in openmpi)
2016-12-22 11:26:29 +01:00
Mark Olesen
91b7ede14b STYLE: adjust log name for 'Allwmake -log' (issue #333)
- now defaults to 'log.$WM_OPTIONS' (eg, log.linux64GccDPInt32Opt)
  for more clarity and fewer potential name clashes when building
  multiple versions.
2016-12-15 13:20:21 +01:00
Mark Olesen
13c3b1d617 ENH: Allwmake -log=name option to specify log name (issue #333)
- helpful when testing various builds
2016-12-13 20:53:05 +01:00
Mark Olesen
eb00c8021d ENH: provide log option for top-level builds (issue #333) 2016-12-09 14:44:26 +00:00
Henry Weller
5ffdb2d4b3 wmake/scripts/AllwmakeParseArguments: Avoid duplicate command message
when Allwmake is called from wmake -all
2016-11-14 12:37:52 +00:00
Henry Weller
80db302666 Allwmake: Remove 'set -x' which generates a lot of noise
'set -x' should be used for debugging.

Added command printing into wmake and Allwmake as a replacement for
'set -x' to log current target.
2016-11-13 18:08:22 +00:00
Henry Weller
47b9b3a88a AllwmakeParseArguments: Correct call to wmake -all
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2146
2016-07-10 22:04:50 +01:00
Henry Weller
a7fa5699df AllwmakeParseArguments: Filter-out '-q' option to avoid recusion 2016-07-07 16:22:08 +01:00
Henry Weller
af8e0f1443 AllwmakeParseArguments: Moved all parallel processing options into wmake
and added support for queue scheduling option '-q', '-queue'

Now the 'Allwmake' scripts execute 'wmake -all' to handle parallel
processing in a general way, avoiding code duplication.
2016-07-04 22:30:20 +01:00
Henry Weller
dea6a3c6e8 wmake/Allwmake: Completed support for targetType 'objects'
Patch contributed by Mattijs Janssens
2016-06-24 15:25:11 +01:00
Henry Weller
326b646bb8 Allwmake -update: Further improvements to handle source-tree/dep file inconsistencies after git pull
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2091
2016-06-11 16:28:40 +01:00
Henry Weller
e7fc198592 Allwmake: improved '-update' option to handle out-of-date '.dep' files
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2091
2016-05-16 12:21:57 +01:00
Henry Weller
350d03246e scripts: Reformat with consistent section separators 2016-02-15 18:30:24 +00:00
Henry Weller
3de4dcd838 AllwmakeParseArguments: Added "-update" option
Updates lnInclude directories and dep files before compilation.  This is
useful to apply following a "git pull" to ensure consistency between the
source files, dep files and links.
2015-12-14 11:03:16 +00:00
Henry
1dd5b93897 wmake/scripts/AllwmakeParseArguments: Handle stop-on-error
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1485
2015-01-10 21:58:19 +00:00
Henry
d11ce0b517 Corrected typo 2015-01-10 21:12:27 +00:00
Henry
844b283030 New version of wmake supporting out-of-tree object and dependency files 2014-12-14 21:42:18 +00:00