Commit Graph

84 Commits

Author SHA1 Message Date
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
c841aaed83 ENH: use atomic move in wmkdepend
- avoids truncated files if dependency generation is interrupted
2022-09-09 11:55:33 +02:00
Mark Olesen
9c727abb84 COMP: increment lemon sources, fix stray comment char (wmkdepend)
COMP: compile utilites before solvers

- there are no inter-dependencies,
  so favour getting utilities working first
2022-05-11 09:53:58 +02:00
Mark Olesen
79e110aeb0 ENH: update lemon version, wmake wrappers 2021-11-09 21:17:51 +01:00
Mark Olesen
f7c8e39804 ENH: update lemon version (#1768)
- upstream fixes: minor compiler warnings, style changes
2020-11-07 18:04:55 +01:00
Mark Olesen
52025dfb1b STYLE: add END tag for dependency files
- aids when locating truncated files
2020-09-23 09:25:07 +02:00
Mark Olesen
1178fc190b CONFIG: add runtime settings for mingw cross-compiled binaries
- WM_ARCH=win64 to indicate the runtime environment

ENH: cross-compile wmake toolchain for the target-side as well
2020-08-06 19:36:19 +02:00
Mark Olesen
6365bab800 ENH: update lemon version and linkage directive (#1768)
- 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).
2020-07-10 12:01:58 +02:00
Mark Olesen
f644d78bde Merge remote-tracking branch 'origin/master' into develop 2020-04-06 12:38:57 +02:00
Mark Olesen
a8b6d01b87 CONFIG: relocate wmake binaries into project platforms/tools (#1647)
- can aid when creating source-only or binary-only packages
2020-04-06 08:32:42 +02:00
Mark Olesen
9b67ffaf74 COMP: update lemon to 2019-12-19 version 2020-01-13 13:56:23 +01:00
Mark Olesen
9edaf8bfa5 CONFIG: default compilation is 'Opt' in Makefiles
- only include compiler-family rules for C++ once

STYLE: minor cleanup of wmake/src Makefile
2019-12-16 11:22:16 +01:00
Mark Olesen
624591b886 COMP: ignore unused-const-variable in generated scanner code 2019-12-15 13:28:24 +01:00
Mark Olesen
75ba4a07ef STYLE: consistent quoting for 'cd' 2019-12-14 13:34:48 +01:00
Mark Olesen
98467036b3 STYLE: regularize quoting and exit on failed 'cd' 2019-11-13 13:19:16 +01:00
Mark Olesen
ec7e3c88e4 ENH: test for WM_PROJECT_DIR being set/unset in scripts 2019-11-06 09:18:51 +01:00
Andrew Heather
fdf8d10ab4 Merge commit 'e9219558d7' into develop-v1906 2019-12-05 11:47:19 +00:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
4e706c2625 COMP: add createCode helper scripts 2019-10-29 10:46:15 +01:00
Mark Olesen
80daea6017 CONFIG: update lemon code to version from 2019-09-11 2019-10-28 14:30:05 +01:00
Mark Olesen
f1ed0a617b COMP: add lemon parser and skeleton code 2019-09-27 11:09:40 +02:00
Mark Olesen
894645f9e1 CONFIG: update wmake rules for parsers
- include ragel and lemon

- rename pre-generated files to ".cc" so that they are more
  recognizable as being different from regular file content.
2019-08-16 10:06:08 +02:00
Mark Olesen
70b0013cac STYLE: adjust wording in some documentation (#1406) 2019-08-21 15:44:26 +02:00
Mark Olesen
53b88d99a3 COMP: only compile wmake toolchain for host when cross-compiling
- no use having wmkdepend on the target architecture when it will only
  be needed on the host architecture.
2019-06-09 19:21:27 +02:00
Mark Olesen
b46992f66b COMP: compile wmake toolchain for host when cross-compiling 2019-06-07 10:32:37 +02:00
Mark Olesen
137130e437 ENH: reduce wmake bootstrap dependencies
- 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.
2019-06-07 09:51:18 +02:00
Mark Olesen
4a1208ed30 ENH: add handling of exe file extensions in wmake/src/Makefile (#1238)
- change internal naming from 'EXE_EXT' to 'EXT_EXE' for symmetry with
  'EXT_SO'
2019-04-26 14:20:01 +02:00
Mark Olesen
2d7c266d37 STYLE: formatting in makefiles, config files
- 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.
2019-04-16 12:39:25 +02:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00: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
973a940028 COMP: provide Allmake script for wmake tools
- convenient when bootstrapping some systems
2018-11-22 09:35:17 +01:00
Mark Olesen
aafbb6723f BUG: wmkdepend sometimes throws (closes #1036)
- 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.
2018-10-10 15:33:35 +02:00
Mark Olesen
c0766ce8ea STYLE: consistent '// End namespace' markers 2018-04-27 09:51:35 +02:00
Mark Olesen
ebfe46503f STYLE: improve wmkdepend parse error message
- 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.
2018-04-25 14:37:59 +02:00
Mark Olesen
1f25c5975d BUG: wmkdepend finds 'include' in multi-line comments (closes #784)
- 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
2018-04-20 14:41:32 +02:00
Mark Olesen
aeef1cd4df BUG: wmkdepend parser missing some files
- adjusted grammar to be more precise
2018-04-17 09:20:01 +02:00
Mark Olesen
b29a0119de ENH: minor code tidying, machine simplifications for wmkdepend parser 2018-04-13 16:17:39 +02: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
1676bd4003 ENH: replace flex-based wmkdep with ragel-based parser (issue #784)
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)
2018-04-11 12:31:36 +02:00
mattijs
b854ce228e ENH: wmkdep: better error message. See #784. 2018-03-28 16:39:05 +01:00
Mark Olesen
df403965ab ENH: suppress wmkdep 'No such file' warnings in wmake -silent mode 2017-06-27 09:29:56 +02:00
Mark Olesen
249f334f83 ENH: respect '-silent' option for cmake builds
- minor cleanup of wmake sources
2017-03-15 13:06:45 +01:00
Mark Olesen
10fc0646fb BUG: 'make clean' failed for wmake/src
- 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)
2017-03-09 11:48:52 +01:00
Mark Olesen
2bfd17cf8d ENH: add 'wmkdep' to warnings and error messages from wmkdep
- makes it possible to filter out or highlight messages originating
  from wmkdep in the build process.
2017-03-09 10:20:14 +01:00
mark
e82a029453 ENH: add help/usage for dirToString, wmkdep. Add dirToString -strip option.
- The dirToString -strip option is simple, but reduces effort for the caller.
2017-02-10 14:10:00 +01:00
Henry Weller
5050a6cf10 wmkdep.l: Removed redundant #include 2016-11-14 11:22:00 +00:00
Henry Weller
2dbfe2a75e wmake: Moved wmkdep messages into rules/General/transform makefile 2016-11-14 08:32:30 +00:00
Henry Weller
79081ba3bb wmake: Simplified QUIET_MESSAGE function 2016-11-13 11:19:29 +00:00
Henry Weller
8b0ec47566 wmake/src/Makefile: Removed additional $E 2016-11-13 10:24:16 +00:00
Henry Weller
997f1713cb wmake: Update '-s' option to print the files processed without the rules
Based on patch contributed by Alexey Matveichev
Resolves feature request http://bugs.openfoam.org/view.php?id=2328
2016-11-12 22:01:44 +00:00