From 2db4b0867eac3ea74d32344002690ff631518af0 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Wed, 21 Mar 2018 11:50:57 +0100
Subject: [PATCH] CONFIG: consolidate C++ flags per compiler type

- easier to ensure that flags are consistent
---
 etc/bashrc                                    |   2 +-
 etc/bashrc.orig                               | 203 -----------
 etc/config.csh/compiler                       |   3 +
 etc/config.sh/compiler                        |   3 +
 etc/config.sh/settings.orig                   | 316 ------------------
 etc/cshrc                                     |   2 +-
 wmake/rules/General/Clang/c++                 |  19 ++
 .../{linux64Clang => General/Clang}/openmp    |   0
 wmake/rules/General/Gcc/c++                   |  17 +
 .../rules/{linux64Cray => General/Gcc}/openmp |   0
 wmake/rules/General/Icc/c++                   |  17 +
 .../rules/{linux64Icc => General/Icc}/openmp  |   0
 wmake/rules/linux64Clang/c                    |   4 +-
 wmake/rules/linux64Clang/c++                  |  15 +-
 wmake/rules/linux64Clang/general              |   2 +-
 wmake/rules/linux64Cray/c                     |   4 +-
 wmake/rules/linux64Cray/c++                   |   9 +-
 wmake/rules/linux64Cray/general               |   2 +-
 wmake/rules/linux64Gcc/c                      |   4 +-
 wmake/rules/linux64Gcc/c++                    |  13 +-
 wmake/rules/linux64Gcc/general                |   2 +-
 wmake/rules/linux64Gcc/openmp                 |   5 -
 wmake/rules/linux64GccKNL/c                   |   4 +-
 wmake/rules/linux64GccKNL/c++                 |  12 +-
 wmake/rules/linux64GccKNL/general             |   2 +-
 wmake/rules/linux64GccKNL/openmp              |   5 -
 wmake/rules/linux64Icc/c                      |   4 +-
 wmake/rules/linux64Icc/c++                    |  10 +-
 wmake/rules/linux64Icc/general                |   2 +-
 wmake/rules/linux64IccKNL/c                   |   4 +-
 wmake/rules/linux64IccKNL/c++                 |  18 +-
 wmake/rules/linux64IccKNL/openmp              |   5 -
 wmake/rules/linuxARM64Arm/c                   |   4 +-
 wmake/rules/linuxARM64Arm/c++                 |  15 +-
 wmake/rules/linuxARM64Arm/general             |   2 +-
 wmake/rules/linuxARM64Arm/openmp              |   8 -
 wmake/rules/linuxARM64Clang/c                 |   5 +-
 wmake/rules/linuxARM64Clang/c++               |  16 +-
 wmake/rules/linuxARM64Clang/general           |   2 +-
 wmake/rules/linuxARM64Clang/openmp            |   8 -
 wmake/rules/linuxARM64Gcc/c                   |   4 +-
 wmake/rules/linuxARM64Gcc/c++                 |  13 +-
 wmake/rules/linuxARM64Gcc/general             |   2 +-
 wmake/rules/linuxARM64Gcc/openmp              |   5 -
 wmake/rules/linuxARM7Gcc/c                    |   4 +-
 wmake/rules/linuxARM7Gcc/c++                  |  13 +-
 wmake/rules/linuxARM7Gcc/general              |   2 +-
 wmake/rules/linuxARM7Gcc/openmp               |   5 -
 wmake/rules/linuxClang/c                      |   4 +-
 wmake/rules/linuxClang/c++                    |  15 +-
 wmake/rules/linuxClang/general                |   2 +-
 wmake/rules/linuxClang/openmp                 |   8 -
 wmake/rules/linuxGcc/c                        |   4 +-
 wmake/rules/linuxGcc/c++                      |  13 +-
 wmake/rules/linuxGcc/general                  |   2 +-
 wmake/rules/linuxGcc/openmp                   |   5 -
 wmake/rules/linuxIA64Gcc/c                    |   4 +-
 wmake/rules/linuxIA64Gcc/c++                  |  13 +-
 wmake/rules/linuxIA64Gcc/general              |   2 +-
 wmake/rules/linuxIA64Gcc/openmp               |   5 -
 wmake/rules/linuxIA64Icc/c                    |   4 +-
 wmake/rules/linuxIA64Icc/c++                  |  10 +-
 wmake/rules/linuxIA64Icc/general              |   2 +-
 wmake/rules/linuxIA64Icc/openmp               |   5 -
 wmake/rules/linuxIcc/c                        |   4 +-
 wmake/rules/linuxIcc/c++                      |  10 +-
 wmake/rules/linuxIcc/general                  |   2 +-
 wmake/rules/linuxPPC64Gcc/c                   |   4 +-
 wmake/rules/linuxPPC64Gcc/c++                 |  13 +-
 wmake/rules/linuxPPC64Gcc/general             |   2 +-
 wmake/rules/linuxPPC64Gcc/openmp              |   5 -
 wmake/rules/linuxPPC64leGcc/c                 |   4 +-
 wmake/rules/linuxPPC64leGcc/c++               |  13 +-
 wmake/rules/linuxPPC64leGcc/general           |   2 +-
 wmake/rules/linuxPPC64leGcc/openmp            |   5 -
 wmake/rules/solaris64Gcc/c                    |   4 +-
 wmake/rules/solaris64Gcc/c++                  |  11 +-
 wmake/rules/solarisGcc/c                      |   4 +-
 wmake/rules/solarisGcc/c++                    |  11 +-
 79 files changed, 143 insertions(+), 865 deletions(-)
 delete mode 100644 etc/bashrc.orig
 delete mode 100644 etc/config.sh/settings.orig
 create mode 100644 wmake/rules/General/Clang/c++
 rename wmake/rules/{linux64Clang => General/Clang}/openmp (100%)
 create mode 100644 wmake/rules/General/Gcc/c++
 rename wmake/rules/{linux64Cray => General/Gcc}/openmp (100%)
 create mode 100644 wmake/rules/General/Icc/c++
 rename wmake/rules/{linux64Icc => General/Icc}/openmp (100%)
 delete mode 100644 wmake/rules/linux64Gcc/openmp
 delete mode 100644 wmake/rules/linux64GccKNL/openmp
 delete mode 100644 wmake/rules/linux64IccKNL/openmp
 delete mode 100644 wmake/rules/linuxARM64Arm/openmp
 delete mode 100644 wmake/rules/linuxARM64Clang/openmp
 delete mode 100644 wmake/rules/linuxARM64Gcc/openmp
 delete mode 100644 wmake/rules/linuxARM7Gcc/openmp
 delete mode 100644 wmake/rules/linuxClang/openmp
 delete mode 100644 wmake/rules/linuxGcc/openmp
 delete mode 100644 wmake/rules/linuxIA64Gcc/openmp
 delete mode 100644 wmake/rules/linuxIA64Icc/openmp
 delete mode 100644 wmake/rules/linuxPPC64Gcc/openmp
 delete mode 100644 wmake/rules/linuxPPC64leGcc/openmp

diff --git a/etc/bashrc b/etc/bashrc
index df02f948af5..65ee7c61f95 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -61,7 +61,7 @@ export WM_COMPILER_TYPE=system
 
 # [WM_COMPILER] - Compiler:
 # = Gcc | Gcc4[8-9] | Gcc5[1-5] | Gcc6[1-4] | Gcc7[1-3] | GccKNL |
-#   Clang | Clang3[8-9] | Clang[45]0 | Icc | IccKNL | Cray | Arm
+#   Clang | Clang3[8-9] | Clang[4-6]0 | Icc | IccKNL | Cray | Arm
 export WM_COMPILER=Gcc
 
 # [WM_ARCH_OPTION] - Memory addressing:
