CONFIG: provide separate default settings for clang/gcc (fixes #1566)

- the foamConfigurePaths script is quite simplistic and aggressive in
  what it changes. This was particularly evident when using it to
  change gcc/clang versions.

  Restructured the corresponding compiler settings to define default
  versions (eg, "default_gcc_version") that limits the scope of
  changes performed by foamConfigurePaths and makes it easier to
  understand if changing manually.
This commit is contained in:
Mark Olesen
2020-02-03 11:05:04 +01:00
parent c1cbfe5780
commit 4dd1433133
7 changed files with 155 additions and 135 deletions

View File

@ -9,15 +9,17 @@
# Copyright (C) 2017 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
# <http://www.gnu.org/licenses/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# File
# config.sh/example/compiler
# - sourced by OpenFOAM-*/etc/config.sh/settings
#
# Description
# Example of fine tuning compiler versions and settings for OpenFOAM
# Older example of fine tuning compiler settings for OpenFOAM.
#
# The preferred mechanism is now with a "compiler-$WM_COMPILER" file
# in one of the etc/ directories.
#
#------------------------------------------------------------------------------
@ -26,18 +28,12 @@ eval $($WM_PROJECT_DIR/bin/foamEtcFile -sh -config -mode=o compiler)
# Modify/override compiler settings
case "$WM_COMPILER" in
Gcc70)
Gcc70*)
gcc_version=gcc-7.0.0
gmp_version=gmp-6.1.2
mpfr_version=mpfr-3.1.5
mpc_version=mpc-1.0.3
;;
Gcc48u)
# Example of using the system GCC 4.8 in Ubuntu 15.10. Keep in mind you
# will also need to create the respective directory in "wmake/rules"
export CC='gcc-4.8'
export CXX='g++-4.8'
;;
esac
#------------------------------------------------------------------------------

View File

@ -0,0 +1,28 @@
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# File
# config.sh/example/compiler-Gcc92
# - sourced by OpenFOAM-*/etc/config.sh/compiler
#
# Description
# Example of fine tuning compiler settings with a hook
#
#------------------------------------------------------------------------------
# Modify/override compiler settings
gcc_version=gcc-9.2.0
gmp_version=gmp-6.2.0
mpfr_version=mpfr-4.0.2
mpc_version=mpc-1.1.0
#------------------------------------------------------------------------------