Commit Graph

726 Commits

Author SHA1 Message Date
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
01f8ea9dd5 CONFIG: update Fujitsu rules (#1671)
- openmp using the libfjomp

- fastmath as per the ArmClang compiler
2020-06-24 18:04:01 +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
9e311151e3 CONFIG: bump API to 2006 (pre-release) 2020-06-17 16:39:40 +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
b3e5620d2a COMP: typo in surfaceBooleanFeatures/PolyhedronReader Make/options
ENH: strip {GMP,MPRF}_ARCH_PATH in make rules
2020-06-05 12:36:37 +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
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
e5afe55e9b CONFIG: bump API to 2004 2020-05-06 17:25:00 +02:00
Mark Olesen
b3464d8afc COMP: wmake rules for AMD (clang-based) compiler (#1627)
- not fully tested
2020-05-06 13:11:09 +02:00
Mark Olesen
78dc8c6ba6 CONFIG: refactor common link rules, support FOAM_EXTRA_CFLAGS (#1256)
- additional cgal-headers-only rules (future use)

COMP: add -lgmp for CGAL with mpfr linkage
2020-05-06 13:10:30 +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
b4bf26ea4f Merge remote-tracking branch 'origin/master' into develop 2020-05-06 10:13:56 +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
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
9b4462e07b CONFIG: bump API to 2003
- various changes
2020-04-21 15:09:12 +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
6691e6563c COMP: adjust for CGAL-1.14 changes 2020-04-21 14:59:07 +02:00
Mark Olesen
e1586bdaa0 CONFIG: add linuxARM64Fujitsu settings (#1671) 2020-04-16 00:48:08 +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
4200774d35 CONFIG: improve support for compiler derivatives (#1671)
- add '[-+.~]' to the recognized qualifiers.
  This allows simple readable names such as

      WM_COMPILER=Clang-vendor

  but also opens the FUTURE (not yet supported) possibility of
  combining in additional information. For example,

      WM_COMPILER=Clang~openmp
      WM_COMPILER=Clang+cuda~openmp

  by using '+' (add) and '~' (subtract) notation similar to what
  spack uses.

CONFIG: support 'override' rules

- if present, compiler-family 'override' rules are included after
  compiler-family 'general' rules have been included. This allows a
  central means for including dynamically generated content to
  override some values.

  Some examples:

  To handle different gcc versions (system compiler):

  wmake/rules/...Gcc/override

  ```
  ifneq (,$(findstring 9, $(WM_COMPILER)))
      cc  := gcc-9
      CC  := g++-9 -std=c++11
  endif
  ```

  To handle different openmp on Darwin (#1656):

  wmake/rules/darwin64Clang/override

  ```
  # Use libomp (not libgomp) unless openmp is disabled
  ifeq (,$(findstring "~openmp", "$(WM_COMPILER)"))
      COMP_OPENMP = -DUSE_OMP -Xpreprocessor -fopenmp
      LINK_OPENMP = -lomp
  else
      include $(GENERAL_RULES)/no-openmp
  endif
  ```

  This treatment arguably fits into wmake/rules/darwin64Clang/general,
  but it serves to illustrate a possible use case.
2020-04-15 13:18:31 +02:00
Mark Olesen
04b5291c55 CONFIG: handle openmp on Darwin (#1656)
- requires -Xpreprocessor
- uses 'libomp' (no 'libgomp' link)
2020-04-15 13:18:19 +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
8075804b18 COMP: add -pthread compile/link dependency for std::thread (#614) 2020-04-06 08:30:11 +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
ac8b64df46 CONFIG: support FOAM_EXTRA_CXXFLAGS (#1256)
- allows custom tuning of compilation parameters
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
2892b78d72 CONFIG: support FOAM_EXTRA_CXXFLAGS (#1256)
- allows custom tuning of compilation parameters
2020-02-20 12:18:12 +01:00
Mark Olesen
2d416a68a0 CONFIG: bump API to 2002
- changes in IOstreamOption, Switch, writeObject
2020-02-19 23:36:47 +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
Mark Olesen
739bc3c4af COMP: add -pthread compile/link dependency for std::thread (#614) 2020-02-07 11:06:06 +01:00
Mark Olesen
449ba56750 CONFIG: bump API to 2001 2020-01-23 14:22:27 +01:00
Mark Olesen
9b67ffaf74 COMP: update lemon to 2019-12-19 version 2020-01-13 13:56:23 +01:00
Mark Olesen
8fdb9b2f70 COMP: robuster storage of pv/vtk sentinel files with out-of-source builds 2020-01-13 13:56:23 +01:00
Andrew Heather
ae2ab06312 REL: Release preparations 2019-12-23 09:49:23 +00:00
Mark Olesen
193b7dba22 CONFIG: relocate WM_PROJECT definition in bashrc, cshrc
- locate where the user is less tempted to change it (#1515).
  It really should be considered an invariant environment variable.

STYLE: wmake -help information to stdout, die errors to stderr
2019-12-16 14:34:36 +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
3176b3a5de ENH: add wmake -show-path-{c,cxx} | -help-full
- The wmake -show-path-{c,cxx} options return the fully qualified
  paths to the respective compilers. This can be useful when verifying
  that the correct compiler is indeed configured.

- The -help-full to display the "advanced" options, but in the normal
  case just show the basic options.
2019-12-15 17:19:05 +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
69a8369541 COMP: add note about gcc-9 and deprecated-copy 2019-12-13 20:54:28 +01:00
Mark Olesen
7aa2bf832f STYLE: header format 2019-12-13 12:33:23 +01:00
Mark Olesen
89fb73d2a3 COMP: disable some compiler warnings
- The -Wno-deprecated-copy flag for gcc-9.2.0

  In the future we may indeed wish to explicitly request default
  generated constructors and assignment operators, but at the moment
  these are still acceptable.

- The -Wno-alloc-size-larger-than flag for mingw compilations

  Related to differences in PTRDIFF_MAX vs SIZE_MAX on the target.
  Several issues related to this can be found in the gcc bug reports
  and on stackoverflow etc.
2019-12-11 20:42:11 +01:00
Mark Olesen
bc51349d75 CONFIG: bump API to 1912 (pre-release)
- update repository links
2019-12-11 09:19:32 +01:00
Mark Olesen
3a816006dc COMP: support m4 include directories for wrap-lemon
Set the m4 -I include accordingly to have the folllowing:
  - the directory of the parser.
  - include/ in the top-level source tree of the current target
    (eg, src/finiteVolume/include-m4/ when compiling libfiniteVolume)
  - include/ from OpenFOAM

Additional -dry-run option for makeParser, wrap-lemon for expanding m4
only.

Extend m4 wrapping support to include bison as well.
2019-12-06 16:15:07 +01:00
Mark Olesen
9e6683f7bc ENH: add conditionals to #eval (string to scalar)
Example,

     ($radius > 10) ? sin(degToRad(45)) : cos(degToRad(30))

- protect division and modulo against zero-divide.

- add scanner/parser debugging switches in the namespace,
  selectable as "stringToScalar". For example,

    debug parser:  foamDictionary -debug-switch stringToScalar=2
    debug scanner: foamDictionary -debug-switch stringToScalar=4
    debug both:    foamDictionary -debug-switch stringToScalar=6
2019-11-19 14:22:03 +01:00
Mark Olesen
98467036b3 STYLE: regularize quoting and exit on failed 'cd' 2019-11-13 13:19:16 +01:00
Mark Olesen
8495e8e92c COMP: provide separate get_pvplugin_api function 2019-11-11 11:16:54 +01:00
Mark Olesen
3a964c04f3 COMP: report locations of build tools (such as flex, m4 etc)
- can assist diagnosing when things have gone wrong
2019-11-10 11:24:07 +01:00
Mark Olesen
17d159d76d COMP: add version information to wmake
- wmake -version, --version option (alias for -show-api)
  for consistency with standard system tools
2019-11-10 11:24:07 +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
Mark Olesen
ec7e3c88e4 ENH: test for WM_PROJECT_DIR being set/unset in scripts 2019-11-06 09:18:51 +01:00
Mark Olesen
a6c442bf3f COMP: support install for paraview-versioned cmake 2019-11-05 09:06:33 +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
c9c3912e8d CONFIG: support pkg-config for PETSc detection 2019-10-23 15:10:12 +02:00
Mark Olesen
1ddcdb083e ENH: add support for m4 filtering of lemon grammars 2019-10-11 09:24:04 +02:00
Mark Olesen
f2c4d7b81b CONFIG: report parser stats with wmake/scripts/makeParser 2019-10-08 18:58:32 +02:00
Mark Olesen
2c11d875ad CONFIG: bump API to 1909 to reflect #eval directive 2019-10-01 14:27:16 +02:00
Mark Olesen
f1ed0a617b COMP: add lemon parser and skeleton code 2019-09-27 11:09:40 +02:00
Mark Olesen
4a6cd8f194 COMP: update make rules for lemon, add helper infrastructure for ragel 2019-09-27 11:05:35 +02:00
Mark Olesen
f7528a2ac5 COMP: fix inconsistent bison make rule
- generated C++ files, but didn't use C++ compiler
2019-09-26 10:41:16 +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
508277d0f8 COMFIG: update flex make rules to use '-f' for C-code as well
- add additional rule (ending '.ll') for the combination of
  flex for C-code but compiling the result as C++.
  This can be needed for re-entrant parsers.

- update bison rule to handle renaming of skeleton files.
  Use a wrap-bison script to manage this.
2019-08-23 17:34:25 +02:00
Mark Olesen
54eab4f2e8 CONFIG: link known C/C++ file extensions in wmakeLnInclude 2019-08-27 12:40:01 +02:00
Mark Olesen
70b0013cac STYLE: adjust wording in some documentation (#1406) 2019-08-21 15:44:26 +02:00
Mark Olesen
60517236fd CONFIG: bump API to 1908 to reflect is_contiguous handling 2019-08-13 16:26:30 +02:00
Mark Olesen
212174064c CONFIG: robuster paraview detection 2019-08-09 14:22:30 +02:00
Mark Olesen
d4a0dc631c CONFIG: relax requirement on C compile option
- with 1906, OpenFOAM is purely C++ code and the last toolchain bits C
  code have been avoided. Thus relax the wmake C rule for including
  WM_COMPILE_OPTION. This makes it much easier to add different
  compiler options with fewer files.

  For example, for Broadwell-specific options:

      cd wmake/rules/linux64Gcc
      cp c++Opt c++OptBdw

      edit this file and then use WM_COMPILE_OPTION=OptBdw

- ensure that WM_COMPILE_OPTION is always non-empty
2019-08-07 09:22:09 +02:00
Mark Olesen
e400725675 CONFIG: add sourcing hints for adios2, petsc 2019-08-02 12:17:39 +02:00
Mark Olesen
1b4b127af5 CONFIG: harmonize adios1, adios2 config files. Add to setup. 2019-07-31 13:21:52 +02:00
Mark Olesen
59b867b7af ENH: improvements for handling update of build information
- When building OpenFOAM for different platform combinations
  (single/double, int32/int64) the build information that is compiled
  into the OpenFOAM lib can become out of sync.

  This is because the update trigger (wmakeBuildInfo -check) is
  independent of the targetted platform. The added file
  'src/OpenFOAM/Alltouch' provides a direct means of forcing a rebuild
  of the version information. Eg,

      src/OpenFOAM/Alltouch
      wmake src/OpenFOAM

  Also provide an additional 'wmakeBuildInfo -remove' to forcibly
  remove META-INFO/build-info, if that is desired.
2019-07-30 09:54:02 +02:00
Mark Olesen
53392d5a05 ENH: improve wmake handling of directory when given a source file 2019-07-28 21:09:11 +02:00
Mark Olesen
481661dabe CONFIG: bump API to 1907 to register any changes in keywords 2019-07-14 19:25:30 +02:00
Mark Olesen
16784c6b06 CONFIG: reduce reliance on WM_ARCH_OPTION (#517)
- now only needed when specify compiling -m32 on a 64-bit system.

  Internally use the __SIZEOF_LONG__ compiler macro (gcc, icc, llvm)
  to define when long is actually an int32_t.
2019-06-14 14:47:35 +02:00
mattijs
01ea3cc790 ENH: metis: use PrecisionAdaptor to support 64 bit indices 2019-06-13 20:52:48 +01:00
Mark Olesen
f05ff81722 CONFIG: bump API to 1906 (pre-release)
- adjust copyright dates for manpages
2019-06-13 18:22:10 +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
ef88919ef5 STYLE: incorrectly documented wmake option 2019-06-04 09:11:37 +02:00
Mark Olesen
fc11c40841 ENH: add wmake -debug option
- forces c++DBUG='-DFULLDEBUG -g -O0' for the compilation, to allow
  localized debugging during development without file editing and
  while retaining the WM_COMPILE_OPTION (eg, Opt)

  Note that switching between 'wmake' and 'wmake -debug' will not
  cause existing targets to be rebuilt. As before, these are driven by
  the dependencies. An intermediate wclean may thus be required.
2019-06-03 10:16:31 +02:00
Mark Olesen
66a100997f COMP: force dlOpen for windows application binaries (#1238)
- when windows portable executables (.exe or .dll) files are loaded,
  their dependent libraries not fully loaded. For OpenFOAM this means
  that the static constructors which are responsible for populating
  run-time selection tables are not triggered, and most of the run-time
  selectable models will simply not be available.

Possible Solution
=================

  Avoid this problem by defining an additional library symbol such as
  the following:

      extern "C" void libName_Load() {}

  in the respective library, and tag this symbol as 'unresolved' for
  the linker so that it will attempt to resolve it at run-time by
  loading the known libraries until it finds it. The link line would
  resemble the following:

      -L/some/path -llibName -ulibName_Load

  Pros:
    - Allows precise control of forced library loading

  Cons:
    - Moderately verbose adjustment of some source files (even with macro
      wrapping for the declaration).
    - Adjustment of numerous Make/options files and somewhat ad hoc
      in nature.
    - Requires additional care when implementing future libraries and/or
      applications.

  - This is the solution taken by the symscape patches (Richard Smith)

Possible Solution
=================

  Avoid this problem by simply force loading all linked libraries.
  This is done by "scraping" the information out of the respective
  Make/options file (after pre-processing) and using that to define
  the library list that will be passed to Foam::dlOpen() at run-time.

  Pros:
    - One-time (very) minimal adjustment of the sources and wmake toolchain
    - Automatically applies to future applications

  Cons:
    - Possibly larger memory footprint of application (since all dependent
      libraries are loaded).
    - Possible impact on startup time (while loading libraries)
    - More sensitive to build failures. Since the options files are
      read and modified based on the existence of the dependent
      libraries as a preprocessor step, if the libraries are initially
      unavailable for the first attempt at building the application,
      the dependencies will be inaccurate for later (successful) builds.

  - This is solution taken by the bluecape patches (Bruno Santos)

Adopted Solution
================

  The approach taken by Bruno was adopted in a modified form since
  this appears to be the most easily maintained.

Additional Notes
================

  It is always possible to solve this problem by defining a corresponding
  'libs (...)' entry in the case system/controlDict, which forces a dlOpen
  of the listed libraries. This is obviously less than ideal for large-scale
  changes, but can work to resolve an individual problem.

  The peldd utility (https://github.com/gsauthof/pe-util), which is
  also packaged as part of MXE could provide yet another alternative.
  Like ldd it can be used to determine the library dependencies of
  binaries or libraries. This information could be used to define an
  additional load layer for Windows.
2019-05-25 19:10:14 +02:00
Mark Olesen
a54aff9d26 COMP: add wmake rules for mingw (#1238) 2019-04-28 13:36:50 +02:00
Mark Olesen
ed6b26ba45 BUG: had clang++ instead of armclang++ 2019-04-29 21:10:14 +02:00
Mark Olesen
897528da1a ENH: streamline handling of static/dynamic libs in detection scripts 2019-04-29 10:04:44 +02:00
Mark Olesen
beefee48d4 COMP: adjust compilation order with updated interdependencies
- Eg, with surface writers now in surfMesh, there are fewer libraries
  depending on conversion and sampling.

COMP: regularize linkage ordering and avoid some implicit linkage (#1238)
2019-04-28 14:44:33 +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
8928ac54bd COMP: use standard compiler macros when distinguishing the OS
- replace (darwin) with (__APPLE__)
- replace (solarisGcc) with (__sun__ && __GNUC__)
- instead of 'darwin' -> '__APPLE'

- cease with passing a -D$(WM_ARCH) define since this adds no useful
  additional information and isn't used anywhere.

Reference
http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system

--

COMP: Extend size disambiguation on long (#1238)
2019-04-12 18:42:30 +02:00
Mark Olesen
ee4300b0a1 CONFIG: wmake -show-xyz in more places (issue #1256) 2019-04-12 11:02:30 +02:00
Mark Olesen
787325a916 COMP: manage cpu architecture with cARCH, c++ARCH internal make variables
- allows better separation from compiler settings

- use -fPIC instead of legacy -KPIC for intel compiler
2019-04-12 12:59:11 +02:00
Mark Olesen
09cf9d9963 CONFIG: adjust settings for solaris and darwin
solaris:
  - rename WM_ARCH from SunOS to solaris64 for consistency with wmake/rules
  - drop non-64 solaris from wmake/rules
  - remove automatic selection of FJMPI. This should be done in the bashrc
    or prefs.sh file instead.
  - remove old (likely inaccurate) exported flags, rely on wmake -show-xyz
    or user config instead

darwin:
  - remove '-Ddarwin' from the exported WM_CFLAGS, WM_CXXFLAGS.
    Not used elsewhere (ThirdParty)
2019-04-12 11:06:45 +02:00
Mark Olesen
51aae5f34d CONFIG: bump API to 1904 for changes in interaction with external MPI 2019-04-10 18:00:04 +02:00
Mark Olesen
eb6ccdf7b1 CONFIG: adjust adios config paths 2019-04-10 16:08:21 +02:00
Mark Olesen
f0f4af16d2 Merge remote-tracking branch 'origin/master' into develop 2019-04-08 12:05:24 +02:00
Mark Olesen
63a1826211 ENH: provide 'sanitized' values for wmake -show compiler information (#1256)
- with the wmake rules we may have some compiler options bound to the
  internal compiler variable. For example,

     CC  = g++ -std=c++11 -m64

     c++FLAGS = ...

  So shift any flags from CC to CXXFLAGS for the output of
  'wmake -show-cxx', 'wmake -show-cxxflags', etc.

  This makes it much easier to handle the values correctly elsewhere.
  Eg,

      CXX="$(wmake -show-cxx)" CXXFLAGS="$(wmake -show-cxxflags)" \
         ./configure
2019-04-05 15:30:30 +02:00
Mark Olesen
cd91a252ac ENH: improve handling of pt-scotch headers/libraries
- provide dedicated detection 'have_ptscotch' function that can be
  used after the 'have_scotch' function.

  It sets the PTSCOTCH_ARCH_PATH, PTSCOTCH_INC_DIR, PTSCOTCH_LIB_DIR
  and helps when the serial and parallel versions are located with
  different logic.
2019-04-05 13:10:53 +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
Mark Olesen
a2fb1d0bdd COMP: add wmake rules for Pgi compiler (#1234) 2019-03-11 15:56:40 +01:00
Mark Olesen
e46b241378 CONFIG: bump API version number to 1902 to register changes in surface writers 2019-03-11 15:28:55 +01:00
Mark Olesen
ce947eeb09 STYLE: relocate -mcpu into compiler instead of compiler-flags (#1225) 2019-03-01 18:34:05 +01:00
Mark Olesen
ec93384c1d COMP: adjust ARM compilation flags (#1225)
- with -mcpu=native for automatic detection and -armpl for linking in
  the performance libraries

STYLE: relocate -mcpu into compiler instead of compiler-flags (#1225)
2019-03-01 18:20:41 +01:00
Mark Olesen
f01849ffd4 COMP: adjust ARM compilation flags (#1225)
- with -mcpu=native for automatic detection and -armpl for linking in
  the performance libraries
2019-03-01 18:20:41 +01:00
Mark Olesen
473e000bed ENH: enable MPI library variants (#1153)
- in addition to managing different vendors and versions, it may also
  be necessary or desirable to have a particular variant
  (eg, profiling, release, etc).

  Devise a new meaningful name for the variant and create a
  corresponding wmake rule.

  Eg, SYSTEMOPENMPI-profiling with a corresponding
      "wmake/rules/linux64Gcc/mplibSYSTEMOPENMPI-profiling" file
  that has suitable content for your system.

CONFIG: intel-mpi use intel64/ paths only for config and wmake rules (#1153)

- previously adjusted the config files, but missed the changes
  required for the wmake rules too.

  Now simply migrate to using  "intel64/{include,bin,lib}"
  instead of the older naming  "{include,bin,lib}64"

  These changes work since at least intel-mpi 2015 (5.x), but possibly
  earlier as well
2019-01-28 19:19:09 +01:00
Mark Olesen
63d8e7e576 ENH: make use of FOAM_API for environment as well (issue #1158)
- was WM_PROJECT_API in the environment and FOAM_API in dictionaries.

  Make these both consistently FOAM_API.
  This is a non-breaking change, since the value of WM_PROJECT_API
  (added in 1812) and/or FOAM_API is purely informative.
  For the current correct values, always use

    * foamEtcFile -show-api
    * wmakeBuildInfo -show-api
2019-01-10 12:21:19 +01:00
Mark Olesen
fd8379fdbe CONFIG: update MPICH and MVAPICH versions/rules
- Note: mpich now builds libmpi.so instead of libmpich.so

- define both -DMPICH_SKIP_MPICXX and -DOMPI_SKIP_MPICXX regardless of
  using openmpi or mpich. This simplifies the files and does not harm.
2019-02-14 18:09:37 +01:00
Mark Olesen
97994734d2 CONFIG: bump API version number to 1901 to register recent changes
- objectRegistry search, erase methods
  - clip, minMax
  - function object triggering
  ...
2019-02-06 12:01:29 +01:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Andrew Heather
cab94a5d0a Merge remote-tracking branch 'origin/master' into develop 2019-02-04 10:55:34 +00:00
Mark Olesen
b0fafd18fe STYLE: reorganize some legacy and less frequently used components
- older emacs tools into legacy
- old process tools

* Less frequently used scripts into bin/tools/

  - findEmptyMake
  - foamAllHC
  - foamUpdateCaseFileHeader

* Infrastructure file (only used by foamNewApp)

  - wmake/wmakeFilesAndOptions -> wmake/scripts/wmakeFilesAndOptions

* Merge wmakeRoot convenience as 'wmake -pwd'
* Remove obsolete wmakePrintBuild (superseded by wmakeBuildInfo)
* Remove unused mergeHistory file
2019-01-26 11:30:50 +01:00
Mark Olesen
ef6c2ef590 CONFIG: combine wmake rules for KNL architecture as a compile option
- instead of

      WM_COMPILER=GccKNL WM_COMPILE_OPTION=Opt

      -> linux64GccKNLDPInt32Opt

  now specify

      WM_COMPILER=Gcc  WM_COMPILE_OPTION=OptKNL

      -> linux64GccDPInt32OptKNL

This makes it easier (and more obvious) for adding different tweaks
without needing to generate too many files.
Eg,

    cd wmake/rules/linux64Gcc

    cp cOpt   cOptBdw
    cp c++Opt c++OptBdw

    edit these two files and then use WM_COMPILE_OPTION=OptBdw

CONFIG: provide some default c/c++ flags in General compiler rules

- can make is easier when deriving new compile options, and ensures
  that '-02' is enabled as an initial default.
2019-01-25 17:39:05 +01:00
Mark Olesen
3d98c3d593 ENH: add -root option for wmakeLnInclude (convenience)
- finds the correct root directory location before creating
  the lnInclude directory

  Eg,

  from within something like src/finiteVolume/fields/fvPatchFields/..

      wmakeLnInclude -update -root

  it backtracks to find the top-level directory with Make/
  and makes the lnInclude directory there:

    Using /home/mark/openfoam/OpenFOAM-plus/src/finiteVolume
        ln: /home/mark/openfoam/OpenFOAM-plus/src/finiteVolume/lnInclude
2019-01-25 16:20:58 +01:00
Mark Olesen
65e94fde66 DEFEATURE: remove wmakeScheduler (issue #1178)
- was for parallel compilation across multiple hosts, but less useful
  with modern CPUs with higher number of cores and/or hyperthreading.

  Fragile use and dependent on a 'lockfile' utility that is not often
  installed.
2019-01-23 12:43:41 +01:00
Mark Olesen
03bd58ee3a CONFIG: update openmpi-1.10 minor 2019-01-21 13:40:06 +01:00
Mark Olesen
1dd7362aed ENH: wmakeRoot for locating the root directory 2019-01-18 10:58:07 +01:00
Mark Olesen
fcf4c5fb22 ENH: wmake have_* script changes
- use local 'prefix' variable for easier override and more consistency
2019-01-10 20:14:46 +01:00
Mark Olesen
bef508dedc ENH: make use of FOAM_API for environment as well (issue #1158)
- was WM_PROJECT_API in the environment and FOAM_API in dictionaries.

  Make these both consistently FOAM_API.
  This is a non-breaking change, since the value of WM_PROJECT_API
  (added in 1812) and/or FOAM_API is purely informative.
  For the current correct values, always use

    * foamEtcFile -show-api
    * wmakeBuildInfo -show-api
2019-01-10 12:21:19 +01:00
Mark Olesen
c7350f3dd7 Merge remote-tracking branch 'origin/master' into develop 2019-01-07 19:13:11 +01:00
Mark Olesen
d76dd0e1fe CONFIG: remove bash dependency from wmakeBuildInfo (fixes #1152)
- looks slightly messier without associative arrays, but improves
  portability. Should now also work with dash.

STYLE: support wmakeBuildInfo -cmp and -check options as equivalent
2019-01-06 10:50:37 +01:00
Mark Olesen
7bf25dbda1 ENH: add 'Scan' WM_COMPILE_OPTION (clang only)
- backend settings for scan-build
2019-01-02 11:49:49 +01:00
Mark Olesen
4ecdb2512d CONFIG: add llvm-7.0.1
STYLE: generalize rule for obtaining compiler stem
2019-01-02 11:08:21 +01:00
Mark Olesen
dd2c7c4894 ENH: add wmakeVersioned with tracking of ThirdParty dependencies
- primarily for handling cmake replacement libraries
2018-12-15 15:49:48 +01:00
mattijs
e17f6073b9 CONFIG: bump API version number to 1812 to register recent changes 2018-12-13 15:23:04 +00:00
Mark Olesen
a38b459ab0 CONFIG: use project api instead of version when finding config files 2018-12-10 14:04:01 +01:00
Mark Olesen
69006ef0a7 ENH: adjust wmakeBuildInfo to work with older git versions as well 2018-12-10 09:49:45 +01:00
Mark Olesen
0e4ccd7cef ENH: improve build naming without git
- now defaults to the project-version when absolutely nothing else is
  known

STYLE: simplify internal calling in wmakeBuildInfo
2018-12-08 18:18:17 +01:00
Mark Olesen
6c68c34e1a ENH: update handling of versioning and make control (issue #1010)
- Use the OPENFOAM define (eg, 1806, 1812), which normally corresponds
  to a major release, to define an API level. This remains consistent
  within a release cycle and means that it is possible to manage
  several sub-versions and continue to have a consistent lookup.

  The current API value is updated automatically during the build
  and cached as meta data for later use, even when the wmake/ directory
  is missing or OpenFOAM has not yet be initialized.

  The version information reported on program start or with -help
  usage adjusted to reflect this. The build tag from git now also
  carries the date as being more meaningful to trace than a hash
  value.

- Update etc/bashrc and etc/cshrc to obtain the project directory
  directly instead of via its prefix directory. The value obtained
  corresponds to an absolute path, from which the prefix directory
  can be obtained.

  The combination of these changes removes the reliance on any
  particular directory naming convention.
  For example,

     With an 1812 version (API level):

     WM_PROJECT_VERSION=myVersion

     installed as /some/path/somewhere/openfoam-mySandbox

  This makes the -prefix, -foamInstall, -projectVersion, -version
  values of foamEtcFiles, and similar entries for foamConfigurePaths
  superfluous.

  WM_PROJECT_INST_DIR is no longer required or used

ENH: improve handling and discovery of ThirdParty

- improve the flexibility and reusability of ThirdParty packs to cover
  various standard use cases:

    1. Unpacking initial release tar files with two parallel directories
       - OpenFOAM-v1812/
       - ThirdParty-v1812/

    2. With an adjusted OpenFOAM directory name, for whatever reason
       - OpenFOAM-v1812-myCustom/
       - openfoam-1812-other-info/

    3. Operating with/without ThirdParty directory

  To handle these use cases, the following discovery is used.

  Note PROJECT = the OpenFOAM directory `$WM_PROJECT_DIR`
       PREFIX = the parent directory
       VERSION = `$WM_PROJECT_VERSION`
       API = `$WM_PROJECT_API`, as per `foamEtcFiles -show-api`

   0. PROJECT/ThirdParty
      - for single-directory installations

   1. PREFIX/ThirdParty-VERSION
      - this corresponds to the traditional approach

   2. PREFIX/ThirdParty-vAPI
      - allows for an updated value of VERSION (eg, v1812-myCustom)
        without requiring a renamed ThirdParty. The API value
        would still be '1812' and the original ThirdParty-v1812/
        would be found.

   3. PREFIX/ThirdParty-API
      - this is the same as the previous example, but using an unadorned
        API value. This also makes sense if the chosen version name also
        uses the unadorned API value in its naming
        (eg, 1812-patch190131, 1812.19W03)

   4. PREFIX/ThirdParty-common
      - permits maximum reuse for various versions, but only for
        experienced user who are aware of potential version
        incompatibilities

   Directory existence is checked as is the presence of an Allwmake file
   or a platforms/ directory. This reduces the potential of false positive
   matches and limits the selection to directories that are either
   with sources (has the Allwmake file), or pre-compiled binaries (has
   the platforms/ directory).

   If none of the explored directories are found to be suitable,
   it reverts to using a PROJECT/ThirdParty dummy location since
   this is within the project source tree and can be trusted to
   have no negative side-effects.

ENH: add csh support to foamConfigurePaths

- this removes the previously experienced inconsistence in config file
  contents.

REMOVED: foamExec

- was previously used when switching versions and before the
  bashrc/cshrc discovery logic was added. It is now obsolete.
2018-12-02 18:25:57 +01: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
d587e2f03f ENH: append date to build info
- append the commit hash value with the commit date when creating
  the build string information and drop the version prefix.

  This provides an immediate overview of when the code was last
  changed. The prefixed version information can be dropped from
  the build string, since it is readily available in other forms.
2018-11-29 23:03:57 +01:00
Mark Olesen
628b2445fc ENH: improve setup for paraview
- removed reliance on ParaView_INCLUDE_DIR variable for conveying the
  major.minor version information when compiling. This can be somewhat
  fragile and also adds variable that is an unnecessary when running
  (only used when compiling).

  Instead use `have_pvplugin_support` function in paraviewFunctions
  wmake script to determine the maj.min from the PV_PLUGIN_PATH
  since we have already defined the output path there with paraview
  maj.min numbering.

  Can now build with paraview from the operating system,
  provided that it has develop headers available.

      ParaView_VERSION=system

  In the etc/config.sh/paraview setup, the maj.min is taken from
  the corresponding `paraview --version` output and used when
  defining the PV_PLUGIN_PATH.

  During the build, the include path taken from `paraview-config`
  for a system installation, from the guess installation root
  of the paraview binary, or ParaView_DIR otherwise.

NB: using a system ParaView for building runTimePostProcessing is unsupported.

- these types of builds appear to have various library resolution issues
  (eg, libexpat not being loaded). Additionally, the build logic does
  not yet cover this type of use case.
2018-11-29 01:48:00 +01:00