diff --git a/etc/bashrc.orig b/etc/bashrc.orig
deleted file mode 100644
index 4311e4781a0..00000000000
--- a/etc/bashrc.orig
+++ /dev/null
@@ -1,203 +0,0 @@
-#----------------------------------*-sh-*--------------------------------------
-# =========                 |
-# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-#  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-#    \\/     M anipulation  | Copyright (C) 2016-2017 OpenCFD Ltd.
-#------------------------------------------------------------------------------
-# License
-#     This file is part of OpenFOAM, licensed under GNU General Public License
-#     <http://www.gnu.org/licenses/>.
-#
-# File
-#     etc/bashrc
-#
-# Description
-#     Set OpenFOAM environment for POSIX shell (eg, bash,dash,zsh,...)
-#     Source manually or from the ~/.profile or ~/.bashrc files.
-#
-# Note
-#     Many environment variables can be overridden using a <prefs.sh> file
-#     from one of these locations:
-#     * user-specific:
-#         * ~/.OpenFOAM/$WM_PROJECT_VERSION
-#         * ~/.OpenFOAM
-#     * group-specific:
-#         * $WM_PROJECT_SITE/site/$WM_PROJECT_VERSION
-#         * $WM_PROJECT_SITE/site
-#     * general:
-#         * $WM_PROJECT_DIR/etc
-#
-#     Any changes made to this bashrc file may be lost with the next upgrade.
-#
-#------------------------------------------------------------------------------
-
-export WM_PROJECT=OpenFOAM
-export WM_PROJECT_VERSION=plus.develop
-
-# [FOAM_INST_DIR] - parent directory containing the OpenFOAM installation.
-# \- When this file is located as $WM_PROJECT_DIR/etc/bashrc, the next lines
-#    should work when sourced by BASH or ZSH shells. If this however fails,
-#    set one of the fallback values to an appropriate path.
-# --
-rc="${BASH_SOURCE:-${ZSH_NAME:+$0}}"
-[ -n "$rc" ] && FOAM_INST_DIR=$(\cd $(dirname $rc)/../.. && \pwd -L) || \
-FOAM_INST_DIR=$HOME/$WM_PROJECT
-# FOAM_INST_DIR=/opt/$WM_PROJECT
-# FOAM_INST_DIR=/usr/local/$WM_PROJECT
-#
-# END OF (NORMAL) USER EDITABLE PART
-################################################################################
-: # Extra safety - if the user commented out all fallback values
-export FOAM_INST_DIR
-unset rc
-
-# Default environment variables.
-# Can override with a <prefs.sh> file instead of editing below.
-
-# [WM_COMPILER_TYPE] - Compiler location:
-# = system | ThirdParty
-export WM_COMPILER_TYPE=system
-
-# [WM_COMPILER] - Compiler:
-# = Gcc | Gcc4[8-9] | Gcc5[1-5] | Gcc6[1-4] | Gcc7[1-3] | GccKNL |
-#   Clang | Clang3[8-9] | Clang[45]0 | Icc | IccKNL | Cray
-export WM_COMPILER=Gcc
-
-# [WM_ARCH_OPTION] - Memory addressing:
-# = 32 | 64
-#   * on a 64-bit OS this can be 32 or 64
-#   * on a 32-bit OS, it is always 32-bit and this option is ignored
-export WM_ARCH_OPTION=64
-
-# [WM_PRECISION_OPTION] - Floating-point precision:
-# = DP | SP
-export WM_PRECISION_OPTION=DP
-
-# [WM_LABEL_SIZE] - Label size in bits:
-# = 32 | 64
-export WM_LABEL_SIZE=32
-
-# [WM_COMPILE_OPTION] - Optimised, debug, profiling:
-# = Opt | Debug | Prof
-export WM_COMPILE_OPTION=Opt
-
-# [WM_MPLIB] - MPI implementation:
-# = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPI | MPICH | MPICH-GM |
-#   HPMPI | CRAY-MPICH | FJMPI | QSMPI | SGIMPI | INTELMPI | USERMPI
-export WM_MPLIB=SYSTEMOPENMPI
-
-
-# [FOAM_SIGFPE] - Trapping of floating-point exceptions.
-#               - overrides the 'trapFpe' controlDict entry
-# = true | false
-#export FOAM_SIGFPE=true
-
-# [FOAM_SETNAN] - Memory initialisation as NaN
-#               - overrides the 'setNaN' controlDict entry
-# = true | false
-#export FOAM_SETNAN=false
-
-# [WM_OSTYPE] - Operating System Type:
-# = POSIX
-#export WM_OSTYPE=POSIX
-
-################################################################################
-
-# Old directories to be cleaned from PATH, LD_LIBRARY_PATH
-foamOldDirs="$WM_PROJECT_DIR $WM_THIRD_PARTY_DIR \
-    $HOME/$WM_PROJECT/$USER $FOAM_USER_APPBIN $FOAM_USER_LIBBIN \
-    $WM_PROJECT_SITE $FOAM_SITE_APPBIN $FOAM_SITE_LIBBIN"
-
-# Location of installation and third-party software
-export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
-export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
-export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
-
-# [WM_PROJECT_SITE] - Location of site-specific (group) files
-# default (unset) implies WM_PROJECT_INST_DIR/site
-if [ -d "$WM_PROJECT_SITE" ]
-then
-    export WM_PROJECT_SITE
-else
-    unset WM_PROJECT_SITE
-fi
-
-# [WM_PROJECT_USER_DIR] - Location of user files
-export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
-
-# Load shell functions
-. $WM_PROJECT_DIR/etc/config.sh/functions
-
-# Override definitions via prefs, with 'other' first so the sys-admin
-# can provide base values independent of WM_PROJECT_SITE
-_foamEtc -mode=o  prefs.sh
-_foamEtc -mode=ug prefs.sh
-
-# Evaluate command-line parameters and record settings for later.
-# These can be used to set/unset values, specify additional files etc.
-export FOAM_SETTINGS="$@"
-_foamEval $@
-
-# Clean standard environment variables (PATH, MANPATH, LD_LIBRARY_PATH)
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-export PATH MANPATH LD_LIBRARY_PATH
-_foamClean PATH "$foamOldDirs"
-_foamClean MANPATH "$foamOldDirs"
-_foamClean LD_LIBRARY_PATH "$foamOldDirs"
-
-# Setup for OpenFOAM compilation etc
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-_foamEtc -config  settings
-
-# Setup for third-party packages
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-_foamEtc -config  mpi
-_foamEtc -config  paraview -- $@        # Pass through for evaluation
-_foamEtc -config  vtk
-_foamEtc -config  ensight
-_foamEtc -config  gperftools
-## _foamEtc -config  ADIOS
-_foamEtc -config  CGAL
-_foamEtc -config  scotch
-_foamEtc -config  FFTW
-
-# Interactive shell
-if /usr/bin/tty -s 2>/dev/null
-then
-    _foamEtc -config  aliases
-    [ "${BASH_VERSINFO:-0}" -ge 4 ] && _foamEtc -config  bash_completion
-fi
-
-
-# Clean environment paths again. Only remove duplicates
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-export PATH MANPATH LD_LIBRARY_PATH
-
-_foamClean PATH
-_foamClean MANPATH
-_foamClean LD_LIBRARY_PATH
-
-# Add trailing ':' for system manpages
-if [ -n "$MANPATH" ]
-then
-    MANPATH="${MANPATH}:"
-fi
-
-if [ -n "$LD_PRELOAD" ]
-then
-    export LD_PRELOAD
-    _foamClean LD_PRELOAD
-fi
-
-
-# Cleanup temporary information
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-# Unload shell functions
-. $WM_PROJECT_DIR/etc/config.sh/functions
-
-# Variables (done as the last statement for a clean exit code)
-unset cleaned foamOldDirs
-
-#------------------------------------------------------------------------------
diff --git a/etc/config.csh/compiler b/etc/config.csh/compiler
index 33641009744..ab3cbddc305 100644
--- a/etc/config.csh/compiler
+++ b/etc/config.csh/compiler
@@ -84,6 +84,9 @@ case ThirdParty:
     case Clang50:
         set clang_version=llvm-5.0.1
         breaksw
