Commit Graph

61 Commits

Author SHA1 Message Date
Mark Olesen
26ec9b5a17 CONFIG: rationalize compiler tuning
- support prefs.compiler with better possibilities to provide
  overload values

STYLE: reduce code for WM_ARCH_OPTION (seldom-used)
2020-11-11 17:58:47 +01:00
Mark Olesen
1178fc190b CONFIG: add runtime settings for mingw cross-compiled binaries
- WM_ARCH=win64 to indicate the runtime environment

ENH: cross-compile wmake toolchain for the target-side as well
2020-08-06 19:36:19 +02:00
Mark Olesen
f01ad2f187 CONFIG: improve config files for Darwin (#1667), BSD-csh syntax (#1668)
- use Clang instead of Gcc for Darwin since this is its system
  compiler. The user can force use of Gcc by using Gcc92 etc.

- make etc/cshrc sed check more robust.

- replace tcsh (${%var}) syntax with ("${var}" != "")

[Fixes and ideas from Alexey Matveichev]

CONFIG: do not source the gperftools environment by default

- this is now an used feature, but can be re-enabled by advanced users
  if required.
2020-04-08 11:38:18 +02:00
Mark Olesen
5ba2cbc54f CONFIG: improve prefix matching for system libraries (#1607)
- missed detection of system libraries when installed with multiarch
  paths like /usr/lib/x86_64-linux-gnu

CONFIG: improve handling of group/user config files (#928)

- changed bashrc handling of FOAM_CONFIG_NOUSER to use
  FOAM_CONFIG_MODE instead. Propagate into foamEtcFile to make this
  a stickier control.

  This change allows better control, but also enables cluster
  installations to define their own value within the OpenFOAM prefs.sh
  file to prevent users accidentally mis-configuring things if
  necessary.

- remove undocumented handling of an (a)ll mode in foamEtcFile to
  avoid potential pitfalls.

- add support for FOAM_CONFIG_ETC handling.
  This allows injection of an extra search layer when finding
  project etc files

ENH: improvements to foamConfigurePaths (#928)

- handle FOAM_CONFIG_ETC implicitly, or explicitly with the new
  -etc option.

STYLE: more explicit wording in foamConfigurePaths usage (#1602)

- document that an absolute path (eg, -scotch-path) overrides/ignores
  the equivalent ThirdParty setting (eg, -scotch)

- longer options -system-compiler and -third-compiler for -system
  and -third, respectively. Clearer as to their purpose.

- adjust the location sanity check to look for META-INFO directory.
2020-02-24 16:00:16 +01:00
Mark Olesen
bc0b02c651 CONFIG: permit an empty value for WM_COMPILE_OPTION, WM_COMPILER_TYPE
- an empty WM_COMPILE_OPTION is treated internally (in make rules)
  like "Opt"

- an empty WM_COMPILER_TYPE is treated like "system" (system compiler)
2019-12-17 15:17:14 +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
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
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
Mark Olesen
32fe94063e CONFIG: eliminate compiler/linker enviroment variables (#517)
- with the changes added in #1256 and corresponding updates to
  ThirdParty we can stop exporting these variables:

  WM_CC WM_CFLAGS WM_CXX WM_CXXFLAGS WM_LDFLAGS
2019-04-12 15:48:06 +02:00
Mark Olesen
a54aff9d26 COMP: add wmake rules for mingw (#1238) 2019-04-28 13:36:50 +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
f0f4af16d2 Merge remote-tracking branch 'origin/master' into develop 2019-04-08 12:05:24 +02:00
Mark Olesen
a2bd63869d CONFIG: incorrect location for site appbin, libbin (fixes #1270)
- still had old WM_PROJECT_VERSION settings instead of FOAM_API
  for FOAM_SITE_APPBIN and FOAM_SITE_LIBBIN locations.
2019-04-03 23:55:49 +02:00
Mark Olesen
a2fb1d0bdd COMP: add wmake rules for Pgi compiler (#1234) 2019-03-11 15:56:40 +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
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00: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
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
01a219119d STYLE: add some shell quoting in settings files 2018-11-29 23:30:11 +01:00
Mark Olesen
9e094f1f07 ENH: relocate WM_PROJECT_SITE default (issue #1050)
- was PREFIX/site, now PROJECT/site

  This avoids several issues when installing OpenFOAM in clusters
  without an intermediate OpenFOAM-specific installation prefix.

  The 'site' directory may have a reserved meaning in these situations
  and it is undesirable to 'leak' upwards into the parent directory to
  look for configuration files.

  Placing the default within the project directory avoids this.
  Alternative locations can be given via the WM_PROJECT_SITE variable.
2018-11-29 18:04:44 +01:00
Mark Olesen
be46f96862 STYLE: adjust wording, file-layout
- comments in bashrc, cshrc.
- about controlDict names for allowSystemOperations
2018-11-29 16:53:02 +01:00
Mark Olesen
5029d29ff6 ENH: support -gcc option for foamConfigurePaths
- simplifies things for legacyCompile
2018-11-15 13:55:21 +01:00
Mark Olesen
01f76d7d55 CONFIG: list Clang37 as well for ThirdParty clang
- for Darwin, mention that clang is the only compiler configured

- adjust comments
2018-06-15 09:06: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
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
mattijs
a0a039ad57 ENH: armclang: new compiler type. Fixes #779. 2018-03-21 12:08:44 +00:00
Mark Olesen
110b00f048 ENH: improved handling of gmp/mpfr library settings (issue #674)
- export library path for gmp/mpfr from CGAL config files.
  This is required when non-system gmp/mpfr libraries are being
  used, but not using a ThirdParty compiler installation.

- automatically handle lib/ vs lib64/ (eg, for central installations)
  for packages such as boost, CGAL, etc. While the ThirdParty
  compilation of these will normally land in lib64/, this may not be
  the case when they are supplied by another means.

- reworked the handling of foamEtcFile and foamCleanPath for less
  clutter in the configuration files.
  Added the bin/tools/lib-dir script to handle logic that is
  too complex to easily manage in csh.
2018-01-11 01:30:23 +01:00
Mark Olesen
2fe7d0c00b STYLE: update BuildIssues with CGAL mpfr-none problem (issue #674)
- add some notes about 'git submodule' in modules/README.md
2017-12-21 10:38:57 +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
5ba4e83f7a CONFIG: update versions of some ThirdParty software
- ADIOS 1.13.0
- fftw 3.3.7
- paraview 5.4.1

ENH: include ThirdParty QT libraries in LD_LIBRARY_PATH for paraview
2017-12-15 09:23:37 +01:00
Mark Olesen
3f853f031a STYLE: cleanup of compiler settings
- relocate WM_COMPILER_ARCH, WM_COMPILER_LIB_ARCH from
  etc/{bashrc,cshrc} to etc/config.{csh,sh}/settings since these
  should not be changed by the user anyhow.

- Use gcc/g++ as common base and specialize afterwards (to reduce
  duplication)

- adjust format of WM_PROJECT_SITE fallback to allow for easier
  automated edits
2017-12-14 10:22:30 +01:00
Mark Olesen
05a8fe5dd3 STYLE: compact license text in config files for easier reading/editing 2017-11-20 09:00:10 +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
5d15a13247 STYLE: use FOAM_UTILITIES in Make/options
- consistent with use of FOAM_SOLVERS, and reduces reliance on the FOAM_APP
  env variable
2017-04-07 08:17:43 +02:00
Mark Olesen
eb6fb7f7e3 ENH: make FOAM_EXT_LIBBIN optional in the configuration files
- useful for builds that don't use the ThirdParty directory at all
2017-04-04 17:11:36 +02:00
Mark Olesen
af49eaf625 ENH: default jobControl now under the '~/.OpenFOAM/jobControl' directory
- this implies that jobControl is a user-resource for OpenFOAM.
  It was previously located under $WM_PROJECT_INST_DIR/jobControl,
  but few users will have write access there.

- an unset FOAM_JOB_DIR variable is treated as "~/.OpenFOAM/jobControl",
  which can partially reduce environment clutter.

- provide argList::noJobInfo() to conveniently suppress job-info on an
  individual basis for short-running utilities (eg, foamListTimes) to
  avoid unneeded clutter.
2017-04-03 08:28:15 +02: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
4339d93c8e STYLE: drop _foamSource definition (unneeded). 2017-03-14 17:24:23 +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
c84b9aaac6 ENH: use new foamEtcFile options to simplify syntax when sourcing files
Can now use this:
    _foamSourceEtc config.sh/scotch
    _foamSourceEtc config.csh/scotch

instead of this:
    _foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch)
    _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/scotch`

In the bash/sh version, leave the _foamSource function for now, since
ThirdParty is still relying on it.

STYLE: elminate while-loop for _foamAddPath etc since this type of
construct isn't readily possible for csh and isn't being used anywhere.
2017-02-23 15:55:38 +01:00
Mark Olesen
d3911dd167 STYLE: avoid old-style shell backticks in various places 2017-02-20 09:30:58 +01:00
Mark Olesen
787b19c4e4 STYLE: cleanup compiler settings (issue #176)
- export/setenv WM_COMPILER_TYPE as suggested by Mattijs.

- for overall consistency, don't carp about an unset WM_COMPILER_TYPE,
  since this would only be on the first instance (prior to the
  export/setenv) and would be confusing about why/when this message
  may occur.

- reduce clutter: only use (system|ThirdParty) for WM_COMPILER_TYPE.
  Drop the old 'OpenFOAM' setting for WM_COMPILER_TYPE, which was
  transitional in early 2011.

- make the error messages more meaningful
2016-07-12 17:19:06 +02:00
Andrew Heather
9fbd612672 GIT: Initial state after latest Foundation merge 2016-09-20 14:49:08 +01:00
Henry Weller
7996a9138f C++11: Update compilation rules to specify C++11 support and conformance
The change from C++0x to C++11 allows all of C++11 functionality to be
used in OpenFOAM, in particular constructor delegation which avoids code
duplication or constructor helper functions.  However, this also means a
change to the minimum gcc version supported which is now 4.7 rather than
4.5.

Note that gcc-4.7 does not support the entire C++11 standard but does
support all of the functionality currently needed for further OpenFOAM
development.  The minimum gcc-version which supports the entire C++11
standard is 4.8 which is now the recommended minimum gcc version.
2016-08-05 16:28:19 +01:00
mattijs
dc5c42701c BUG: config.csh: wrong variable. Fixes #176 2016-07-06 09:23:55 +01:00
Mark Olesen
b2234f19e5 BUG: could not set system clang (issue #166)
- gcc/g++ always being used

STYLE: spurious unsetenv WM_COMPILER_TYPE (csh only)

- more stringent cleanup of ThirdParty settings for wmUNSET
2016-06-29 16:06:48 +02:00
Mark Olesen
b2b4123164 STYLE: minor config file details
- move unset mpi buffer size from config.csh/settings -> config.csh/mpi

- wmUNSET now also unalias wmREFRESH

Note: unsetenv WM_COMPILER_TYPE in csh variant?

- drop reference to paraview-3 in config files.
  Cannot say anything definite about support for versions
  this old (2012)
2016-06-17 19:56:19 +02:00