Commit Graph

227 Commits

Author SHA1 Message Date
Mark Olesen
79993bba43 CONFIG: support explicit selection of 'ld' linker
- for clang-based compilers the default linker may be lld or simply ld.
  Support '+link-ld' to explicitly select use of the ld linker.

- consolidate linker rules into single files

STYLE: adjust SPDX Identifier
2023-12-15 16:17:12 +01:00
Andrew Heather
6ea2041122 Merge remote-tracking branch 'origin/master' into develop 2023-11-14 17:52:28 +00:00
Mark Olesen
778796853d CONFIG: enable use of stricter deprecation warnings
- selected with '+strict' in WM_COMPILE_CONTROL or 'wmake -strict', it
  enables the FOAM_DEPRECATED_STRICT() macro, which can be used to
  mark methods that are implicitly deprecated, but are not yet marked
  as full deprecated (eg, API modification is too recent, generates
  too many warnings).  Can be considered a developer option.
2023-08-21 08:39:36 +02:00
Mark Olesen
224c3199aa CONFIG: enable xcrun with cc/c++ based on WM_COMPILE_CONTROL (#2965)
- adding in +xcrun into WM_COMPILE_CONTROL changes the compiler
  settings as follows (for MacOS)

      cc         := xcrun cc
      CC         := xcrun c++ -std=c++14
2023-08-18 15:46:25 +02:00
Alexey Matveichev
e4f2efec18 COMP: add rpath information to MacOS compilation rules (#2948)
- since the Apple SIP (System Integrity Protection) clears environment
  variables such as DYLD_LIBRARY_PATH, a number of workarounds have
  been used to provide shadow values. However, for a more robust
  installation using -rpath at compilation time appears to be the
  better solution.

  In addition to the usual -rpath specification with absolute file
  paths, MacOS supports (@loader_path, @executable_path) as well.
  Now default to link with rpath information for MacOS, which can be
  disabled by adding `~rpath` in WM_COMPILE_CONTROL

  Explicit library paths handled:
    - FOAM_FOAM_EXT_LIBBIN, FOAM_EXT_LIBBIN/FOAM_MPI

  The executable rpaths are handled assuming a structure of
     install-path/bin
     install-path/lib/$(FOAM_MPI)
     install-path/lib

  Absolute compile-time paths for FOAM_USER_LIBBIN, FOAM_SITE_LIBBIN
  and FOAM_LIBBIN are not handled since these are either too fragile
  (FOAM_USER_LIBBIN and FOAM_SITE_LIBBIN values) or covered via
  @loader_path anyhow (FOAM_LIBBIN).

  Since the value of FOAM_MPI is a compile-time value, this rpath
  treatment makes the installation less suitable for runtime changes
  to the MPI vendor/version.

  Note: no rpath added for c-only compilations since there are
  currently no c-only libraries or executables with dynamic loading
2023-08-18 15:46:12 +02:00
Andrew Heather
fbf00d6bf2 RELEASE: Updated version to v2306 2023-06-28 16:35:48 +01:00
Andrew Heather
1cd47839ac CONFIG: Reset version post-release 2022-12-23 13:53:49 +00:00
Andrew Heather
66908158ae RELEASE: Updated version to v2212 2022-12-21 16:16:18 +00:00
Mark Olesen
9f7cfa9419 ENH: support libz disabling via WM_COMPILE_CONTROL (as ~libz)
- eg, for partially incomplete systems (without libz devel header)

ENH: clearer binding of dummy Pstream in OpenFOAM/Make/options

- link of dummy stub Pstream now contingent on linking libOpenFOAM as
  well. This makes the purpose slightly clearer

ENH: cleaner option naming/handling in wmake script

- allow special purpose -no-openfoam option.
  Eg, compiling test programs without OpenFOAM and Pstream libraries
  but using the rest of the wmake system.

ENH: add +openmp support into WM_COMPILE_CONTROL (#2633)

- this adds compile/link flags for openmp.
  For single-use, can also use 'wmake -openmp'.

  If both +openmp and ~openmp are specified in WM_COMPILE_CONTROL
  the ~openmp will have priority.

  This is actually done indirectly since ~openmp will set empty
  COMP_OPENMP, LINK_OPENMP internal variables, which the +openmp then
  adds to the c++FLAGS and linkexe targets (ie, won't actually add
  anything).

ENH: add +ccache or ccache=... support into WM_COMPILE_CONTROL (#2633)

- with the first version (+ccache), simply use ccache from the path
  without any extra options.

- with the second version (ccache=...), can be more specific about
  what is called.

  Using "+ccache" is identical to "ccache=ccache", but the later could
  be used in other ways. For example,

     ccache=/strange/install/path/ccache
     ccache=</path/my-tooling --option>

  Have the choice of unquoted, single or double quoted or '< >' quoted

STYLE: relocate FOAM_EXTRA_LDFLAGS in general makefile

- removes clutter for different linkers (eg, gold, mold, ldd)
  making it easier to extend for other linkers.

STYLE: protect makefile checks with 'strip' function
2022-11-15 14:00:18 +01:00
Mark Olesen
793f4e3a37 CONFIG: add support for WM_COMPILE_OPTION='Dbg'
- uses '-g -DFULLDEBUG' (like Debug), but with -O3 (like Opt).

  This adds in debug symbols and FULLDEBUG code segments (good for
  code development) but retains -O3 optimizations and code paths and
  avoids the much slower -O0 associated with 'Debug'.

- add in central wmake/General/common/{c,c++}XXX tuning,
  which helps reduce the number of nearly identical files

ENH: add support for wmake -debug-Og
2022-09-09 11:55:33 +02:00
Mark Olesen
ea91261f59 CONFIG: update compiler versions 2022-06-14 15:23:08 +02:00
Mark Olesen
2c77514417 CONFIG: support wmake -debug-O0, -debug-O1 etc.
- rearranged order of flags so that FOAM_EXTRA_CXXFLAGS is added
  after the WARN/OPT/DBUG flags

CONFIG: drop wmake rules for PGI compiler (defunct)
2022-06-02 22:37:00 +02:00
Mark Olesen
a27af5e369 ENH: add optional control to use clang lld linker (#2449)
Eg,
    export WM_COMPILER=Clang130
    export WM_COMPILE_CONTROL="version=13.0 +lld"

- also support the mold linker (+mold) for clang

STYLE: report as 'link' stage instead of 'ld' in short messages
2022-04-29 11:44:28 +02:00
Mark Olesen
2698cab01c ENH: extend use of WM_COMPILER_CONTROL to manage compiler versions
- for compilers such as gcc and clang, may have several different
  variants installed on the computer. Use WM_COMPILER_CONTROL to
  specify the preferred variant.

  Eg,
      WM_COMPILER=Gcc
      WM_COMPILER_CONTROL="version=8"

      will compile with "gcc-8" and "g++-8"

  Good practice would be to tag output directory names with the
  version too. Eg

      WM_COMPILER=Clang110
      WM_COMPILER_CONTROL="version=11.0"

STYLE: modify message for change of gcc -> clang (darwin)
2021-11-02 17:30:06 +01:00
Mark Olesen
c2697f466d CONFIG: update c++ standard, some compiler rules (partially addresses #2209)
- migrate to c++14 for most compilers *except* gcc.
  There are still many systems in use with gcc-4.8.5, which does not
  support c++14.

- initial rules for nvidia compilers (pgi is will soon be defunct).
  Not fully tested...

CONFIG: provide fallback value for the user directory name

- in containers may have an unset USER env variable.
  Default to 'user' to prevent ugly looking directory names.
2021-10-21 15:31:05 +02:00
Andrew Heather
f75379633c CONFIG: Updated version to com following release of OpenFOAM v2106 2021-06-28 17:33:22 +01:00
Andrew Heather
c15bfde3cb RELEASE: Updated config scripts to v2106 2021-06-28 09:15:09 +01:00
Mark Olesen
d549826528 CONFIG: adjust intel compiler and mpi settings (#2056)
- largely as per patch from Jong-Gwan (Jason) Do

NB: the intel-one setup adds in paths for intelmpi.
    Its mpicc version does not harmonize with the OpenFOAM
    system openmpi setup (using mpicc --showme:link).

    Needs adjustment, or use intelmpi instead.

- update name mappings for newer gcc, clang versions
2021-04-23 11:39:29 +02:00
Andrew Heather
0723bcbf8a GIT: reverted version back to 'com' 2020-12-23 10:01:24 +00:00
Andrew Heather
79e353b84e RELEASE: Updated version to v2012 2020-12-23 10:01:39 +01:00
Mark Olesen
c91fc6f41c CONFIG: rationalize mpi config tuning (#1910)
- prefix FOAM_MPI and library directories with 'sys-' for system
  versions for uniform identication.

  WM_MPLIB      | libdir (FOAM_MPI)  | old naming |
  SYSTEMMPI     | sys-mpi            | mpi        |
  SYSTEMOPENMPI | sys-openmpi        | openmpi-system |

- prefix preferences with 'prefs.' to make them more easily
  identifiable, and update bin/tools/create-mpi-config accordingly

      Old name: config.{csh,sh}/openmpi
      New name: config.{csh,sh}/prefs.openmpi

- additional mpi preferences now available:
    * prefs.intelmpi
    * prefs.mpich
    ...

CONFIG: added hook for EASYBUILDMPI (eb-mpi), somewhat like USERMPI

- EasyBuild uses mpicc when compiling, so no explicit wmake rules are
  used

ENH: support different major versions for system openmpi

- for example, with

     WM_MPLIB=SYSTEMOPENMPI2

  defines FOAM_MPI=sys-openmpi2 and thus creates lib/sys-openmpi2

ENH: centralize handling of mpi as 'mpi-rules'

    Before:
        sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
        sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB)

        ifeq (,$(FOAM_MPI_LIBBIN))
            FOAM_MPI_LIBBIN := $(FOAM_LIBBIN)/$(FOAM_MPI)
        endif

    After:
        include $(GENERAL_RULES)/mpi-rules

- also allows variants such as SYSTEMOPENMPI2 to be handled separately
2020-11-11 18:36:01 +01:00
Mark Olesen
410d38b9d9 ENH: support true/false, yes/no values for FOAM_ABORT (#1896)
- consistent with FOAM_SIGFPE etc.

- centralize code as error::useAbort() static function to avoid
  scattering the logic throughout the code.

ENH: also accept "0" and "1" string values for Switch

- not the normal path for Switch input (eg, from a dictionary), but
  consistent with bool definitions and simplifies string parsing.

  This means that `FOAM_SIGFPE=1 application` will now also work.
2020-10-28 16:04:12 +01:00
Mark Olesen
9423d2bd83 CONFIG: improve support for compiler/link options (#1830)
- introduce WM_COMPILE_CONTROL variable to convey control information
  into the build rules.

  The convention (as per spack):
      - '+' to select a feature
      - '~' to deselect a feature

  Eg, to select the gold linker, and disable openmp
  (spaces are not required):

      WM_COMPILE_CONTROL="+gold ~openmp"

CONFIG: accept FOAM_EXTRA_LDFLAGS for AMD, gold, Mingw linkers

CONFIG: generalize PROJECT_LIBS (-ldl used almost universally)
2020-09-07 09:45:51 +02:00
Andrew Heather
0dc07fb00f CONFIG: reset version 2020-06-30 12:45:36 +01:00
Andrew Heather
780c156103 REL: Updated config to v2006 2020-06-29 17:27:54 +01:00
Mark Olesen
934d0bd743 ENH: support FOAM_MODULE_PREFIX to guide location of module builds (#1721)
- When compiling additional modules or user code, we need more control
  for the installation locations beyond the usual FOAM_USER_LIBBIN,
  FOAM_SITE_LIBBIN, FOAM_LIBBIN, and wish to have these values be
  modifiable without editing files.

- provide wmake rules for handling standard defaults:
    * GENERAL_RULES/module-path-user
    * GENERAL_RULES/module-path-group
    * GENERAL_RULES/module-path-project
  which are incorporated as follows:

  Make/options:
      include $(GENERAL_RULES)/module-path-user

  Make/files:
      LIB = $(FOAM_MODULE_LIBBIN)/libMyLibrary

  By default these would compile into FOAM_USER_{APPBIN,LIBBIN} but
  could be adjusted at compilation time. For example,

```
wmake -module-prefix=/path/my-install-location
```
Or
```
./Allwmake -module-prefix=/path/my-install-location
./Allwmake -prefix=/path/my-install-location
```
Or
```
FOAM_MODULE_PREFIX=/path/my-install-location ./Allwmake
```

ENH: add -no-recursion option for AllwmakeParseArguments

- more descriptive naming than the -fromWmake option (still supported)

- remove wmake/scripts/wmake.{cmake,wmake}-args since the -prefix
  handling and -no-recursion is now directly handled by AllwmakeParseArguments
2020-06-08 13:51:26 +02:00
Mark Olesen
b3464d8afc COMP: wmake rules for AMD (clang-based) compiler (#1627)
- not fully tested
2020-05-06 13:11:09 +02:00
Mark Olesen
78dc8c6ba6 CONFIG: refactor common link rules, support FOAM_EXTRA_CFLAGS (#1256)
- additional cgal-headers-only rules (future use)

COMP: add -lgmp for CGAL with mpfr linkage
2020-05-06 13:10:30 +02:00
Mark Olesen
e1586bdaa0 CONFIG: add linuxARM64Fujitsu settings (#1671) 2020-04-16 00:48:08 +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
2892b78d72 CONFIG: support FOAM_EXTRA_CXXFLAGS (#1256)
- allows custom tuning of compilation parameters
2020-02-20 12:18:12 +01:00
mattijs
09db19c3f0 Merge remote-tracking branch 'origin/master' into develop 2020-02-12 17:13:34 +00:00
Mark Olesen
f90de02159 ENH: openfoam shell session - improved and relocated
- '-c' option (as per shell), '-Dkey[=value]' option to provide
  preferences via the command-line. For example,

      etc/openfoam -DWM_COMPILER=Clang -int64  ./Allwmake -j -s -l

  These can also be combined with other options. Eg,

      etc/openfoam -DWM_COMPILER=Clang \
          -c 'wmake -show-path-cxx -show-cxxflags'

- relocated from bin/tools/ => etc/ for easier access

- bin/tools/openfoam.in : for autoconfig-style installation

- Auto-detect if the shell script was executed with openfoam and
  interpret accordingly.

  Simple example,

      --------------
      #!/usr/bin/openfoam
      cd "${0%/*}" || exit   # Run -*-sh-*- from this dir

      blockMesh
      simpleFoam
      --------------

   Note it is NOT currently possible to provide any other parameters
   this way. Eg,

      `#!/usr/bin/openfoam -sp` (NOT)

   This will either fail to run, or result in infinite recursion.
2020-02-12 17:48:09 +01:00
Mark Olesen
a100b49606 BUG: csh ignores additional parameters (fixes #1582) 2020-02-05 10:27:38 +01:00
Andrew Heather
bbb4b01910 CONFIG: reset version to com 2019-12-23 14:51:27 +00:00
Andrew Heather
f3950763fe REL: Updated bashrc|cshrc version to v1912 2019-12-23 09:49:24 +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
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
043d55e382 ENH: add wrapper for starting OpenFOAM as an interactive bash session
- call also be used non-interactively for simple 'one-shot' use of
  OpenFOAM utilities or solvers

STYLE: use dash instead of brackets for '- see www.OpenFOAM.com'

- less cluttered in combination with API information
2019-09-25 17:36:10 +02:00
Mark Olesen
615565ad40 STYLE: relocate bashrc,cshrc projectDir detection as (advanced / legacy)
- makes the standard config variables more visible
2019-07-15 10:58:55 +02:00
Andrew Heather
7b02c0fa19 CONFIG: Reset WM_PROJECT_VERSION 2019-06-27 13:30:14 +01:00
Andrew Heather
be44dcaf1f RELEASE: Version clean-up for release 2019-06-25 11:51:19 +01:00
Mark Olesen
47f375887e CONFIG: adjust bin/tools/foamConfigurePaths
- add a '-SPDP' option

- remove the '-archOption' for forcing a '-m32' build on 64-bit
  architecture, which is now considered too obscure.
  Must edit files manually if this option is really required.
2019-06-25 07:48:33 +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
46bc808261 ENH: add primitives support for mixed precision (#1086)
- add vsmall pTraits for scalars
- report the solve scalar in buildArch information
2019-02-03 16:54:25 +00:00
Mark Olesen
a2fb1d0bdd COMP: add wmake rules for Pgi compiler (#1234) 2019-03-11 15:56:40 +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