- 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
- 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.
- 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.
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.
- 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
- 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.
- 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.
- 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)
- 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.
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)
- 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
- 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.
- 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
- with -mcpu=native for automatic detection and -armpl for linking in
the performance libraries
STYLE: relocate -mcpu into compiler instead of compiler-flags (#1225)
- 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
- 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
- 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.
- 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.
- 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
- 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.
- 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
- looks slightly messier without associative arrays, but improves
portability. Should now also work with dash.
STYLE: support wmakeBuildInfo -cmp and -check options as equivalent
- 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.
- 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)
- 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.
- 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.
- 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.
- local token shifting was missing when getting the next file chunk
(while in the middle of parsing that text).
As well as adding the correct shifting, also tag the local buffer
with nullptr when it is done. Be extra paranoid and check the
raw buffer range before passing off to std::string.
Previously the coordinate system functionality was split between
coordinateSystem and coordinateRotation. The coordinateRotation stored
the rotation tensor and handled all tensor transformations.
The functionality has now been revised and consolidated into the
coordinateSystem classes. The sole purpose of coordinateRotation
is now just to provide a selectable mechanism of how to define the
rotation tensor (eg, axis-angle, euler angles, local axes) for user
input, but after providing the appropriate rotation tensor it has
no further influence on the transformations.
--
The coordinateSystem class now contains an origin and a base rotation
tensor directly and various transformation methods.
- The origin represents the "shift" for a local coordinate system.
- The base rotation tensor represents the "tilt" or orientation
of the local coordinate system in general (eg, for mapping
positions), but may require position-dependent tensors when
transforming vectors and tensors.
For some coordinate systems (currently the cylindrical coordinate system),
the rotation tensor required for rotating a vector or tensor is
position-dependent.
The new coordinateSystem and its derivates (cartesian, cylindrical,
indirect) now provide a uniform() method to define if the rotation
tensor is position dependent/independent.
The coordinateSystem transform and invTransform methods are now
available in two-parameter forms for obtaining position-dependent
rotation tensors. Eg,
... = cs.transform(globalPt, someVector);
In some cases it can be useful to use query uniform() to avoid
storage of redundant values.
if (cs.uniform())
{
vector xx = cs.transform(someVector);
}
else
{
List<vector> xx = cs.transform(manyPoints, someVector);
}
Support transform/invTransform for common data types:
(scalar, vector, sphericalTensor, symmTensor, tensor).
====================
Breaking Changes
====================
- These changes to coordinate systems and rotations may represent
a breaking change for existing user coding.
- Relocating the rotation tensor into coordinateSystem itself means
that the coordinate system 'R()' method now returns the rotation
directly instead of the coordinateRotation. The method name 'R()'
was chosen for consistency with other low-level entities (eg,
quaternion).
The following changes will be needed in coding:
Old: tensor rot = cs.R().R();
New: tensor rot = cs.R();
Old: cs.R().transform(...);
New: cs.transform(...);
Accessing the runTime selectable coordinateRotation
has moved to the rotation() method:
Old: Info<< "Rotation input: " << cs.R() << nl;
New: Info<< "Rotation input: " << cs.rotation() << nl;
- Naming consistency changes may also cause code to break.
Old: transformVector()
New: transformPrincipal()
The old method name transformTensor() now simply becomes transform().
====================
New methods
====================
For operations requiring caching of the coordinate rotations, the
'R()' method can be used with multiple input points:
tensorField rots(cs.R(somePoints));
and later
Foam::transformList(rots, someVectors);
The rotation() method can also be used to change the rotation tensor
via a new coordinateRotation definition (issue #879).
The new methods transformPoint/invTransformPoint provide
transformations with an origin offset using Cartesian for both local
and global points. These can be used to determine the local position
based on the origin/rotation without interpreting it as a r-theta-z
value, for example.
================
Input format
================
- Streamline dictionary input requirements
* The default type is cartesian.
* The default rotation type is the commonly used axes rotation
specification (with e1/e2/3), which is assumed if the 'rotation'
sub-dictionary does not exist.
Example,
Compact specification:
coordinateSystem
{
origin (0 0 0);
e2 (0 1 0);
e3 (0.5 0 0.866025);
}
Full specification (also accepts the longer 'coordinateRotation'
sub-dictionary name):
coordinateSystem
{
type cartesian;
origin (0 0 0);
rotation
{
type axes;
e2 (0 1 0);
e3 (0.5 0 0.866025);
}
}
This simplifies the input for many cases.
- Additional rotation specification 'none' (an identity rotation):
coordinateSystem
{
origin (0 0 0);
rotation { type none; }
}
- Additional rotation specification 'axisAngle', which is similar
to the -rotate-angle option for transforming points (issue #660).
For some cases this can be more intuitive.
For example,
rotation
{
type axisAngle;
axis (0 1 0);
angle 30;
}
vs.
rotation
{
type axes;
e2 (0 1 0);
e3 (0.5 0 0.866025);
}
- shorter names (or older longer names) for the coordinate rotation
specification.
euler EulerRotation
starcd STARCDRotation
axes axesRotation
================
Coding Style
================
- use Foam::coordSystem namespace for categories of coordinate systems
(cartesian, cylindrical, indirect). This reduces potential name
clashes and makes a clearer declaration. Eg,
coordSystem::cartesian csys_;
The older names (eg, cartesianCS, etc) remain available via typedefs.
- added coordinateRotations namespace for better organization and
reduce potential name clashes.
- avoids compiler ambiguity when virtual methods such as
IOdictionary::read() exist.
- the method was introduced in 1806, and was thus not yet widely used
- ignore implicit-fallthrough for ragel generated code.
- add -Wno-deprecated-declarations for c++LESSWARN.
These principally associated with older CGAL versions and their use
of particular mpfr routines.
- since 1612, FOAM_INST_DIR and foamInstDir longer have any
special meanings when sourcing the bashrc or cshrc files.
Thus no need for special treatment in any of the dispatch wrappers.
Retained FOAM_INST_DIR as (unexported) variable in etc/bashrc,
just in case people are using patched versions of etc/bashrc
as part of their installation.
ENH: relax prefix restrictions on foamCreateVideo (issue #904)
- shift the implicit '.' to be part of the default prefix. This allows
things like "-image myimages_00" to work as might be expected.
- comments
- avoid egrep for getting processor count.
- wcleanBuild, wcleanPlatform with shorter form '-curr' instead of '-c'
to avoid any potential user confusion with '-comp'
- link CGAL (clang version) without reference to mpfr,gmp libraries
- use offset address in printStack for Darwin as well
- alternative handling of feexcept on Darwin
- improvement documentation for surface sampling.
- can now specify alternative sampling scheme for obtaining the
face values instead of just using the "cell" value. For example,
sampleScheme cellPoint;
This can be useful for cases when the surface is close to a boundary
cell and there are large gradients in the sampled field.
- distanceSurface now handles non-closed surfaces more robustly.
Unknown regions (not inside or outside) are marked internally and
excluded from consideration. This allows use of 'signed' surfaces
where not previously possible.
- since PackedBoolList is now a compatibility typedef for bitSet,
it is useful to have an additional means of distinction.
STYLE: simplify internal version tests and compiler defines.
- the API version is now conveyed via the OPENFOAM define directly.
The older OPENFOAM_PLUS define is provided for existing code.
- parsing error state only arises from a missing final newline
in the file (which the dnl macro does not capture).
Report with a warning instead of modifying the dnl macro since
we generally wish to know about this anyhow.
- add missing newline to YEqn.H file.
- handling of dead links (find -L -delete unsupported)
- remove ignore case flag on 's/../../i' used in have_scotch script.
It is unneeded and not tolerated by Darwin's sed.
- avoid embedded comments in EXE_INC (Make/options files), which do
not work well with the OSX LLVM cpp.
It strips out the comments but also removes the continuation char.
STYLE: adjust notes about paraview library locations
- generalize some of the library extensions (.so vs .dylib).
Provide as wmake 'sysFunctions'
- added note about unsupported/incomplete system support
- centralize detection of ThirdParty packages into wmake/ subdirectory
by providing a series of scripts in the spirit of GNU autoconfig.
For example,
have_boost, have_readline, have_scotch, ...
Each of the `have_<package>` scripts will generally provide the
following type of functions:
have_<package> # detection
no_<package> # reset
echo_<package> # echoing
and the following type of variables:
HAVE_<package> # unset or 'true'
<package>_ARCH_PATH # root for <package>
<package>_INC_DIR # include directory for <package>
<package>_LIB_DIR # library directory for <package>
This simplifies the calling scripts:
if have_metis
then
wmake metisDecomp
fi
As well as reducing clutter in the corresponding Make/options:
EXE_INC = \
-I$(METIS_INC_DIR) \
-I../decompositionMethods/lnInclude
LIB_LIBS = \
-L$(METIS_LIB_DIR) -lmetis
Any additional modifications (platform-specific or for an external build
system) can now be made centrally.
- the previous grammar used
'/*' { fgoto comment; }
to start processing multi-line comments and
comment := any* :>> '*/' @{ fgoto main; };
as a finishing action to return to normal lexing, but seemed not to
have been triggered properly.
Now simply trap in a single rule:
'/*' any* :>> '*/'; # Multi-line comment
STYLE: use more compact dnl (delete to newline)
OLD: [^\n]* '\n'
NEW: (any* -- '\n') '\n'
eliminates the intermediate state
- However, the new ragel-based parser is much faster
than the others, and does not cause 'too many open files' error
that the flex-based parser does (issue #784).
The timings (using src/sampling as being somewhat representative)
$ wclean; wmakeLnInclude -u .; time wmake -s dep
3.4s wmkdepend (ragel) [now default]
5.7s wmkdep (flex)
6.1s cpp -M
- The makeDepend script is for testing purposes only, but could used as
a hook for other dependency generation systems (eg, ninja).
It simply wraps 'cpp -M' in a form that is calling compatible with
wmkdepend.
BUG: wmkdepend parser was missing optional leading space on #include match
STYLE: use -G2 (goto-based) option for wmkdepend state machine
- the machine is compact with few states and lends itself to this
- a partial selection from https://github.com/mrklein/openfoam-os-x
with adjustments. The primary purpose is to reduce header-level
incompatibilities and to provide a common set of make rules to allow
easier patching (or re-integration).
This is similar to efforts (Feb 2010) but using ragel
(https://en.wikipedia.org/wiki/Ragel) instead of the now defunct
coco/r. The modified commit message from 2010:
ENH: add C++-based wmkdepend parser (uses ragel grammar).
- This avoids dependency on lex/flex and provides better encapsulation
for buffer switching. As a result, the maximum number of open files
only corresponds to the include depth.
--
Note that the flex source and rules are still available, but are not
deactivate (see wmake/rules/General/transform)
- primary points for an external user are the polyMesh constructor
- add config info for gcc-7.3.0
COMP: intel-2017. Ignore unknown pragmas. Disambiguate method resolution.
- downgrades some diagnostics about nonconformant code from errors to
warnings. Oddly enough, the errors actually arise from STL library
elements shipped with gcc itself. Affects kahip compilation with
gcc-6, gcc-7
- required if there is no system openmp and libomp or libgomp are
only found in the clang hierarchy
STYLE: add some notes in the openmp rules.
- the _OPENMP macro is now used in low-level testing files
- unknown options or missing option values now emit a shorter message
without the entire usage. This makes it easier to identify the errors
and is better aligned with the behaviour of GNU system tools.
====
$ simpleFoam -case
Using: OpenFOAM-plus (see www.OpenFOAM.com)
Build: plus-01234
Error: option '-case' requires an argument
See 'simpleFoam -help' for usage
====
- provide for reduced (-help) and full (-help-full) usage information.
In many cases the reduced usage provided sufficient and easier
to find the information.
- make -srcDoc an alias for -doc-source
- no warnings about option aliases for future dates.
- add -compiler=NAME option to remove a build or platforms directory
corresponding to any specified compiler on the current arch.
- when -compiler or -compiler=NAME is specified, also clean related
sub-directories as well. This will cleanup mpi-related directory.
- improve functional compatibility with DynList (remove methods)
* eg, remove an element from any position in a DynamicList
* reduce the number of template parameters
* remove/subset regions of DynamicList
- propagate Swap template specializations for lists, hashtables
- move construct/assignment to various containers.
- add find/found methods for FixedList and UList for a more succinct
(and clearer?) usage than the equivalent global findIndex() function.
- simplify List_FOR_ALL loops
- suppress error messages that appear with zsh.
According to unset(1p), 'unset -f' unsets a function.
If the function was not previously defined, this is a no-op.
This is similar for zsh, but there it emits a warning if the
function was not previously defined.
- avoid 'local' in functions sources from etc/bashrc.
ksh does not support this.
- use 'command' shell builtin instead of 'type'.
Seems to be more consistent between shell flavours.
- if called from the top-level project directory ($WM_PROJECT_DIR)
default to using {applications,src} directories. This avoids
erroneous linking of etc/codeTemplates and avoids the lengthy
scanning of the tutorials directory
- handle sourcing bashrc with a relative path (issue #383)
- handle sourcing from bash and zsh.
Still need manual intervention when sourcing dash, sh, or ksh.
- replace grep in etc/cshrc with sed only
- logical instead of physical path for WM_PROJECT_DIR (issue #431).
Doesn't seem to be possible for csh/tcsh.
* Continue using physical locations when comparing directories,
but not for the top-level FOAM_INST_DIR, WM_PROJECT_DIR.
- relocate WM_CC, WM_CXX overrides from etc/config.*/compiler
to etc/config.*/settings to ensure that they are left untouched
when etc/config.sh/compiler is sourced while making third-party
packages (eg, gcc, llvm, CGAL).
- provide fallback FOAM_TUTORIALS setting in RunFunctions
STYLE: remove "~OpenFOAM" fallback as being too rare, non-obvious
- caused by the typo '@E' instead of '$E' (commit 997f1713cb)
ENH: minor improvements for wmake/src makefile
- 'make clean' now also tries to remove the parent platforms/
directory if possible.
- the flex intermediate build target is placed into the platforms/
directory to avoid touching the src/ directory at all.
- suppress warnings about unused functions (GCC only)
- new behaviour is to do nothing if no platform was specified.
This helps avoid inadvertently removing files.
- support special platforms for compatibility with wmake/wclean targets.
Eg, "wcleanPlatform all"
- allow use from ThirdParty top-level as well, since the directory
structure is similar.
BUG: fix regression in wcleanLnIncludeAll introduced by 9e2e111518
- use "-pvMAJ.MIN" suffix for similarity with the paraview convention
- use sentinel file to ensure clean change of intermediate targets
- ensure all library files are being properly removed