Commit Graph

161 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
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
79e110aeb0 ENH: update lemon version, wmake wrappers 2021-11-09 21:17:51 +01:00
Mark Olesen
bf1ed94e53 ENH: use PrecisionAdaptor to support scotch with label widening
- allows reuse of an int64_t scotch library with label-size 32
  and/or label-size 64.

COMP: prefer scotch/metis/kahip libraries with label-size qualifiers

- as noted in #2200, mpirun may insert mpi libraries higher in the
  library loader which can cause masking of our ThirdParty libraries
  of the same name. With scotch (for example), the operating system
  may have an int32 version installed but we have an int64 version
  compiled under ThirdParty. Runing in serial is fine, but in parallel
  we resolve to the (incorrect) system version due to the adjustments
  in mpirun.

- adjust the ThirdParty make scripts to also create corresponding
  links (eg, 'ln -s libscotch.so libscotch-int64.so') and prefer
  linkage with these qualified libraries.

    Eg,  -L$(SCOTCH_LIB_DIR) -lscotch$(SCOTCH_LIBNAME_SUFFIX)

  this prevent accidental runtime linkage with the system versions.

STYLE: simplify scotch interface code by using local functions
2021-09-07 11:29:11 +02: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
6940b08822 COMP: adjustments for OSX (#2013)
- int64 ambiguity
- std::array include

- bsd-sed syntax (replaces gnu-sed syntax):
  * wmake-build-info
  * wmake-with-bear
2021-03-05 11:17:11 +01:00
Mark Olesen
f997013eb8 COMP: include mpi information for versioned cmake build
- since the wrapped cmake calls generally use the regular build
  locations, add in MPI information to properly handle changes
  in that as well. This makes it easier to build for multiple MPI
  instances.
2021-02-16 14:30:36 +01:00
Mark Olesen
e58b59ed6f CONFIG: pass through -prefix=false (ie, disable) 2020-12-21 23:52:28 +01:00
Mark Olesen
b89f389606 CONFIG: support optional config.sh/readline file
- provides a hook for specifying alternative locations
2020-12-11 21:37:42 +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
52c6642a4c Merge remote-tracking branch 'origin/master' into develop 2020-11-25 21:30:49 +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
5e660c36e9 CONFIG: ptscotch header not found on RedHat/Fedora (fixes #1904)
- no limit to the number of ways of filing ptscotch libraries.
  RedHat/Fedora/CentOS should look for these directories:

      ptscotch include=/usr/include/openmpi-x86_64
      ptscotch library=/usr/lib64/openmpi/lib

  when MPI_ARCH_PATH=/usr/lib64/openmpi
  and mpicc --showme:compile yields -I/usr/include/openmpi-x86_64
2020-11-04 15:22:44 +01:00
Mark Olesen
1d544540d9 ENH: handle wmake -debug option via FOAM_EXTRA_CXX_FLAGS
- ensures that subsequent Allwmake scripts know about it.

ENH: add bin/tools/query-detect wrapper for wmake have_* scripts

CONFIG: use project/ThirdParty without additional sanity checks

- no need to test for Allwmake or platforms/ if ThirdParty is located
  within the project directory itself.

COMP: add simple mpi test to 00-dummy

- for testing library linkage, etc.
2020-11-04 15:17:28 +01:00
Mark Olesen
f83bc8c22b Merge remote-tracking branch 'origin/master' into develop 2020-10-12 12:52:17 +02:00
Mark Olesen
bea6563210 CONFIG: ptscotch header not found on ArchLinux (fixes #1877)
- on ArchLinux, everything is installed under /usr/include/scotch.

  The detection script uses SCOTCH_ARCH_PATH as an initial guess for
  ptscotch as well. However, on the second pass, it has an absolute
  value ("/usr") instead of a logical one ("scotch-system").
  This resulted in the logic for handling scotch+ptscotch subdirs
  being bypassed.
2020-10-12 10:34:49 +02:00
Mark Olesen
1c71c7cb23 Merge remote-tracking branch 'origin/master' into develop 2020-09-03 12:04:45 +02: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
6e2b7be983 ENH: direct access to wrapped ifstream/ofstream with compression (#1805)
- previously hidden as Detail::[IO]FstreamAllocator, now exposed
  directly as [io]fstreamPointer, which allows reuse for
  std::ifstream, std::ofstream wrapping, without the additional
  ISstream, OSstream layers.

  These stream pointers have some characteristics similar to a
  unique_ptr.

- restrict direct gzstream usage to two files (fstreamPointers.C,
  gzstream.C) which improves localization and makes it simpler to
  enable/disable with the `HAVE_LIBZ` define.

  The HAVE_LIBZ define is currently simply hard-coded in the
  Make/options.

  If compiled WITHOUT libz support:
    - reading gz files : FatalError
    - writing gz files : emit warning and downgrade to uncompressed
    - warn if compression is specified in the case controlDict
      and downgrade to uncompressed

ENH: minor updates to gzstream interface for C++11

- support construct/open with std::string for the file names.

CONFIG: provisioning for have_libz detection as wmake/script
2020-08-10 12:40:08 +02:00
Mark Olesen
2ba6243862 CONFIG: refine handling of git information for debian builds
- When OpenFOAM is under git control and a 'debian/' directory exists,
  this could mean two things:

  1) Additional debian control has been added to OpenFOAM
  2) OpenFOAM has been imported into a debian project

For the case that OpenFOAM has been imported into a debian project,
using the git information would be highly misleading. There will be no
OpenFOAM SHA1 correspondence.

However, if additional debian control has been added to OpenFOAM the
SHA1 will be valid.

The ad hoc solution is to use an additional "openfoam.debian"
directory to flag the addition of debian controls into openfoam.

When a "debian/" directory exists without a "openfoam.debian", assume
that the OpenFOAM has been imported into debian and do not use the SHA1.
2020-06-29 10:33:30 +02: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
420be3f9ab CONFIG: improve handling of in-source PETSC installations
- when installed in-source, use PETSC_ARCH to find additional include
  directory and the correct library directory

CONFIG: bump to new hypre version

- add -hint option for have_adios2, have_hypre, have_petsc
2020-06-19 12:44:14 +02:00
Mark Olesen
6194548871 ENH: split off modules/list-modules script
STYLE: string quoting when echoing paths in wmake have_* scripts

STYLE: more consistency in foamRunTutorials, foamCleanTutorials options
2020-06-19 12:43:33 +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
d7db8f8292 COMP: support cgal header-only configurations
- improve wmake CGAL rule(s) accordingly
2020-05-19 07:13:12 +01:00
Mark Olesen
f8ef85b72f ENH: split up internals of wmake/scripts/have_XXX functions
- adds some more flexibility
2020-05-19 07:13:12 +01:00
Mark Olesen
4d9c7ca828 COMP: additional wmake adjustments
- scripts/wmake.wmake-args partial logic for Allwmake scripts.

- handle '-quiet' as synonym for '-silent'

- Do not specify '-j' option for wrapped cmake creation to avoid
  the warning:
  make[1]: warning: -jN forced in submake: disabling jobserver mode.
2020-05-14 16:53:06 +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
f99561700b ENH: add 'subcommand' handling to wclean (#1693)
- wcleanBuild, wcleanPlatform now accessible as "wclean -build" and
  "wclean -platform", respectively
2020-05-12 10:05:47 +02:00
Mark Olesen
9e3d06853e ENH: add 'subcommand' handling to wmake (#1693)
- initial split of wmake-related commands into "plumbing" and
  "porcelain" akin to how git handles things.

- wmakeBuildInfo (very low-level), now relocated to the wmake/scripts
  and accessible for the user as "wmake -build-info".

  This satisfies a long-standing desire to access build information
  in a fashion similar to the api/patch information.

CONFIG: avoid git information when building with a debian/ directory

- when a 'debian/' directory exists, there is a high probability that
  the '.git/' directory is from debian and not from OpenFOAM (ie,
  useless here). This corresponds to an implicit '-no-git', which has
  no effect when building from pristine sources.

ENH: wmakeCheckPwd becomes scripts/wmake-check-dir

- accessible for the user as "wmake -check-dir" and with 1 or 2
  directory names. A wmakeCheckPwd symlink left for compatibility.
2020-05-12 10:05:24 +02:00
Mark Olesen
b4bf26ea4f Merge remote-tracking branch 'origin/master' into develop 2020-05-06 10:13:56 +02:00
Mark Olesen
aafe674f5f ENH: improve cmake/ParaView config handling
- improve handling of changes in ParaView/VTK or cmake parameters (#1693)

  * adjust internals to support recording of an unlimited number of
    configuration parameters and use file `cmp` instead of trying
    to check strings ourselves.

ENH: new wmake/scripts/wmake.cmake-args handler

- additional handling of -prefix=... as CMAKE_INSTALL_PREFIX export.

- in some contexts, can use instead of AllwmakeParseArguments
2020-05-05 18:06:09 +02:00
Mark Olesen
9cfa5fe454 Merge remote-tracking branch 'origin/master' into develop 2020-04-21 15:07:35 +02:00
Mark Olesen
aa2f932b75 CONFIG: additional packaging helpers, tutorial test helper
- bin/tools/create-mpi-config to query/write values for system openmpi.
  In some cases this can be used to avoid an mpicc requirement at runtime.

- adjust openfoam session to include -test-tutorial forwarding to the
  tutorials/AutoTest. This helps with writing installation tests.

- adjust foamConfigurePaths to latest version

- removal of gperftools default config, as per develop
2020-04-21 14:59:07 +02:00
Mark Olesen
9aae45fa51 Merge remote-tracking branch 'origin/master' into develop 2020-04-16 00:45:11 +02:00
Mark Olesen
06333efd2d CONFIG: improve detection of scotch system include/libraries
- align wmake have_* scripts to support version query as per current
  develop branch

- use config.sh/ fallbacks when the corresponding *_ARCH_PATH is empty
  (eg, BOOST, CGAL, FFTW).
  This aids when building outside of the regular OpenFOAM environment.
2020-04-15 13:35:45 +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
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
fe17c8ad5f CONFIG: improve prefix matching for system libraries (#1607)
- missed detection of system libraries when installed with multiarch
  paths like /usr/lib/x86_64-linux-gnu

CONFIG: improve handling of group/user config files (#928)

- changed bashrc handling of FOAM_CONFIG_NOUSER to use
  FOAM_CONFIG_MODE instead. Propagate into foamEtcFile to make this
  a stickier control.

  This change allows better control, but also enables cluster
  installations to define their own value within the OpenFOAM prefs.sh
  file to prevent users accidentally mis-configuring things if
  necessary.

- remove undocumented handling of an (a)ll mode in foamEtcFile to
  avoid potential pitfalls.

- add support for FOAM_CONFIG_ETC handling.
  This allows injection of an extra search layer when finding
  project etc files

ENH: improvements to foamConfigurePaths (#928)

- handle FOAM_CONFIG_ETC implicitly, or explicitly with the new
  -etc option.

STYLE: more explicit wording in foamConfigurePaths usage (#1602)

- document that an absolute path (eg, -scotch-path) overrides/ignores
  the equivalent ThirdParty setting (eg, -scotch)

- longer options -system-compiler and -third-compiler for -system
  and -third, respectively. Clearer as to their purpose.

- adjust the location sanity check to look for META-INFO directory.
2020-03-16 12:03:58 +01:00
Mark Olesen
5ba2cbc54f CONFIG: improve prefix matching for system libraries (#1607)
- missed detection of system libraries when installed with multiarch
  paths like /usr/lib/x86_64-linux-gnu

CONFIG: improve handling of group/user config files (#928)

- changed bashrc handling of FOAM_CONFIG_NOUSER to use
  FOAM_CONFIG_MODE instead. Propagate into foamEtcFile to make this
  a stickier control.

  This change allows better control, but also enables cluster
  installations to define their own value within the OpenFOAM prefs.sh
  file to prevent users accidentally mis-configuring things if
  necessary.

- remove undocumented handling of an (a)ll mode in foamEtcFile to
  avoid potential pitfalls.

- add support for FOAM_CONFIG_ETC handling.
  This allows injection of an extra search layer when finding
  project etc files

ENH: improvements to foamConfigurePaths (#928)

- handle FOAM_CONFIG_ETC implicitly, or explicitly with the new
  -etc option.

STYLE: more explicit wording in foamConfigurePaths usage (#1602)

- document that an absolute path (eg, -scotch-path) overrides/ignores
  the equivalent ThirdParty setting (eg, -scotch)

- longer options -system-compiler and -third-compiler for -system
  and -third, respectively. Clearer as to their purpose.

- adjust the location sanity check to look for META-INFO directory.
2020-02-24 16:00:16 +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
beebe4e214 STYLE: fix shell syntax 2020-02-10 17:02:30 +01:00
Mark Olesen
553c01d52e CONFIG: bin/tools/query-versions
- Query the etc/config.sh values for ThirdParty software.
  Usable without an active OpenFOAM environment.
2020-02-07 17:11:49 +01:00