Commit Graph

733 Commits

Author SHA1 Message Date
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
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
820b63e0b2 CONFIG: bump API version number to 1811 to register recent changes 2018-11-26 15:14:01 +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
Mattijs Janssens
fdf19d67a4 Merge branch 'feature-coordinateSystem' into 'develop'
coordinate system improvements

See merge request Development/OpenFOAM-plus!211
2018-10-11 16:32:03 +01:00
Mark Olesen
9129dbd46f Merge remote-tracking branch 'origin/master' into develop 2018-10-11 11:01:16 +02:00
Mark Olesen
aafbb6723f BUG: wmkdepend sometimes throws (closes #1036)
- 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.
2018-10-10 15:33:35 +02:00
Andrew Heather
4b7c21bc3c BUG: foamNewSource - corrected Make/options for app mode. Closes #1006 2018-10-09 09:47:54 +01:00
Mark Olesen
6697bb4735 ENH: improve, simplify, rationalize coordinate system handling (issue #863)
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.
2018-10-01 13:54:10 +02: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
Mark Olesen
d40103a86f CONFIG: extend wmake detection scripts 2018-07-31 11:25:53 +02:00
Mark Olesen
f00c7a655c COMP: rename dictionary::read<T> to dictionary::readEntry<T>
- avoids compiler ambiguity when virtual methods such as
  IOdictionary::read() exist.

- the method was introduced in 1806, and was thus not yet widely used
2018-07-30 15:52:40 +02:00
Bernhard Gschaider
dd775c6e68 CONFIG: add trapping-math for darwin 2018-07-30 12:18:40 +02:00
Mark Olesen
94a89d530a COMP: reduce compiler warnings for gcc-7
- 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.
2018-07-24 09:29:01 +02:00
Mark Olesen
831a47b81e CONFIG: eliminate most occurances of outdated FOAM_INST_DIR (issue #444)
- 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.
2018-06-25 09:56:34 +02:00
Mark Olesen
f5275444cc CONFIG: adjust adios2 config 2018-06-19 13:53:23 +02:00
Mark Olesen
418cc9b268 STYLE: minor adjustments in wmake scripts.
- comments
- avoid egrep for getting processor count.
- wcleanBuild, wcleanPlatform with shorter form '-curr' instead of '-c'
  to avoid any potential user confusion with '-comp'
2018-07-22 18:28:29 +02:00
Andrew Heather
c909a5df25 GIT: resolved merge conflict 2018-06-13 14:20:18 +01:00
Alexey Matveichev
9258b558f4 ENH: Darwin adjustments
- 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
2018-06-13 13:32:19 +02:00
Mark Olesen
e3f85039a0 CONFIG: set API version number to 1806 for pre-release branch 2018-06-13 13:10:14 +02:00
Alexey Matveichev
cdb6d5a604 CONFIG: remove Darwin GCC wmake rules (partly broken, poorly tested) 2018-06-01 14:35:43 +02:00
Mark Olesen
12553a2e43 COMP: include /usr/local in search for system headers/libraries
- this is consistent with compiler defaults, and helps Darwin users
2018-05-30 14:45:12 +02:00
Mark Olesen
e3bb7ffd25 STYLE: avoid mix of 'sinclude' and '-include' in make files 2018-05-28 10:46:40 +02:00
Mark Olesen
4289242c07 Merge remote-tracking branch 'origin/master' into develop 2018-05-16 16:07:00 +01:00
Mark Olesen
c18a2a6370 BUG: compiler-specific INTELMPI not always found (closes #830)
- tie the MPI rules to the base compiler type *without* its version.
  Eg, linux64Gcc (which exists) instead of linux64Gcc81
2018-05-16 12:36:29 +01:00
Mark Olesen
b0648f2ba0 ENH: improvements in the surface sampling infrastructure
- 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.
2018-05-07 11:29:00 +02:00
Mark Olesen
c0766ce8ea STYLE: consistent '// End namespace' markers 2018-04-27 09:51:35 +02:00
Mark Olesen
497dde2b2f CONFIG: bump API version number to 1804 to account for bitSet
- 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.
2018-04-26 09:28:42 +02:00
Mark Olesen
ebfe46503f STYLE: improve wmkdepend parse error message
- 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.
2018-04-25 14:37:59 +02:00
Mark Olesen
76cb38fbc7 CONFIG: adjust make scripts for darwin
- 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
2018-04-24 21:20:06 +02:00
Mark Olesen
2768500d57 CONFIG: remove WM_LINK_LANGUAGE env variable (always c++)
- was somewhat redundant in wmake/rules/General/general anyhow
2018-04-24 14:59:47 +02:00
Mark Olesen
b4d38ab468 ENH: improve handling of ThirdParty packages
- 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.
2018-04-24 14:51:19 +02:00
Mark Olesen
29c020f5b3 COMP: sinclude platform-specific CGAL rules
- permits platform-specific override of the general CGAL rules
2018-04-24 09:26:50 +02:00
Mark Olesen
1f25c5975d BUG: wmkdepend finds 'include' in multi-line comments (closes #784)
- 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
2018-04-20 14:41:32 +02:00
Mark Olesen
aeef1cd4df BUG: wmkdepend parser missing some files
- adjusted grammar to be more precise
2018-04-17 09:20:01 +02:00
Mark Olesen
b29a0119de ENH: minor code tidying, machine simplifications for wmkdepend parser 2018-04-13 16:17:39 +02:00
Mark Olesen
de72a04aeb ENH: make it easier to switch between the various make dependencies programs.
- 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
2018-04-12 10:14:03 +02:00
Mark Olesen
297570de53 COMP: some low-level darwin-related patches
- 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).
2018-04-09 12:48:55 +02:00
Mark Olesen
1676bd4003 ENH: replace flex-based wmkdep with ragel-based parser (issue #784)
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)
2018-04-11 12:31:36 +02:00
Mark Olesen
52cf2d68c4 STYLE: avoid 'sed -i' in wmake rules
- less efficient and less portable than using single-pass processing
2018-04-08 22:15:21 +02:00
mattijs
b854ce228e ENH: wmkdep: better error message. See #784. 2018-03-28 16:39:05 +01:00
Mark Olesen
2db4b0867e CONFIG: consolidate C++ flags per compiler type
- easier to ensure that flags are consistent
2018-03-21 11:50:57 +01:00
mattijs
a0a039ad57 ENH: armclang: new compiler type. Fixes #779. 2018-03-21 12:08:44 +00:00
Mark Olesen
451f8e0357 Merge remote-tracking branch 'origin/master' into develop 2018-03-07 18:08:07 +01:00
Mark Olesen
664685f7fe CONFIG: bump API version number to 1803 to account for removal of Xfer
- 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.
2018-03-05 20:18:26 +01:00
Mark Olesen
7f7f9336c8 COMP: add -fpermissive to c++LESSWARN flags (closes #744)
- 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
2018-02-28 14:31:48 +01:00
Mark Olesen
f95f8bf512 COMP: wmake/wmakePrintBuild -api failed to extract API number 2018-02-22 10:54:16 +01:00
Mark Olesen
e2332d6bd2 COMP: better handling of versioned cmake libraries
- sentinel was not working properly when building user-space routines
2018-01-31 08:35:56 +01:00
Mark Olesen
1b9aec2a3d CONP: suppress register warnings for clang only 2018-01-30 06:49:32 +01:00
Mark Olesen
995c55b60e CONFIG: add clang third-party lib to LD_LIBRARY_PATH
- 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
2017-12-19 16:07:15 +01:00
Mark Olesen
c70d7237e2 STYLE: more robust extraction of API number from wmake rules 2017-12-17 15:19:09 +01:00
Mark Olesen
2795d64384 COMP: suppress clang warnings about unknown compiler warning option
- allows enabling new warnings without causing messy output with older
  clang versions
2017-12-15 20:02:26 +01:00
Mark Olesen
405cf8129a CONFIG: update some wmake rules
- initial settings for ADIOS2, linuxARM64Gcc, linuxARM64Clang
2017-12-07 15:41:58 +00:00
Mark Olesen
570e1ab0ba fixup CONFIG: update versions of ThirdParty software 2017-12-08 09:34:02 +00:00
Mark Olesen
5947f9a337 ENH: more succinct output from command-line errors.
- 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.
2017-11-24 10:27:11 +01:00
Mark Olesen
ba8fdda5cc ENH: improve wcleanBuild, wcleanPlatform flexibility (issue #627)
- 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.
2017-10-30 10:31:05 +01:00
Mark Olesen
e03ca4c466 CONFIG: add Cray compiler, cray mpich settings, wmake rules (fixes #558)
- the cray C/C++ compilers appear to be option-compatible with gcc.

- no wmake rules for 32bit builds (deemed to be unnecessary)
2017-08-04 11:09:32 +02:00
Mark Olesen
e1167d9592 ENH: provide openmp compile and link flags.
- the USE_OMP preprocessor symbol is also defined with the openmp
  compile flag to allow conditional compilation of openmp-specific
  code.
2017-10-23 09:38:43 +02:00
Mark Olesen
049617d037 ENH: update List and DynamicList methods (issue #595)
- 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
2017-09-20 17:20:54 +02:00
Mark Olesen
a531168ae4 COMP: reinstate rules for various C++ suffixes (issue #607) 2017-09-29 18:07:42 +02:00
Henry Weller
0fdcb12759 Updated to avoid warnings from gcc-7.1.1 2017-07-31 13:46:42 +01:00
Mark Olesen
df403965ab ENH: suppress wmkdep 'No such file' warnings in wmake -silent mode 2017-06-27 09:29:56 +02:00
Mark Olesen
104f43583f CONFIG: bump baseline version to 1706
- not yet release, but some of the API and file locations are closer
  to 1706 than to 1612. Needed, for example, for swak4foam.
2017-05-30 15:09:06 +02:00
Andrew Heather
2e9bead519 MRG: merged develop line back into integration branch 2017-05-18 11:11:12 +01:00
Mark Olesen
8006d64d74 COMP: skip compilation of plugins if include files are missing (fixes #464) 2017-05-05 10:02:34 +02:00
Mark Olesen
7f01a4beda CONFIG: address differences between shells
- 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.
2017-04-20 11:02:54 +02:00
Mark Olesen
765c430748 STYLE: only count processors if required
- POSIX specifies '-c' for counting the number of matching lines,
  so we can just use that instead of 'wc' in wmake
2017-04-19 19:13:23 +02:00
Mark Olesen
4d29c32e9b ENH: improve handling of wmakeLnIncludeAll default search directories
- 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
2017-04-19 18:31:21 +02:00
Mark Olesen
446b8e7188 STYLE: respect WM_DIR value when building wmake tools
- minor bug: 'wclean empty' may have had issues with logical vs physical path
2017-03-29 13:49:15 +02:00
Andrew Heather
436ec1cf1f MRG: Integrated Foundation code to commit ba4dbed 2017-03-23 12:11:49 +00:00
Andrew Heather
04c3d535b0 MRG: Integrated Foundation code to commit 47bd8e1 2017-03-23 10:12:38 +00:00
Mark Olesen
b970ba0901 ENH: minor improvements to environment
- 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
2017-03-20 08:57:12 +01:00
Mark Olesen
249f334f83 ENH: respect '-silent' option for cmake builds
- minor cleanup of wmake sources
2017-03-15 13:06:45 +01:00
Mark Olesen
8db517bfbb CONFIG: provide Clang38, Clang39 compiler settings
- easier to test or use different versions

- change WM_CXXFLAGS to -std=c++11 instead of -std=c++0x
2017-03-10 18:13:49 +01:00
Mark Olesen
10fc0646fb BUG: 'make clean' failed for wmake/src
- 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)
2017-03-09 11:48:52 +01:00
Mark Olesen
2bfd17cf8d ENH: add 'wmkdep' to warnings and error messages from wmkdep
- makes it possible to filter out or highlight messages originating
  from wmkdep in the build process.
2017-03-09 10:20:14 +01:00
Mark Olesen
6057479926 ENH: provide wcleanBuild and improve wcleanPlatform
- 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
2017-02-24 12:20:45 +01:00
Mark Olesen
cc51def1fd STYLE: minor cleanup of foamEtcFile 2017-02-23 09:17:46 +01:00
Mark Olesen
c1ca2f4a38 BUG: missing chdir in Allwclean for wallFunctionTable
STYLE: improve consistency in Allwclean scripts
2017-02-23 01:07:10 +01:00
mark
32a78d12e2 ENH: wclean all now finds Allwclean files too (issue #408)
- this may still need more testing, but the basic idea is to find
  directories with 'Allwclean' or 'Make' and process them (once!)
2017-02-21 19:40:35 +01:00
mark
9e2e111518 STYLE: adjust ordering of 'find' command arguments
- use -name test before -type test to avoid calling stat(2) on every file.
- use -delete instead of -exec rm to avoid forking
2017-02-21 19:19:04 +01:00
Mark Olesen
957635200a ENH: build into build/ directory instead of platforms/ (issue #312)
- makes it slightly easier when packaging various binaries, or when
  building packages for installation via modules etc.
2017-02-10 20:30:15 +01:00
Mark Olesen
3d02c8a530 ENH: improve isolation of shell variables in wmake scripts
- reduces unexpected interactions between various make elements
2017-02-10 16:13:54 +01:00
mark
e82a029453 ENH: add help/usage for dirToString, wmkdep. Add dirToString -strip option.
- The dirToString -strip option is simple, but reduces effort for the caller.
2017-02-10 14:10:00 +01:00
Mark Olesen
46ecad8f7a STYLE: make wmake scripts look more POSIX-like
- also add some comments about the side-effects
2017-02-10 11:38:12 +01:00
Mark Olesen
6343e1e3b3 ENH: have wmake and wclean do something sensible with a filename as target
- For convenience, let "wmake some/path/filename.C"
  behave similar to    "wmake some/path"
  and trace back for the Make directory.
2017-02-10 10:33:50 +01:00
Henry Weller
f92862a42c Allwmake: Provides clearer message when OpenFOAM environment is not loaded
Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2424
2017-01-28 17:57:13 +00:00
Mark Olesen
9d63cc5ca8 ENH: add versioning for VTK library to runTimePostProcessing (issue #370)
Eg,
    librunTimePostProcessing.so
    librunTimePostProcessing.so.7 -> librunTimePostProcessing.so.7.1.0
    librunTimePostProcessing.so.7.1.0

- centralize handling of paraview/vtk versioning into wmake/cmakeFunctions
2017-01-23 13:37:42 +01:00
Henry Weller
1d8b31d390 Updates for clang++-3.9 2017-01-18 18:12:45 +00:00
Henry Weller
f53293441b Corrected spelling mistake existance -> existence
Patch provided by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2425
2017-01-08 23:08:41 +00:00
Mark Olesen
7a90f5e6fb ENH: add versioning to paraview plugin support libraries (issue #370)
- 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
2017-01-05 16:22:07 +01:00