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)
This commit is contained in:
Mark Olesen
2021-11-02 10:35:16 +01:00
parent 3494d662c7
commit 2698cab01c
61 changed files with 178 additions and 48 deletions

View File

@ -6,7 +6,7 @@
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 OpenCFD Ltd.
# Copyright (C) 2016-2021 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -87,6 +87,7 @@ export WM_COMPILE_OPTION=Opt
# [WM_COMPILE_CONTROL] - additional control for compiler rules
# +gold : with gold linker
# ~openmp : without openmp
# version=... : compiler suffix (eg, "11" for gcc-11)
#export WM_COMPILE_CONTROL="+gold"
# [WM_MPLIB] - MPI implementation:

View File

@ -82,11 +82,13 @@ case Linux:
endsw
breaksw
# Presume x86_64, with clang (not gcc) as system compiler
# arm64 or x86_64 architectures
case Darwin:
setenv WM_ARCH darwin64
if ( "$WM_COMPILER" == Gcc ) setenv WM_COMPILER Clang
echo "openfoam: darwin support is clang/llvm only"
if ( "$WM_COMPILER" == Gcc ) then
setenv WM_COMPILER Clang
echo "openfoam (darwin): using clang instead of gcc"
endif
breaksw
# Presume x86_64, with mingw cross-compiled

View File

@ -78,11 +78,15 @@ Linux)
esac
;;
# Presume x86_64, with clang (not gcc) as system compiler
# arm64 or x86_64 architectures
Darwin)
WM_ARCH=darwin64
[ "$WM_COMPILER" = Gcc ] && WM_COMPILER=Clang
echo "openfoam: darwin support is clang/llvm only" 1>&2
# Defult to clang (not gcc) as system compiler
if [ "$WM_COMPILER" = Gcc ]
then
WM_COMPILER=Clang
echo "openfoam (darwin): using clang instead of gcc" 1>&2
fi
;;
# Presume x86_64, with mingw cross-compiled

View File

@ -87,6 +87,7 @@ setenv WM_COMPILE_OPTION Opt
# [WM_COMPILE_CONTROL] - additional control for compiler rules
# +gold : with gold linker
# ~openmp : without openmp
# version=... : compiler suffix (eg, "11" for gcc-11)
#setenv WM_COMPILE_CONTROL "+gold"
# [WM_MPLIB] - MPI implementation: