- 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
- replace `%namespace` directive with simpler `%static` directive.
We always encapsulate Lemon parser routines in an anonymous
namespace, so a simpler static linkage directive suffices.
This reduces the size of the Lemon patch (program and template).
- remove make target for wmdep (flex-based scanner), which eliminates
a bootstrap dependency on flex.
As of OpenFOAM-v1806, wmdep has been superseded by wmdepend
(ragel-based scanner).
- replace dirToString binary with shell/awk equivalent for simpler
maintenance. The utility is very rarely used (auto scanning to
create Make/files) so there is no performance difference.
- fix typo in makefiles/info that affected wmake -show-compile-c
- additional safeguard in src/OpenFOAM/Make/options against self-linking.
This is not normally required unless PROJECT_LIBS has been added into
the link stage.
- 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)
- local token shifting was missing when getting the next file chunk
(while in the middle of parsing that text).
As well as adding the correct shifting, also tag the local buffer
with nullptr when it is done. Be extra paranoid and check the
raw buffer range before passing off to std::string.
- parsing error state only arises from a missing final newline
in the file (which the dnl macro does not capture).
Report with a warning instead of modifying the dnl macro since
we generally wish to know about this anyhow.
- add missing newline to YEqn.H file.
- the previous grammar used
'/*' { fgoto comment; }
to start processing multi-line comments and
comment := any* :>> '*/' @{ fgoto main; };
as a finishing action to return to normal lexing, but seemed not to
have been triggered properly.
Now simply trap in a single rule:
'/*' any* :>> '*/'; # Multi-line comment
STYLE: use more compact dnl (delete to newline)
OLD: [^\n]* '\n'
NEW: (any* -- '\n') '\n'
eliminates the intermediate state
- 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
This is similar to efforts (Feb 2010) but using ragel
(https://en.wikipedia.org/wiki/Ragel) instead of the now defunct
coco/r. The modified commit message from 2010:
ENH: add C++-based wmkdepend parser (uses ragel grammar).
- This avoids dependency on lex/flex and provides better encapsulation
for buffer switching. As a result, the maximum number of open files
only corresponds to the include depth.
--
Note that the flex source and rules are still available, but are not
deactivate (see wmake/rules/General/transform)
- caused by the typo '@E' instead of '$E' (commit 997f1713cb)
ENH: minor improvements for wmake/src makefile
- 'make clean' now also tries to remove the parent platforms/
directory if possible.
- the flex intermediate build target is placed into the platforms/
directory to avoid touching the src/ directory at all.
- suppress warnings about unused functions (GCC only)