Commit Graph

29 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
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
c7bde70ecb ENH: robustness, consistency for wmake -show-api, -version
- add to wmakeFunctions to ensure it works even without 'make' being
  installed. Exit immediately after -show-api for consistency with
  -version.

foamEtcFile:
  - drop warnings for some old (pre-v1812) defunct options
    and simply flag as unknown options.
  - handle -version, --version as equivalent to -show-api
2021-06-10 08:34:43 +02: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
9c86b5d722 ENH: robustness improvements for wmakeFunctions
- relocated module-prefix handling to wmakeFunctions
2020-11-26 12:54:46 +01:00
Mark Olesen
4cf44850a7 CONFIG: detect newer adios library name (fixes #1911)
ENH: provide fallback prefix for cmake detection

STYLE: simplify some shell syntax, avoid uname call in sysFunctions

STYLE: report FOAM_MPI during mpiLib builds
2020-11-09 15:43:52 +01:00
Mark Olesen
dd1c2edb6b COMP: wmake findObjectDir fails for non-project directories (fixes #1807)
- experienced while reusing src/Pstream/Allwmake-mpi to create
  additional mpi-layers after installation. Since the copied sources
  are not located within the OpenFOAM source-tree (and/or the
  source-tree is non-writable), it should not and does not use the
  central build/WM_OPTIONS directory.

  However, when exploring for the appropriate local Make directory, it
  searched for the current '.' directory instead of checking for the
  resolved directory.

  This fails, since there is no src/Pstream/Make directory.
  Must check for src/Pstream/mpi/Make directory first!

- Adjust wclean to always remove a local build directory
  (Make/WM_OPTIONS) for additional safety.
  After which, attempt to remove central build/WM_OPTIONS version too.
2020-08-12 12:33:34 +02:00
Mark Olesen
ed3c6bcb63 COMP: only use Project/build if Project directory is writable (#1693) 2020-05-12 10:16:18 +02:00
Mark Olesen
d4e31093fd ENH: improved encapsulation of MPI (re)builds
- dependency handling relocated from cmakeFunctions to wmakeFunctions
  and reused for mpi-versioned builds. This allows more checks for
  configuration parameters and removes hard-code build path
  information.

CONFIG: remove spurious mplibHPMPI entries

CONFIG: remove ADIOS1 rules (antiquated)
2020-05-12 10:05:47 +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
e6dfb39c66 STYLE: remove unnecessary stdout, stderr /dev/null redirects
- no stderr redirect needed:
    * 'command -v'

- no stdout/stderr redirect needed:
    * 'rm -f'

STYLE: consistent spacing after redirects
2019-11-06 10:44:36 +01: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
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
2768500d57 CONFIG: remove WM_LINK_LANGUAGE env variable (always c++)
- was somewhat redundant in wmake/rules/General/general anyhow
2018-04-24 14:59:47 +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
b970ba0901 ENH: minor improvements to environment
- handle sourcing bashrc with a relative path (issue #383)
- handle sourcing from bash and zsh.
  Still need manual intervention when sourcing dash, sh, or ksh.
- replace grep in etc/cshrc with sed only
- logical instead of physical path for WM_PROJECT_DIR (issue #431).
  Doesn't seem to be possible for csh/tcsh.

  * Continue using physical locations when comparing directories,
    but not for the top-level FOAM_INST_DIR, WM_PROJECT_DIR.

- relocate WM_CC, WM_CXX overrides from etc/config.*/compiler
  to etc/config.*/settings to ensure that they are left untouched
  when etc/config.sh/compiler is sourced while making third-party
  packages (eg, gcc, llvm, CGAL).

- provide fallback FOAM_TUTORIALS setting in RunFunctions

STYLE: remove "~OpenFOAM" fallback as being too rare, non-obvious
2017-03-20 08:57:12 +01:00
Mark Olesen
957635200a ENH: build into build/ directory instead of platforms/ (issue #312)
- makes it slightly easier when packaging various binaries, or when
  building packages for installation via modules etc.
2017-02-10 20:30:15 +01:00
Mark Olesen
3d02c8a530 ENH: improve isolation of shell variables in wmake scripts
- reduces unexpected interactions between various make elements
2017-02-10 16:13:54 +01:00
Mark Olesen
46ecad8f7a STYLE: make wmake scripts look more POSIX-like
- also add some comments about the side-effects
2017-02-10 11:38:12 +01:00
Mark Olesen
9d63cc5ca8 ENH: add versioning for VTK library to runTimePostProcessing (issue #370)
Eg,
    librunTimePostProcessing.so
    librunTimePostProcessing.so.7 -> librunTimePostProcessing.so.7.1.0
    librunTimePostProcessing.so.7.1.0

- centralize handling of paraview/vtk versioning into wmake/cmakeFunctions
2017-01-23 13:37:42 +01:00
Henry Weller
13e8fce173 wmake: Use functions from wmakeFunctions to avoid code duplication
wclean: added support for automatic searching up the tree for the Make directory if in a sub-directory
2016-07-17 22:59:55 +01:00
Henry Weller
79e31173bd wmakeFunctions: Added '()' to depToSource definition
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2144
2016-07-09 20:45:46 +01:00
Henry Weller
7d553a1853 wmakeFunctions: Added a faster bash version of 'depToSource' 2016-07-09 14:19:47 +01:00
Henry Weller
b2223913d0 wmake/scripts/wmakeFunctions: Add support for $WM_PROJECT_DIR being a link 2016-06-15 14:22:33 +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
6b819790b4 wdep: If source file is not in the current directory search tree for first occurrence 2015-01-11 17:16:15 +00:00