+    case Clang60:
+        set clang_version=llvm-6.0.0
+        breaksw
     default:
         /bin/cat << UNKNOWN_COMPILER
 ===============================================================================
diff --git a/etc/config.sh/compiler b/etc/config.sh/compiler
index a7a9df369c7..b3d6acccac6 100644
--- a/etc/config.sh/compiler
+++ b/etc/config.sh/compiler
@@ -83,6 +83,9 @@ ThirdParty)
     Clang50)
         clang_version=llvm-5.0.1
         ;;
+    Clang60)
+        clang_version=llvm-6.0.0
+        ;;
     *)
         /bin/cat << UNKNOWN_COMPILER 1>&2
 ===============================================================================
diff --git a/etc/config.sh/settings.orig b/etc/config.sh/settings.orig
deleted file mode 100644
index 73de9fa6811..00000000000
--- a/etc/config.sh/settings.orig
+++ /dev/null
@@ -1,316 +0,0 @@
-#----------------------------------*-sh-*--------------------------------------
-# =========                 |
-# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-#  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-#    \\/     M anipulation  | Copyright (C) 2016-2018 OpenCFD Ltd.
-#------------------------------------------------------------------------------
-# License
-#     This file is part of OpenFOAM, licensed under GNU General Public License
-#     <http://www.gnu.org/licenses/>.
-#
-# File
-#     etc/config.sh/settings
-#     - sourced by OpenFOAM-*/etc/bashrc
-#
-# Description
-#     Settings for OpenFOAM.
-#
-#------------------------------------------------------------------------------
-export WM_ARCH=$(uname -s)                  # System name
-: ${WM_OSTYPE:=POSIX}; export WM_OSTYPE     # System type (POSIX is default)
-
-# Default compiler = gcc/g++ and C++11
-export WM_CC="gcc"
-export WM_CXX="g++"
-export WM_CFLAGS="-fPIC"
-export WM_CXXFLAGS="-fPIC -std=c++11"
-unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH WM_LDFLAGS
-
-# Adjust according to system and architecture
-case "$WM_ARCH" in
-Linux)
-    WM_ARCH=linux
-
-    case $(uname -m) in
-    i686)
-        export WM_ARCH_OPTION=32
-        ;;
-
-    x86_64)
-        : ${WM_ARCH_OPTION:=64}; export WM_ARCH_OPTION  # Default to 64-bit
-        case "$WM_ARCH_OPTION" in
-        32)
-            export WM_COMPILER_ARCH=64
-            export WM_CFLAGS="$WM_CFLAGS -m32"
-            export WM_CXXFLAGS="$WM_CXXFLAGS -m32"
-            export WM_LDFLAGS="-m32"
-            ;;
-        64)
-            WM_ARCH=linux64
-            export WM_COMPILER_LIB_ARCH=64
-            export WM_CFLAGS="$WM_CFLAGS -m64"
-            export WM_CXXFLAGS="$WM_CXXFLAGS -m64"
-            export WM_LDFLAGS="-m64"
-            ;;
-        *)
-            echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32|64" 1>&2
-            ;;
-        esac
-        ;;
-
-    ia64)
-        WM_ARCH=linuxIA64
-        ;;
-
-    armv7l)
-        WM_ARCH=linuxARM7
-        export WM_ARCH_OPTION=32
-        export WM_COMPILER_LIB_ARCH=32
-        ;;
-
-    aarch64)
-        WM_ARCH=linuxARM64
-        export WM_ARCH_OPTION=64
-        export WM_COMPILER_LIB_ARCH=64
-        ;;
-
-    ppc64)
-        WM_ARCH=linuxPPC64
-        export WM_COMPILER_LIB_ARCH=64
-        export WM_CFLAGS="$WM_CFLAGS -m64"
-        export WM_CXXFLAGS="$WM_CXXFLAGS -m64"
-        export WM_LDFLAGS="-m64"
-        ;;
-
-    ppc64le)
-        WM_ARCH=linuxPPC64le
-        export WM_COMPILER_LIB_ARCH=64
-        export WM_CFLAGS="$WM_CFLAGS -m64"
-        export WM_CXXFLAGS="$WM_CXXFLAGS -m64"
-        export WM_LDFLAGS="-m64"
-        ;;
-
-    *)
-        echo Unknown processor type $(uname -m) for Linux 1>&2
-        ;;
-    esac
-    ;;
-
-SunOS)
-    WM_ARCH=SunOS64
-    WM_MPLIB=FJMPI
-    export WM_COMPILER_LIB_ARCH=64
-    export WM_CFLAGS="$WM_CFLAGS -mabi=64"
-    export WM_CXXFLAGS="$WM_CXXFLAGS -mabi=64"
-    export WM_LDFLAGS="-mabi=64 -G0"
-    ;;
-
-*)  # An unsupported operating system
-    /bin/cat << UNSUPPORTED_OS 1>&2
-===============================================================================
-Your '$WM_ARCH' operating system is unsupported by this OpenFOAM release.
-For further assistance, please contact www.OpenFOAM.com
-===============================================================================
-UNSUPPORTED_OS
-    ;;
-esac
-
-#------------------------------------------------------------------------------
-
-# [FOAM_JOB_DIR] - unset is equivalent to ~/.OpenFOAM/jobControl
-## export FOAM_JOB_DIR="$HOME/.OpenFOAM/jobControl"
-
-# wmake configuration
-export WM_DIR=$WM_PROJECT_DIR/wmake
-export WM_LINK_LANGUAGE=c++
-export WM_LABEL_OPTION=Int$WM_LABEL_SIZE
-export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION$WM_COMPILE_OPTION
-
-# Base executables/libraries
-export FOAM_APPBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/bin
-export FOAM_LIBBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib
-
-# External (ThirdParty) libraries
-export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib
-
-# Site-specific (group) files
-if [ -n "$WM_PROJECT_SITE" ]
-then
-    siteDir=$WM_PROJECT_SITE
-else
-    siteDir=$WM_PROJECT_INST_DIR/site
-fi
-
-# Shared site (group) executables/libraries
-export FOAM_SITE_APPBIN=$siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/bin
-export FOAM_SITE_LIBBIN=$siteDir/$WM_PROJECT_VERSION/platforms/$WM_OPTIONS/lib
-
-# User executables/libraries
-export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin
-export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
-
-# [FOAM_CODE_TEMPLATES] - dynamicCode templates
-# * fallback == "foamEtcFile -list codeTemplates/dynamicCode"
-# export FOAM_CODE_TEMPLATES=$WM_PROJECT_DIR/etc/codeTemplates/dynamicCode
-
-# Convenience
-export FOAM_ETC=$WM_PROJECT_DIR/etc
-export FOAM_APP=$WM_PROJECT_DIR/applications
-export FOAM_SRC=$WM_PROJECT_DIR/src
-export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials
-export FOAM_UTILITIES=$WM_PROJECT_DIR/applications/utilities
-export FOAM_SOLVERS=$WM_PROJECT_DIR/applications/solvers
-export FOAM_RUN=$WM_PROJECT_USER_DIR/run
-
-# Add wmake to the path - not required for runtime-only environment
-[ -d "$WM_DIR" ] && PATH=$WM_DIR:$PATH
-# Add OpenFOAM scripts to the path
-export PATH=$WM_PROJECT_DIR/bin:$PATH
-
-# Add site-specific scripts to path - only if they exist
-if [ -d "$siteDir/bin" ]                        # Generic
-then
-    _foamAddPath "$siteDir/bin"
-fi
-if [ -d "$siteDir/$WM_PROJECT_VERSION/bin" ]    # Version-specific
-then
-    _foamAddPath "$siteDir/$WM_PROJECT_VERSION/bin"
-fi
-unset siteDir
-
-_foamAddPath $FOAM_USER_APPBIN:$FOAM_SITE_APPBIN:$FOAM_APPBIN
-_foamAddLib  $FOAM_LIBBIN/dummy     # Dummy versions of external libraries last
-if [ -n "$FOAM_EXT_LIBBIN" ]        # External libraries (allowed to be unset)
-then
-    _foamAddLib $FOAM_EXT_LIBBIN
-fi
-_foamAddLib  $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN
-
-#------------------------------------------------------------------------------
-
-# Compiler settings
-# ~~~~~~~~~~~~~~~~~
-
-# Default to system compiler
-: ${WM_COMPILER_TYPE:=system}; export WM_COMPILER_TYPE
-
-# Adjust for non-gcc compilers
-case "$WM_COMPILER" in
-Clang*)    # Clang compiler suite
-    export WM_CC='clang'
-    export WM_CXX='clang++'
-    ;;
-Cray*)     # Cray system compilers
-    export WM_CC='cc'
-    export WM_CXX='CC'
-    ;;
-Icc*)      # Intel compilers
-    export WM_CC='icc'
-    export WM_CXX='icpc'
-    ;;
-esac
-
-# Clear prior to sourcing
-unset gcc_version gmp_version mpfr_version mpc_version
-unset GMP_ARCH_PATH MPFR_ARCH_PATH
-
-# Load pre-defined compiler versions
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-_foamEtc -config compiler
-
-# ThirdParty base for compilers
-archDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
-
-case "$WM_COMPILER_TYPE-$WM_COMPILER" in
-ThirdParty-Gcc*)
-    gccDir=$archDir/$gcc_version
-    gmpDir=$archDir/${gmp_version:-gmp-system}
-    mpfrDir=$archDir/${mpfr_version:-mpfr-system}
-    mpcDir=$archDir/${mpc_version:-mpc-system}
-
-    # Check that the compiler directory can be found
-    [ -d "$gccDir" ] || /bin/cat << GCC_NOT_FOUND 1>&2
-===============================================================================
-Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
-Cannot find '$WM_COMPILER' compiler installation
-    $gccDir
-
-    Either install this compiler version, or use the system compiler by setting
-    WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/bashrc.
-===============================================================================
-GCC_NOT_FOUND
-
-    _foamAddMan     $gccDir/man
-    _foamAddPath    $gccDir/bin
-
-    # Add ThirdParty compiler libraries to run-time environment
-    _foamAddLib     $gccDir/lib$WM_COMPILER_LIB_ARCH
-
-    # Add gmp/mpfr/mpc libraries to run-time environment.
-    # Require that they exist, automatically find lib64/ or lib/.
-    _foamAddLibAuto $gmpDir   && \
-        export GMP_ARCH_PATH=$gmpDir    # For non-system CGAL
-
-    _foamAddLibAuto $mpfrDir && \
-        export MPFR_ARCH_PATH=$mpfrDir  # For non-system CGAL
-
-    _foamAddLibAuto $mpcDir
-
-    if [ "$FOAM_VERBOSE" -a "$PS1" ]
-    then
-        echo "Using ThirdParty compiler"
-        echo "    ${gccDir##*/}  (${gmpDir##*/}  $${mpfrDir##*/}  ${mpcDir##*/})"
-    fi
-    ;;
-
-ThirdParty-Clang*)
-    clangDir=$archDir/$clang_version
-
-    # Check that the compiler directory can be found
-    [ -d "$clangDir" ] || /bin/cat << CLANG_NOT_FOUND 1>&2
-===============================================================================
-Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
-Cannot find '$WM_COMPILER' compiler installation
-    $clangDir
-
-    Either install this compiler version, or use the system compiler by setting
-    WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/bashrc.
-===============================================================================
-CLANG_NOT_FOUND
-
-    _foamAddMan     $clangDir/share/man
-    _foamAddPath    $clangDir/bin
-    _foamAddLib     $clangDir/lib  # For things like libomp (openmp) etc
-
-    if [ "$FOAM_VERBOSE" -a "$PS1" ]
-    then
-        echo "Using ThirdParty compiler"
-        echo "    ${clangDir##*/}"
-    fi
-    ;;
-
-system-* | ThirdParty-*)
-    # Using system compiler or other ThirdParty compiler
-    ;;
-
-*)
-    /bin/cat << UNKNOWN_TYPE 1>&2
-===============================================================================
-Unknown WM_COMPILER_TYPE="$WM_COMPILER_TYPE" - treating as 'system'
-Please check your settings
-===============================================================================
-UNKNOWN_TYPE
-    export WM_COMPILER_TYPE=system
-    ;;
-
-esac
-
-# Cleanup
-# ~~~~~~~
-unset archDir
-unset gcc_version gccDir
-unset gmp_version gmpDir  mpfr_version mpfrDir  mpc_version mpcDir
-unset clang_version clangDir
-
-#------------------------------------------------------------------------------
diff --git a/etc/cshrc b/etc/cshrc
index a6d0c2a1d16..16468edf04f 100644
--- a/etc/cshrc
+++ b/etc/cshrc
@@ -58,7 +58,7 @@ setenv WM_COMPILER_TYPE system
 
 # [WM_COMPILER] - Compiler:
 # = Gcc | Gcc4[8-9] | Gcc5[1-5] | Gcc6[1-4] | Gcc7[1-3] | GccKNL |
