Skip to content
Snippets Groups Projects
  1. Jun 13, 2024
  2. Dec 21, 2023
  3. Dec 15, 2023
    • Mark OLESEN's avatar
      CONFIG: support explicit selection of 'ld' linker · 79993bba
      Mark OLESEN authored
      - 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
      79993bba
  4. Aug 21, 2023
    • Mark OLESEN's avatar
      CONFIG: enable use of stricter deprecation warnings · 77879685
      Mark OLESEN authored
      - 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.
      77879685
  5. Aug 18, 2023
    • Mark OLESEN's avatar
      CONFIG: enable xcrun with cc/c++ based on WM_COMPILE_CONTROL (#2965) · 224c3199
      Mark OLESEN authored
      - adding in +xcrun into WM_COMPILE_CONTROL changes the compiler
        settings as follows (for MacOS)
      
            cc         := xcrun cc
            CC         := xcrun c++ -std=c++14
      224c3199
    • Alexey Matveichev's avatar
      COMP: add rpath information to MacOS compilation rules (#2948) · e4f2efec
      Alexey Matveichev authored and Mark OLESEN's avatar Mark OLESEN committed
      - 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
      e4f2efec
  6. Jun 28, 2023
  7. Dec 23, 2022
  8. Dec 21, 2022
  9. Nov 15, 2022
    • Mark OLESEN's avatar
      ENH: support libz disabling via WM_COMPILE_CONTROL (as ~libz) · 9f7cfa94
      Mark OLESEN authored
      - 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=... ...
      9f7cfa94
  10. Sep 09, 2022
    • Mark OLESEN's avatar
      CONFIG: add support for WM_COMPILE_OPTION='Dbg' · 793f4e3a
      Mark OLESEN authored
      - 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
      793f4e3a
  11. Jun 24, 2022
  12. Jun 14, 2022
  13. Jun 02, 2022
  14. Apr 29, 2022
  15. Dec 20, 2021
  16. Nov 02, 2021
    • Mark OLESEN's avatar
      ENH: extend use of WM_COMPILER_CONTROL to manage compiler versions · 2698cab0
      Mark OLESEN authored
      - 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)
      2698cab0
  17. Oct 21, 2021
    • Mark OLESEN's avatar
      CONFIG: update c++ standard, some compiler rules (partially addresses #2209) · c2697f46
      Mark OLESEN authored
      - 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.
      c2697f46
  18. Jun 28, 2021
  19. Apr 23, 2021
    • Mark OLESEN's avatar
      CONFIG: adjust intel compiler and mpi settings (#2056) · d5498265
      Mark OLESEN authored
      - 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
      d5498265
  20. Dec 23, 2020
  21. Nov 11, 2020
    • Mark OLESEN's avatar
      CONFIG: rationalize mpi config tuning (#1910) · c91fc6f4
      Mark OLESEN authored
      - 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
      c91fc6f4
  22. Oct 28, 2020
    • Mark OLESEN's avatar
      ENH: support true/false, yes/no values for FOAM_ABORT (#1896) · 410d38b9
      Mark OLESEN authored
      - 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.
      410d38b9
  23. Sep 07, 2020
    • Mark OLESEN's avatar
      CONFIG: improve support for compiler/link options (#1830) · 9423d2bd
      Mark OLESEN authored
      - 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)
      9423d2bd
  24. Jun 30, 2020
  25. Jun 29, 2020
  26. Jun 08, 2020
    • Mark OLESEN's avatar
      ENH: support FOAM_MODULE_PREFIX to guide location of module builds (#1721) · 934d0bd7
      Mark OLESEN authored
      - 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
      934d0bd7
  27. May 06, 2020
  28. Apr 15, 2020
  29. Mar 16, 2020
    • Mark OLESEN's avatar
      CONFIG: improve prefix matching for system libraries (#1607) · fe17c8ad
      Mark OLESEN authored
      - 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.
      fe17c8ad
    • Mark OLESEN's avatar
      CONFIG: support FOAM_EXTRA_CXXFLAGS (#1256) · ac8b64df
      Mark OLESEN authored
      - allows custom tuning of compilation parameters
      ac8b64df
    • Mark OLESEN's avatar
      ENH: openfoam shell session - improved and relocated · ba3a31af
      Mark OLESEN authored
      - '-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.
      ba3a31af
  30. Feb 24, 2020
    • Mark OLESEN's avatar
      CONFIG: improve prefix matching for system libraries (#1607) · 5ba2cbc5
      Mark OLESEN authored
      - 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.
      5ba2cbc5
  31. Feb 20, 2020
  32. Feb 12, 2020
    • Mark OLESEN's avatar
      ENH: openfoam shell session - improved and relocated · f90de021
      Mark OLESEN authored
      - '-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.
      f90de021
  33. Dec 23, 2019