Commit Graph

28 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
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
793f4e3a37 CONFIG: add support for WM_COMPILE_OPTION='Dbg'
- uses '-g -DFULLDEBUG' (like Debug), but with -O3 (like Opt).

  This adds in debug symbols and FULLDEBUG code segments (good for
  code development) but retains -O3 optimizations and code paths and
  avoids the much slower -O0 associated with 'Debug'.

- add in central wmake/General/common/{c,c++}XXX tuning,
  which helps reduce the number of nearly identical files

ENH: add support for wmake -debug-Og
2022-09-09 11:55:33 +02:00
Mark Olesen
a27af5e369 ENH: add optional control to use clang lld linker (#2449)
Eg,
    export WM_COMPILER=Clang130
    export WM_COMPILE_CONTROL="version=13.0 +lld"

- also support the mold linker (+mold) for clang

STYLE: report as 'link' stage instead of 'ld' in short messages
2022-04-29 11:44:28 +02:00
Mark Olesen
9423d2bd83 CONFIG: improve support for compiler/link options (#1830)
- introduce WM_COMPILE_CONTROL variable to convey control information
  into the build rules.

  The convention (as per spack):
      - '+' to select a feature
      - '~' to deselect a feature

  Eg, to select the gold linker, and disable openmp
  (spaces are not required):

      WM_COMPILE_CONTROL="+gold ~openmp"

CONFIG: accept FOAM_EXTRA_LDFLAGS for AMD, gold, Mingw linkers

CONFIG: generalize PROJECT_LIBS (-ldl used almost universally)
2020-09-07 09:45:51 +02:00
Mark Olesen
8bd9f41efd ENH: wmakeLnInclude support for multiple dirs and -force option (#1693)
STYLE: minor changes to makefiles
2020-05-12 08:00:26 +02:00
Mark Olesen
595579e01d COMP: use -iquotedir for including the local '.' directory
- adds into the include-quoted search list instead the general (-Idir)
  search list.

  * makes it less subject to ordering (since it will now generally be
    searched first) and makes it less subject to how duplicate removal
    is implemented. In some compilers (#1627), the last instance of
    a duplicate directory would be used and not the first instance.

  * removes clutter in some Make/options files

COMP: add missing linkage libraries
2020-05-06 13:06:40 +02:00
Mark Olesen
c853080d91 COMP: provide makefile fallbacks for FOAM_SOLVERS, FOAM_UTILITIES
- improves build robustness, even with a reduced environment (#517)
2020-05-06 09:11:04 +02:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
a54aff9d26 COMP: add wmake rules for mingw (#1238) 2019-04-28 13:36:50 +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
Mark Olesen
939144233c STYLE: adjusted wording and messages for wmake
- add an additional test for wmake pre-processing
2019-04-03 08:57:01 +02:00
Mark Olesen
51bf7af8ae ENH: support wmake -show options for compiler information (#1256)
- can be useful for retrieving the compilation flags for use with other
  make systems (eg, cmake)

  * wmake -show-compile   (C++ not C)
  * wmake -show-cxx
  * wmake -show-cxxflags
2019-04-01 09:03:48 +02:00
Mark Olesen
d2eb50832c ENH: add handling of lib/exe file extensions in makefile (#1238)
- relocates some logic from makefiles/general into platform-specific
  overrides
2019-03-14 10:42:57 +01:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
e3bb7ffd25 STYLE: avoid mix of 'sinclude' and '-include' in make files 2018-05-28 10:46:40 +02:00
Mark Olesen
52cf2d68c4 STYLE: avoid 'sed -i' in wmake rules
- less efficient and less portable than using single-pass processing
2018-04-08 22:15:21 +02:00
Henry Weller
961b653183 wmake: Suppress the "is up to date" messages
Avoids a lot of unnecessary clutter in the compilation log.
2016-11-13 22:41:42 +00:00
Henry Weller
b50d7d78f7 wmake: Removed unnecessary '->>' line from output
Changed 'ld' line to include path of target library or executable.
2016-11-13 22:14:53 +00:00
Henry Weller
82faf7eff0 wmake: Indent the 'result' message 2016-11-13 18:42:08 +00:00
Henry Weller
8a4c43e377 wmake: suppress "Nothing to be done for" messages 2016-11-13 15:16:42 +00:00
Henry Weller
79081ba3bb wmake: Simplified QUIET_MESSAGE function 2016-11-13 11:19:29 +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
Henry Weller
74e1352cc2 src/Pstream: Added Allwclean consistent with the Allwmake
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2218
2016-08-25 08:25:12 +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
c3a03105c4 wmake: Add support for compiler type default rules
which may be optionally overridden by version-specific rules.

For example the default rules for gcc on GNU/Linux x86_64 are in the
wmake/rules/linux64Gcc directory.  If there is a need to change any of
the rules for a specific version of gcc, e.g. gcc-4.8.4 the directory
wmake/rules/linux64Gcc48 may be created into which any of the language
files may be provided containing the rules to override the defaults.
2016-01-24 14:10:07 +00:00
Henry Weller
5355dbc5fe wmake: General cleanup to improve consistency and maintainability
The Makefiles are now in the makefiles sub-directory

The "-f | -force" option in wmakeLnInclude is now "-u | -update" for
consistency with the other scripts.

The "Usage" entry in the headers is now consistently formatted in all
scripts.
2015-12-16 18:31:02 +00:00