-#   Clang | Clang3[8-9] | Clang[45]0 | Icc | IccKNL | Cray | Arm
+#   Clang | Clang3[8-9] | Clang[4-6]0 | Icc | IccKNL | Cray | Arm
 setenv WM_COMPILER Gcc
 
 # [WM_ARCH_OPTION] - Memory addressing:
diff --git a/wmake/rules/General/Clang/c++ b/wmake/rules/General/Clang/c++
new file mode 100644
index 00000000000..439d4568f9a
--- /dev/null
+++ b/wmake/rules/General/Clang/c++
@@ -0,0 +1,19 @@
+SUFFIXES += .C .cc .cpp .cxx
+
+CC          = clang++ -std=c++11
+
+ptFLAGS     = -DNoRepository -ftemplate-depth-100
+
+# - Standard warnings
+# - Less restrictive warnings (may be needed for flex++, CGAL, etc.)
+
+c++WARN     = \
+    -Wall -Wextra -Wold-style-cast \
+    -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \
+    -Wno-undefined-var-template \
+    -Wno-unknown-warning-option
+
+c++LESSWARN = \
+    -Wno-old-style-cast -Wno-unused-local-typedefs \
+    -Wno-tautological-undefined-compare -Wno-shift-negative-value \
+    -Wno-null-pointer-arithmetic
diff --git a/wmake/rules/linux64Clang/openmp b/wmake/rules/General/Clang/openmp
similarity index 100%
rename from wmake/rules/linux64Clang/openmp
rename to wmake/rules/General/Clang/openmp
diff --git a/wmake/rules/General/Gcc/c++ b/wmake/rules/General/Gcc/c++
new file mode 100644
index 00000000000..c71ca116875
--- /dev/null
+++ b/wmake/rules/General/Gcc/c++
@@ -0,0 +1,17 @@
+SUFFIXES += .C .cc .cpp .cxx
+
+CC          = g++ -std=c++11
+
+ptFLAGS     = -DNoRepository -ftemplate-depth-100
+
+# - Standard warnings
+# - Less restrictive warnings (may be needed for flex++, CGAL, etc.)
+
+c++WARN     = \
+    -Wall -Wextra -Wold-style-cast \
+    -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \
+    -Wno-attributes -Wno-unknown-pragmas
+
+c++LESSWARN = \
+    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
+    -fpermissive
diff --git a/wmake/rules/linux64Cray/openmp b/wmake/rules/General/Gcc/openmp
similarity index 100%
rename from wmake/rules/linux64Cray/openmp
rename to wmake/rules/General/Gcc/openmp
diff --git a/wmake/rules/General/Icc/c++ b/wmake/rules/General/Icc/c++
new file mode 100644
index 00000000000..f42e81c2cef
--- /dev/null
+++ b/wmake/rules/General/Icc/c++
@@ -0,0 +1,17 @@
+SUFFIXES += .C .cc .cpp .cxx
+
+CC          = icpc -std=c++11
+
+ptFLAGS     = -DNoRepository
+
+# - Standard warnings
+# - Less restrictive warnings (may be needed for flex++, CGAL, etc.).
+
+c++WARN     = \
+    -Wall -Wextra \
+    -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \
+    -Wno-unknown-pragmas \
+    -diag-disable 327,654,1125,1292,2289,2304,11062,11074,11076
+
+c++LESSWARN = \
+    -diag-disable 1224,2026,2305
diff --git a/wmake/rules/linux64Icc/openmp b/wmake/rules/General/Icc/openmp
similarity index 100%
rename from wmake/rules/linux64Icc/openmp
rename to wmake/rules/General/Icc/openmp
diff --git a/wmake/rules/linux64Clang/c b/wmake/rules/linux64Clang/c
index 36f40bc3640..74f30f24566 100644
--- a/wmake/rules/linux64Clang/c
+++ b/wmake/rules/linux64Clang/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = clang -m64
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linux64Clang/c++ b/wmake/rules/linux64Clang/c++
index 48c4f1124dc..e9ff2ac04da 100644
--- a/wmake/rules/linux64Clang/c++
+++ b/wmake/rules/linux64Clang/c++
@@ -1,22 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = \
-    -Wall -Wextra -Wold-style-cast \
-    -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \
-    -Wno-undefined-var-template \
-    -Wno-unknown-warning-option
-
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs \
-    -Wno-tautological-undefined-compare -Wno-shift-negative-value
+include $(GENERAL_RULES)/Clang/c++
 
 CC          = clang++ -std=c++11 -m64
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linux64Clang/general b/wmake/rules/linux64Clang/general
index d83a18b000b..9ada28972dd 100644
--- a/wmake/rules/linux64Clang/general
+++ b/wmake/rules/linux64Clang/general
@@ -3,7 +3,7 @@ CPP        = cpp -traditional-cpp $(GFLAGS)
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Clang/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linux64Cray/c b/wmake/rules/linux64Cray/c
index a3e304ed804..d0937d43b88 100644
--- a/wmake/rules/linux64Cray/c
+++ b/wmake/rules/linux64Cray/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = cc -m64
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linux64Cray/c++ b/wmake/rules/linux64Cray/c++
index 30c2bc762e2..acac32e84f7 100644
--- a/wmake/rules/linux64Cray/c++
+++ b/wmake/rules/linux64Cray/c++
@@ -1,16 +1,9 @@
-SUFFIXES += .C
-
-c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof
-
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds
+include $(GENERAL_RULES)/Gcc/c++
 
 CC          = CC -std=c++11 -m64
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linux64Cray/general b/wmake/rules/linux64Cray/general
index a0c807e5d8a..f8a6558ce7c 100644
--- a/wmake/rules/linux64Cray/general
+++ b/wmake/rules/linux64Cray/general
@@ -3,7 +3,7 @@ CPP        = cpp -traditional-cpp $(GFLAGS)
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+# include $(GENERAL_RULES)/Gcc/openmp
 
