Commit Graph

114 Commits

Author SHA1 Message Date
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
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
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
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
Andrew Heather
ae2ab06312 REL: Release preparations 2019-12-23 09:49:23 +00:00
Mark Olesen
7aa2bf832f STYLE: header format 2019-12-13 12:33:23 +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
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
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
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
4a6cd8f194 COMP: update make rules for lemon, add helper infrastructure for ragel 2019-09-27 11:05:35 +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
212174064c CONFIG: robuster paraview detection 2019-08-09 14:22:30 +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
mattijs
01ea3cc790 ENH: metis: use PrecisionAdaptor to support 64 bit indices 2019-06-13 20:52:48 +01: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
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
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
ee4300b0a1 CONFIG: wmake -show-xyz in more places (issue #1256) 2019-04-12 11:02:30 +02:00
Mark Olesen
eb6ccdf7b1 CONFIG: adjust adios config paths 2019-04-10 16:08:21 +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
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +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
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
dd2c7c4894 ENH: add wmakeVersioned with tracking of ThirdParty dependencies
- primarily for handling cmake replacement libraries
2018-12-15 15:49:48 +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
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
Mark Olesen
9065346a05 ENH: additional handling of questionable bad FOAM_EXT_LIBBIN values
- if FOAM_EXT_LIBBIN is unset and some scripts set this to /usr/lib*
  as a fallback (eg, to avoid an undefined value) this will cause a
  system library to be found before appropriate *_ARCH_PATH entry.

  This was noticed during a scotch compilation without third-party:
  resulting in the system library (/usr/lib64/libscotch.so) to be found
  instead of the SCOTCH_ARCH_PATH location
  (/usr/lib64/mpi/gcc/openmpi/lib64/).

  Simply changing the search order doesn't work for use, since we wish
  to retain a preference for any dynamic libraries discovered in a
  real FOAM_EXT_LIBBIN.

  Circumvent these issues by only taking libraries from
  FOAM_EXT_LIBBIN if it also points to a location within ThirdParty.
2018-11-27 12:23:11 +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
e35ac89efb CONFIG: include static libraries in FFTW search (#1087) 2018-11-21 13:49:16 +01:00
Mark Olesen
2fc1a1692b CONFIG: adjust handling of PETSc environment (-force option) 2018-11-06 09:01:40 +01:00
Mark Olesen
9129dbd46f Merge remote-tracking branch 'origin/master' into develop 2018-10-11 11:01:16 +02:00
Andrew Heather
4b7c21bc3c BUG: foamNewSource - corrected Make/options for app mode. Closes #1006 2018-10-09 09:47:54 +01:00
Andrew Heather
54457c68b6 Merge remote-tracking branch 'origin/master' into develop 2018-09-21 16:01:16 +01:00
Mark Olesen
32d5030088 BUG: incorrect kahip resolution with absolute paths (closes #1003)
- for installations with central (non-ThirdParty) location for KAHIP
  (eg, spack, EasyBuild)
2018-09-12 08:37:53 +02:00