- 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.
- 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
- 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
- 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.
- 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
- 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.
- 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.
- 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
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.
- 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.
- 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.
- 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.
- 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.
- 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)
- 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.
- 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.