-# include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linux64Gcc/c b/wmake/rules/linux64Gcc/c
index 56b9e8ff72a..99886ffc020 100644
--- a/wmake/rules/linux64Gcc/c
+++ b/wmake/rules/linux64Gcc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = gcc -m64
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linux64Gcc/c++ b/wmake/rules/linux64Gcc/c++
index b8b0925474b..22c4d47b0be 100644
--- a/wmake/rules/linux64Gcc/c++
+++ b/wmake/rules/linux64Gcc/c++
@@ -1,20 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
-              -Wno-invalid-offsetof -Wno-attributes \
-              -Wno-unknown-pragmas
-
-# Suppress some warnings (flex++, CGAL, etc)
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
-    -fpermissive
+include $(GENERAL_RULES)/Gcc/c++
 
 CC          = g++ -std=c++11 -m64
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linux64Gcc/general b/wmake/rules/linux64Gcc/general
index d83a18b000b..e510b17575c 100644
--- a/wmake/rules/linux64Gcc/general
+++ b/wmake/rules/linux64Gcc/general
@@ -3,7 +3,7 @@ CPP        = cpp -traditional-cpp $(GFLAGS)
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Gcc/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linux64Gcc/openmp b/wmake/rules/linux64Gcc/openmp
deleted file mode 100644
index cd007d15291..00000000000
--- a/wmake/rules/linux64Gcc/openmp
+++ /dev/null
@@ -1,5 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-
-COMP_OPENMP = -DUSE_OMP -fopenmp
-LINK_OPENMP = -lgomp
diff --git a/wmake/rules/linux64GccKNL/c b/wmake/rules/linux64GccKNL/c
index db0bbc58f91..2650cf56496 100644
--- a/wmake/rules/linux64GccKNL/c
+++ b/wmake/rules/linux64GccKNL/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = gcc -m64 -march=knl
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linux64GccKNL/c++ b/wmake/rules/linux64GccKNL/c++
index 426e87709a2..f0f435482cc 100644
--- a/wmake/rules/linux64GccKNL/c++
+++ b/wmake/rules/linux64GccKNL/c++
@@ -1,19 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
-              -Wno-invalid-offsetof -Wno-attributes
-
-# Suppress some warnings (flex++, CGAL, etc)
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
-    -fpermissive
+include $(GENERAL_RULES)/Gcc/c++
 
 CC          = g++ -std=c++11 -m64 -march=knl
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linux64GccKNL/general b/wmake/rules/linux64GccKNL/general
index d83a18b000b..e510b17575c 100644
--- a/wmake/rules/linux64GccKNL/general
+++ b/wmake/rules/linux64GccKNL/general
@@ -3,7 +3,7 @@ CPP        = cpp -traditional-cpp $(GFLAGS)
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Gcc/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linux64GccKNL/openmp b/wmake/rules/linux64GccKNL/openmp
deleted file mode 100644
index cd007d15291..00000000000
--- a/wmake/rules/linux64GccKNL/openmp
+++ /dev/null
@@ -1,5 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-
-COMP_OPENMP = -DUSE_OMP -fopenmp
-LINK_OPENMP = -lgomp
diff --git a/wmake/rules/linux64Icc/c b/wmake/rules/linux64Icc/c
index c405b37e24e..920341c2fbf 100644
--- a/wmake/rules/linux64Icc/c
+++ b/wmake/rules/linux64Icc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       =
-
 cc          = icc
 
