mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support use of system gmp/mpfr/mpc with ThirdParty gcc
- not previously possible to configure a third-party gcc with system gmp/mpfr/mpc. This makes it easier to switch between compilers for testing. - use system libraries by default
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -202,7 +202,7 @@ _foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_L
|
|||||||
# Compiler settings
|
# Compiler settings
|
||||||
# ~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~
|
||||||
unset gcc_version gmp_version mpfr_version mpc_version
|
unset gcc_version gmp_version mpfr_version mpc_version
|
||||||
unsetenv MPFR_ARCH_PATH GMP_ARCH_PATH
|
unsetenv GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||||
|
|
||||||
|
|
||||||
# Location of compiler installation
|
# Location of compiler installation
|
||||||
@ -217,9 +217,9 @@ switch ("$WM_COMPILER_TYPE")
|
|||||||
case OpenFOAM:
|
case OpenFOAM:
|
||||||
case ThirdParty:
|
case ThirdParty:
|
||||||
# Default versions of GMP, MPFR and MPC, overide as necessary
|
# Default versions of GMP, MPFR and MPC, overide as necessary
|
||||||
set gmp_version=gmp-6.0.1
|
set gmp_version=gmp-system
|
||||||
set mpfr_version=mpfr-3.1.4
|
set mpfr_version=mpfr-system
|
||||||
set mpc_version=mpc-1.0.3
|
set mpc_version=mpc-system
|
||||||
switch ("$WM_COMPILER")
|
switch ("$WM_COMPILER")
|
||||||
case Gcc:
|
case Gcc:
|
||||||
case Gcc48:
|
case Gcc48:
|
||||||
@ -291,17 +291,28 @@ case ThirdParty:
|
|||||||
_foamAddMan $gccDir/man
|
_foamAddMan $gccDir/man
|
||||||
_foamAddPath $gccDir/bin
|
_foamAddPath $gccDir/bin
|
||||||
|
|
||||||
# Add compiler libraries to run-time environment
|
# Add ThirdParty compiler libraries to run-time environment
|
||||||
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
|
|
||||||
# Add gmp/mpfr/mpc libraries to run-time environment
|
# Add ThirdParty gmp/mpfr/mpc libraries to run-time environment
|
||||||
|
if ( "${gmpDir:t}" != "gmp-system" ) then
|
||||||
_foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
|
endif
|
||||||
|
if ( "${mpfrDir:t}" != "mpfr-system" ) then
|
||||||
_foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
|
endif
|
||||||
|
if ( "${mpcDir:t}" != "mpc-system" ) then
|
||||||
_foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
|
endif
|
||||||
|
|
||||||
# Used by boost/CGAL:
|
# Used by boost/CGAL:
|
||||||
setenv MPFR_ARCH_PATH $mpfrDir
|
|
||||||
setenv GMP_ARCH_PATH $gmpDir
|
setenv GMP_ARCH_PATH $gmpDir
|
||||||
|
setenv MPFR_ARCH_PATH $mpfrDir
|
||||||
|
|
||||||
|
if ($?FOAM_VERBOSE && $?prompt) then
|
||||||
|
echo "Using ThirdParty compiler"
|
||||||
|
echo " ${gccDir:t} (${gmpDir:t} ${mpfrDir:t} ${mpcDir:t})"
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
unset gcc_version gccDir
|
unset gcc_version gccDir
|
||||||
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
||||||
@ -324,7 +335,6 @@ case ThirdParty:
|
|||||||
_foamAddPath $clangDir/bin
|
_foamAddPath $clangDir/bin
|
||||||
endif
|
endif
|
||||||
unset clang_version clangDir
|
unset clang_version clangDir
|
||||||
|
|
||||||
breaksw
|
breaksw
|
||||||
|
|
||||||
case system:
|
case system:
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -32,11 +32,10 @@
|
|||||||
|
|
||||||
case "$WM_COMPILER_TYPE" in
|
case "$WM_COMPILER_TYPE" in
|
||||||
OpenFOAM | ThirdParty)
|
OpenFOAM | ThirdParty)
|
||||||
|
|
||||||
# Default versions of GMP, MPFR and MPC, override as necessary
|
# Default versions of GMP, MPFR and MPC, override as necessary
|
||||||
gmp_version=gmp-6.0.1
|
gmp_version=gmp-system
|
||||||
mpfr_version=mpfr-3.1.4
|
mpfr_version=mpfr-system
|
||||||
mpc_version=mpc-1.0.3
|
mpc_version=mpc-system
|
||||||
|
|
||||||
case "$WM_COMPILER" in
|
case "$WM_COMPILER" in
|
||||||
Gcc | Gcc48)
|
Gcc | Gcc48)
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration |
|
# \\ / O peration |
|
||||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -198,7 +198,7 @@ _foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_EXT_LIBBIN:$
|
|||||||
# Compiler settings
|
# Compiler settings
|
||||||
# ~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~
|
||||||
unset gcc_version gmp_version mpfr_version mpc_version
|
unset gcc_version gmp_version mpfr_version mpc_version
|
||||||
unset MPFR_ARCH_PATH GMP_ARCH_PATH
|
unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||||
|
|
||||||
# Location of compiler installation
|
# Location of compiler installation
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -219,9 +219,9 @@ OpenFOAM | ThirdParty)
|
|||||||
if [ -n "$gcc_version" ]
|
if [ -n "$gcc_version" ]
|
||||||
then
|
then
|
||||||
gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
|
gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
|
||||||
gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
|
gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${gmp_version:-gmp-system}
|
||||||
mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
|
mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpfr_version:-mpfr-system}
|
||||||
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version
|
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpc_version:-mpc-system}
|
||||||
|
|
||||||
# Check that the compiler directory can be found
|
# Check that the compiler directory can be found
|
||||||
[ -d "$gccDir" ] || {
|
[ -d "$gccDir" ] || {
|
||||||
@ -237,17 +237,32 @@ OpenFOAM | ThirdParty)
|
|||||||
_foamAddMan $gccDir/man
|
_foamAddMan $gccDir/man
|
||||||
_foamAddPath $gccDir/bin
|
_foamAddPath $gccDir/bin
|
||||||
|
|
||||||
# Add compiler libraries to run-time environment
|
# Add ThirdParty compiler libraries to run-time environment
|
||||||
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
|
|
||||||
# Add gmp/mpfr/mpc libraries to run-time environment
|
# Add ThirdParty gmp/mpfr/mpc libraries to run-time environment
|
||||||
|
if [ "${gmpDir##*-}" != system ]
|
||||||
|
then
|
||||||
_foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
|
fi
|
||||||
|
if [ "${mpfrDir##*-}" != system ]
|
||||||
|
then
|
||||||
_foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
|
fi
|
||||||
|
if [ "${mpcDir##*-}" != system ]
|
||||||
|
then
|
||||||
_foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
|
fi
|
||||||
|
|
||||||
# Used by boost/CGAL:
|
# Used by boost/CGAL:
|
||||||
export MPFR_ARCH_PATH=$mpfrDir
|
|
||||||
export GMP_ARCH_PATH=$gmpDir
|
export GMP_ARCH_PATH=$gmpDir
|
||||||
|
export MPFR_ARCH_PATH=$mpfrDir
|
||||||
|
|
||||||
|
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||||
|
then
|
||||||
|
echo "Using ThirdParty compiler"
|
||||||
|
echo " ${gccDir##*/} (${gmpDir##*/} $${mpfrDir##*/} ${mpcDir##*/})"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
unset gcc_version gccDir
|
unset gcc_version gccDir
|
||||||
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
||||||
|
|||||||
Reference in New Issue
Block a user