+cWARN       =
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linux64Icc/c++ b/wmake/rules/linux64Icc/c++
index e40c3313423..b7837055435 100644
--- a/wmake/rules/linux64Icc/c++
+++ b/wmake/rules/linux64Icc/c++
@@ -1,17 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-unknown-pragmas \
-              -diag-disable 327,654,1125,1292,2289,2304,11062,11074,11076
-
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -diag-disable 1224,2026,2305
+include $(GENERAL_RULES)/Icc/c++
 
 CC          = icpc -std=c++11 -fp-trap=common -fp-model precise
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linux64Icc/general b/wmake/rules/linux64Icc/general
index eb3898f709e..0d41c462f2b 100644
--- a/wmake/rules/linux64Icc/general
+++ b/wmake/rules/linux64Icc/general
@@ -3,7 +3,7 @@ CPP        = /lib/cpp -traditional-cpp $(GFLAGS)
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Icc/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linux64IccKNL/c b/wmake/rules/linux64IccKNL/c
index c405b37e24e..920341c2fbf 100644
--- a/wmake/rules/linux64IccKNL/c
+++ b/wmake/rules/linux64IccKNL/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       =
-
 cc          = icc
 
+cWARN       =
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linux64IccKNL/c++ b/wmake/rules/linux64IccKNL/c++
index 4196ede55e6..0c85ccf8e94 100644
--- a/wmake/rules/linux64IccKNL/c++
+++ b/wmake/rules/linux64IccKNL/c++
@@ -1,17 +1,19 @@
-SUFFIXES += .C .cc .cpp .cxx
+include $(GENERAL_RULES)/Icc/c++
 
-c++WARN     = -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-unknown-pragmas \
-              -diag-disable 654,1125,1292,2304
+CC          = icpc -std=c++11 -xmic-avx512 -fp-trap=common -fp-model precise -fp-speculation=safe
 
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -diag-disable 1224,2026,2305
+# Verify if -diag-disable should really be different that the general version
+# or was previously simply not kept updated (MAR-2018)
 
-CC          = icpc -std=c++11 -xmic-avx512 -fp-trap=common -fp-model precise -fp-speculation=safe
+c++WARN     = \
+    -Wall -Wextra \
+    -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \
+    -Wno-unknown-pragmas \
+    -diag-disable 654,1125,1292,2304
+#
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linux64IccKNL/openmp b/wmake/rules/linux64IccKNL/openmp
deleted file mode 100644
index 738673ca91c..00000000000
--- a/wmake/rules/linux64IccKNL/openmp
+++ /dev/null
@@ -1,5 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-
-COMP_OPENMP = -DUSE_OMP -qopenmp
-LINK_OPENMP = -liomp5
diff --git a/wmake/rules/linuxARM64Arm/c b/wmake/rules/linuxARM64Arm/c
index caf379353ce..91a1e739afd 100644
--- a/wmake/rules/linuxARM64Arm/c
+++ b/wmake/rules/linuxARM64Arm/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = armclang
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linuxARM64Arm/c++ b/wmake/rules/linuxARM64Arm/c++
index bd08dccd618..5704e839a9b 100644
--- a/wmake/rules/linuxARM64Arm/c++
+++ b/wmake/rules/linuxARM64Arm/c++
@@ -1,22 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = \
-    -Wall -Wextra -Wold-style-cast \
-    -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \
-    -Wno-undefined-var-template \
-    -Wno-unknown-warning-option
-
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs \
-    -Wno-tautological-undefined-compare -Wno-shift-negative-value
+include $(GENERAL_RULES)/Clang/c++
 
 CC          = armclang++ -std=c++11
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linuxARM64Arm/general b/wmake/rules/linuxARM64Arm/general
index d83a18b000b..9ada28972dd 100644
--- a/wmake/rules/linuxARM64Arm/general
+++ b/wmake/rules/linuxARM64Arm/general
@@ -3,7 +3,7 @@ CPP        = cpp -traditional-cpp $(GFLAGS)
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Clang/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linuxARM64Arm/openmp b/wmake/rules/linuxARM64Arm/openmp
deleted file mode 100644
index 070a2c5d3ad..00000000000
--- a/wmake/rules/linuxARM64Arm/openmp
+++ /dev/null
@@ -1,8 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-# -
-# Clang provides 'omp' and a link for 'gomp'.
-# With 'gomp' we can use system libs.
-
-COMP_OPENMP = -DUSE_OMP -fopenmp
-LINK_OPENMP = -lgomp
diff --git a/wmake/rules/linuxARM64Clang/c b/wmake/rules/linuxARM64Clang/c
index 7a1e43e3779..7e05a427c8c 100644
--- a/wmake/rules/linuxARM64Clang/c
+++ b/wmake/rules/linuxARM64Clang/c
@@ -1,10 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
-## cc          = clang -m64
 cc          = clang
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linuxARM64Clang/c++ b/wmake/rules/linuxARM64Clang/c++
index caa4e7ee05c..2e9bce109a8 100644
--- a/wmake/rules/linuxARM64Clang/c++
+++ b/wmake/rules/linuxARM64Clang/c++
@@ -1,23 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
+include $(GENERAL_RULES)/Clang/c++
 
-c++WARN     = \
-    -Wall -Wextra -Wold-style-cast \
-    -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \
-    -Wno-undefined-var-template \
-    -Wno-unknown-warning-option
-
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs \
-    -Wno-tautological-undefined-compare -Wno-shift-negative-value
-
-## CC          = clang++ -std=c++11 -m64
 CC          = clang++ -std=c++11
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linuxARM64Clang/general b/wmake/rules/linuxARM64Clang/general
index d83a18b000b..9ada28972dd 100644
--- a/wmake/rules/linuxARM64Clang/general
+++ b/wmake/rules/linuxARM64Clang/general
@@ -3,7 +3,7 @@ CPP        = cpp -traditional-cpp $(GFLAGS)
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Clang/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linuxARM64Clang/openmp b/wmake/rules/linuxARM64Clang/openmp
deleted file mode 100644
index 070a2c5d3ad..00000000000
--- a/wmake/rules/linuxARM64Clang/openmp
+++ /dev/null
@@ -1,8 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-# -
-# Clang provides 'omp' and a link for 'gomp'.
-# With 'gomp' we can use system libs.
-
-COMP_OPENMP = -DUSE_OMP -fopenmp
-LINK_OPENMP = -lgomp
diff --git a/wmake/rules/linuxARM64Gcc/c b/wmake/rules/linuxARM64Gcc/c
index 3ee7538cbb1..6845d94483a 100644
--- a/wmake/rules/linuxARM64Gcc/c
+++ b/wmake/rules/linuxARM64Gcc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = gcc
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linuxARM64Gcc/c++ b/wmake/rules/linuxARM64Gcc/c++
index f82fe199bb2..00a88b07a16 100644
--- a/wmake/rules/linuxARM64Gcc/c++
+++ b/wmake/rules/linuxARM64Gcc/c++
@@ -1,20 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
-              -Wno-invalid-offsetof -Wno-attributes \
-              -Wno-unknown-pragmas
-
-# Suppress some warnings (flex++, CGAL, etc)
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
-    -fpermissive
+include $(GENERAL_RULES)/Gcc/c++
 
 CC          = g++ -std=c++11
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linuxARM64Gcc/general b/wmake/rules/linuxARM64Gcc/general
index 86f567e61d8..fad7e3b14df 100644
--- a/wmake/rules/linuxARM64Gcc/general
+++ b/wmake/rules/linuxARM64Gcc/general
@@ -4,7 +4,7 @@ LD          = ld
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Gcc/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linuxARM64Gcc/openmp b/wmake/rules/linuxARM64Gcc/openmp
deleted file mode 100644
index cd007d15291..00000000000
--- a/wmake/rules/linuxARM64Gcc/openmp
+++ /dev/null
@@ -1,5 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-
-COMP_OPENMP = -DUSE_OMP -fopenmp
-LINK_OPENMP = -lgomp
diff --git a/wmake/rules/linuxARM7Gcc/c b/wmake/rules/linuxARM7Gcc/c
index 3ee7538cbb1..6845d94483a 100644
--- a/wmake/rules/linuxARM7Gcc/c
+++ b/wmake/rules/linuxARM7Gcc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = gcc
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linuxARM7Gcc/c++ b/wmake/rules/linuxARM7Gcc/c++
index f82fe199bb2..00a88b07a16 100644
--- a/wmake/rules/linuxARM7Gcc/c++
+++ b/wmake/rules/linuxARM7Gcc/c++
@@ -1,20 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
-              -Wno-invalid-offsetof -Wno-attributes \
-              -Wno-unknown-pragmas
-
-# Suppress some warnings (flex++, CGAL, etc)
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
-    -fpermissive
+include $(GENERAL_RULES)/Gcc/c++
 
 CC          = g++ -std=c++11
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linuxARM7Gcc/general b/wmake/rules/linuxARM7Gcc/general
index 4fc50267edb..c56a7353ca5 100644
--- a/wmake/rules/linuxARM7Gcc/general
+++ b/wmake/rules/linuxARM7Gcc/general
@@ -4,7 +4,7 @@ LD         = ld
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Gcc/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linuxARM7Gcc/openmp b/wmake/rules/linuxARM7Gcc/openmp
deleted file mode 100644
index cd007d15291..00000000000
--- a/wmake/rules/linuxARM7Gcc/openmp
+++ /dev/null
@@ -1,5 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-
-COMP_OPENMP = -DUSE_OMP -fopenmp
-LINK_OPENMP = -lgomp
diff --git a/wmake/rules/linuxClang/c b/wmake/rules/linuxClang/c
index 59cf476f0ee..7cc1b56a060 100644
--- a/wmake/rules/linuxClang/c
+++ b/wmake/rules/linuxClang/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = clang -m32
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linuxClang/c++ b/wmake/rules/linuxClang/c++
index 8100f860a48..f5e87a0c17a 100644
--- a/wmake/rules/linuxClang/c++
+++ b/wmake/rules/linuxClang/c++
@@ -1,22 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = \
-    -Wall -Wextra -Wold-style-cast \
-    -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof \
-    -Wno-undefined-var-template \
-    -Wno-unknown-warning-option
-
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs \
-    -Wno-tautological-undefined-compare -Wno-shift-negative-value
+include $(GENERAL_RULES)/Clang/c++
 
 CC          = clang++ -std=c++11 -m32
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linuxClang/general b/wmake/rules/linuxClang/general
index eae23e305bd..04529b376a0 100644
--- a/wmake/rules/linuxClang/general
+++ b/wmake/rules/linuxClang/general
@@ -4,7 +4,7 @@ LD         = ld -melf_i386
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Clang/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linuxClang/openmp b/wmake/rules/linuxClang/openmp
deleted file mode 100644
index 070a2c5d3ad..00000000000
--- a/wmake/rules/linuxClang/openmp
+++ /dev/null
@@ -1,8 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-# -
-# Clang provides 'omp' and a link for 'gomp'.
-# With 'gomp' we can use system libs.
-
-COMP_OPENMP = -DUSE_OMP -fopenmp
-LINK_OPENMP = -lgomp
diff --git a/wmake/rules/linuxGcc/c b/wmake/rules/linuxGcc/c
index 5450517cee4..71dc037e4df 100644
--- a/wmake/rules/linuxGcc/c
+++ b/wmake/rules/linuxGcc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = gcc -m32
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linuxGcc/c++ b/wmake/rules/linuxGcc/c++
index c6cb38c1bed..4566aa9bda5 100644
--- a/wmake/rules/linuxGcc/c++
+++ b/wmake/rules/linuxGcc/c++
@@ -1,20 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
-              -Wno-invalid-offsetof -Wno-attributes \
-              -Wno-unknown-pragmas
-
-# Suppress some warnings (flex++, CGAL, etc)
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
-    -fpermissive
+include $(GENERAL_RULES)/Gcc/c++
 
 CC          = g++ -std=c++11 -m32
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linuxGcc/general b/wmake/rules/linuxGcc/general
index eae23e305bd..f52d4b26a9d 100644
--- a/wmake/rules/linuxGcc/general
+++ b/wmake/rules/linuxGcc/general
@@ -4,7 +4,7 @@ LD         = ld -melf_i386
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Gcc/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linuxGcc/openmp b/wmake/rules/linuxGcc/openmp
deleted file mode 100644
index cd007d15291..00000000000
--- a/wmake/rules/linuxGcc/openmp
+++ /dev/null
@@ -1,5 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-
-COMP_OPENMP = -DUSE_OMP -fopenmp
-LINK_OPENMP = -lgomp
diff --git a/wmake/rules/linuxIA64Gcc/c b/wmake/rules/linuxIA64Gcc/c
index 3ee7538cbb1..6845d94483a 100644
--- a/wmake/rules/linuxIA64Gcc/c
+++ b/wmake/rules/linuxIA64Gcc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = gcc
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linuxIA64Gcc/c++ b/wmake/rules/linuxIA64Gcc/c++
index 37b0b6b1d3a..68329d01a37 100644
--- a/wmake/rules/linuxIA64Gcc/c++
+++ b/wmake/rules/linuxIA64Gcc/c++
@@ -1,20 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
-              -Wno-invalid-offsetof -Wno-attributes \
-              -Wno-unknown-pragmas
-
-# Suppress some warnings (flex++, CGAL, etc)
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
-    -fpermissive
+include $(GENERAL_RULES)/Gcc/c++
 
 CC          = g++ -std=c++11
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linuxIA64Gcc/general b/wmake/rules/linuxIA64Gcc/general
index d8fb470836e..3c8d2d7f619 100644
--- a/wmake/rules/linuxIA64Gcc/general
+++ b/wmake/rules/linuxIA64Gcc/general
@@ -3,8 +3,8 @@ CPP        = cpp -traditional-cpp $(GFLAGS)
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Gcc/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/X
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linuxIA64Gcc/openmp b/wmake/rules/linuxIA64Gcc/openmp
deleted file mode 100644
index cd007d15291..00000000000
--- a/wmake/rules/linuxIA64Gcc/openmp
+++ /dev/null
@@ -1,5 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-
-COMP_OPENMP = -DUSE_OMP -fopenmp
-LINK_OPENMP = -lgomp
diff --git a/wmake/rules/linuxIA64Icc/c b/wmake/rules/linuxIA64Icc/c
index 2d8cda59108..a53630671c2 100644
--- a/wmake/rules/linuxIA64Icc/c
+++ b/wmake/rules/linuxIA64Icc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       =
-
 cc          = icc
 
+cWARN       =
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linuxIA64Icc/c++ b/wmake/rules/linuxIA64Icc/c++
index cf9d7524d23..8fce549e21d 100644
--- a/wmake/rules/linuxIA64Icc/c++
+++ b/wmake/rules/linuxIA64Icc/c++
@@ -1,17 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-unknown-pragmas \
-              -diag-disable 2304,1292
-
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -diag-disable 1224,2026,2305
+include $(GENERAL_RULES)/Icc/c++
 
 CC          = icpc -std=c++11
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linuxIA64Icc/general b/wmake/rules/linuxIA64Icc/general
index c3269860fb8..eee8f6f6948 100644
--- a/wmake/rules/linuxIA64Icc/general
+++ b/wmake/rules/linuxIA64Icc/general
@@ -3,8 +3,8 @@ CPP        = /lib/cpp -traditional-cpp $(GFLAGS) -DICC_IA64_PREFETCH
 GLIBS      =
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Icc/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/X
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linuxIA64Icc/openmp b/wmake/rules/linuxIA64Icc/openmp
deleted file mode 100644
index 738673ca91c..00000000000
--- a/wmake/rules/linuxIA64Icc/openmp
+++ /dev/null
@@ -1,5 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-
-COMP_OPENMP = -DUSE_OMP -qopenmp
-LINK_OPENMP = -liomp5
diff --git a/wmake/rules/linuxIcc/c b/wmake/rules/linuxIcc/c
index e3c578ae159..b6fe8d4687b 100644
--- a/wmake/rules/linuxIcc/c
+++ b/wmake/rules/linuxIcc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       =
-
 cc          = icc -gcc-version=400
 
+cWARN       =
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -KPIC
diff --git a/wmake/rules/linuxIcc/c++ b/wmake/rules/linuxIcc/c++
index 1cbe27f9efc..3cab0fd07a2 100644
--- a/wmake/rules/linuxIcc/c++
+++ b/wmake/rules/linuxIcc/c++
@@ -1,17 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-unknown-pragmas \
-              -diag-disable 327,654,1125,1292,2289,2304,11062,11074,11076
-
-# Suppress some warnings for flex++ and CGAL
-c++LESSWARN = -diag-disable 1224,2026,2305
+include $(GENERAL_RULES)/Icc/c++
 
 CC          = icpc -std=c++11 -fp-trap=common -fp-model precise
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -KPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linuxIcc/general b/wmake/rules/linuxIcc/general
index 85f5be51c09..615ceefae22 100644
--- a/wmake/rules/linuxIcc/general
+++ b/wmake/rules/linuxIcc/general
@@ -4,7 +4,7 @@ LD         = ld -melf_i386
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Icc/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linuxPPC64Gcc/c b/wmake/rules/linuxPPC64Gcc/c
index dce6cc7466d..12f9165e04c 100644
--- a/wmake/rules/linuxPPC64Gcc/c
+++ b/wmake/rules/linuxPPC64Gcc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = gcc -m64 -mcpu=power5+
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linuxPPC64Gcc/c++ b/wmake/rules/linuxPPC64Gcc/c++
index e3f3d399869..161b9ff1967 100644
--- a/wmake/rules/linuxPPC64Gcc/c++
+++ b/wmake/rules/linuxPPC64Gcc/c++
@@ -1,20 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
-              -Wno-invalid-offsetof -Wno-attributes \
-              -Wno-unknown-pragmas
-
-# Suppress some warnings (flex++, CGAL, etc)
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
-    -fpermissive
+include $(GENERAL_RULES)/Gcc/c++
 
 CC          = g++ -std=c++11 -m64 -mcpu=power5+
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linuxPPC64Gcc/general b/wmake/rules/linuxPPC64Gcc/general
index 712516c2681..6648c166215 100644
--- a/wmake/rules/linuxPPC64Gcc/general
+++ b/wmake/rules/linuxPPC64Gcc/general
@@ -4,8 +4,8 @@ LD         = ld -m elf64ppc
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Gcc/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/X
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linuxPPC64Gcc/openmp b/wmake/rules/linuxPPC64Gcc/openmp
deleted file mode 100644
index cd007d15291..00000000000
--- a/wmake/rules/linuxPPC64Gcc/openmp
+++ /dev/null
@@ -1,5 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-
-COMP_OPENMP = -DUSE_OMP -fopenmp
-LINK_OPENMP = -lgomp
diff --git a/wmake/rules/linuxPPC64leGcc/c b/wmake/rules/linuxPPC64leGcc/c
index ec88f476277..b486b3ade5c 100644
--- a/wmake/rules/linuxPPC64leGcc/c
+++ b/wmake/rules/linuxPPC64leGcc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN       = -Wall
-
 cc          = gcc -m64 -mcpu=power8
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/linuxPPC64leGcc/c++ b/wmake/rules/linuxPPC64leGcc/c++
index c1bd365f267..1dab7348315 100644
--- a/wmake/rules/linuxPPC64leGcc/c++
+++ b/wmake/rules/linuxPPC64leGcc/c++
@@ -1,20 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
-              -Wno-invalid-offsetof -Wno-attributes \
-              -Wno-unknown-pragmas
-
-# Suppress some warnings (flex++, CGAL, etc)
-c++LESSWARN = \
-    -Wno-old-style-cast -Wno-unused-local-typedefs -Wno-array-bounds \
-    -fpermissive
+include $(GENERAL_RULES)/Gcc/c++
 
 CC          = g++ -std=c++11 -m64 -mcpu=power8
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/linuxPPC64leGcc/general b/wmake/rules/linuxPPC64leGcc/general
index 575cadaeee0..567c0cee834 100644
--- a/wmake/rules/linuxPPC64leGcc/general
+++ b/wmake/rules/linuxPPC64leGcc/general
@@ -4,8 +4,8 @@ LD         = ld -m elf64lppc
 PROJECT_LIBS = -l$(WM_PROJECT) -ldl
 
 include $(GENERAL_RULES)/standard
+include $(GENERAL_RULES)/Gcc/openmp
 
-include $(DEFAULT_RULES)/openmp
 include $(DEFAULT_RULES)/X
 include $(DEFAULT_RULES)/c
 include $(DEFAULT_RULES)/c++
diff --git a/wmake/rules/linuxPPC64leGcc/openmp b/wmake/rules/linuxPPC64leGcc/openmp
deleted file mode 100644
index cd007d15291..00000000000
--- a/wmake/rules/linuxPPC64leGcc/openmp
+++ /dev/null
@@ -1,5 +0,0 @@
-# Flags for compiling/linking openmp
-# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
-
-COMP_OPENMP = -DUSE_OMP -fopenmp
-LINK_OPENMP = -lgomp
diff --git a/wmake/rules/solaris64Gcc/c b/wmake/rules/solaris64Gcc/c
index 1097b3a594c..99886ffc020 100644
--- a/wmake/rules/solaris64Gcc/c
+++ b/wmake/rules/solaris64Gcc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN        = -Wall
-
 cc          = gcc -m64
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/solaris64Gcc/c++ b/wmake/rules/solaris64Gcc/c++
index 12c24492af7..03e45effb09 100644
--- a/wmake/rules/solaris64Gcc/c++
+++ b/wmake/rules/solaris64Gcc/c++
@@ -1,18 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
-              -Wno-invalid-offsetof -Wno-attributes \
-              -Wno-unknown-pragmas
-
-# Suppress some warnings (flex++, CGAL, etc)
-c++LESSWARN =
+include $(GENERAL_RULES)/Gcc/c++
 
 CC          = g++ -std=c++11 -m64
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
diff --git a/wmake/rules/solarisGcc/c b/wmake/rules/solarisGcc/c
index dfae4adda05..6845d94483a 100644
--- a/wmake/rules/solarisGcc/c
+++ b/wmake/rules/solarisGcc/c
@@ -1,9 +1,9 @@
 SUFFIXES += .c
 
-cWARN        = -Wall
-
 cc          = gcc
 
+cWARN       = -Wall
+
 include $(DEFAULT_RULES)/c$(WM_COMPILE_OPTION)
 
 cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
diff --git a/wmake/rules/solarisGcc/c++ b/wmake/rules/solarisGcc/c++
index bd58d4af464..68329d01a37 100644
--- a/wmake/rules/solarisGcc/c++
+++ b/wmake/rules/solarisGcc/c++
@@ -1,18 +1,9 @@
-SUFFIXES += .C .cc .cpp .cxx
-
-c++WARN     = -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter \
-              -Wno-invalid-offsetof -Wno-attributes \
-              -Wno-unknown-pragmas
-
-# Suppress some warnings (flex++, CGAL, etc)
-c++LESSWARN =
+include $(GENERAL_RULES)/Gcc/c++
 
 CC          = g++ -std=c++11
 
 include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
 
-ptFLAGS     = -DNoRepository -ftemplate-depth-100
-
 c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
 
 Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $< -o $@
-- 
GitLab