ENH: improved handling of gmp/mpfr library settings (issue #674)

- export library path for gmp/mpfr from CGAL config files.
  This is required when non-system gmp/mpfr libraries are being
  used, but not using a ThirdParty compiler installation.

- automatically handle lib/ vs lib64/ (eg, for central installations)
  for packages such as boost, CGAL, etc. While the ThirdParty
  compilation of these will normally land in lib64/, this may not be
  the case when they are supplied by another means.

- reworked the handling of foamEtcFile and foamCleanPath for less
  clutter in the configuration files.
  Added the bin/tools/lib-dir script to handle logic that is
  too complex to easily manage in csh.
This commit is contained in:
Mark Olesen
2018-01-11 01:30:23 +01:00
parent 2d51d4b340
commit 110b00f048
47 changed files with 763 additions and 383 deletions

View File

@ -3,7 +3,7 @@
# \\ / 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.
# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
@ -11,9 +11,10 @@
#
# File
# etc/config.sh/settings
# - sourced by OpenFOAM-*/etc/bashrc
#
# Description
# Settings for OpenFOAM, sourced from OpenFOAM-<VERSION>/etc/bashrc
# Settings for OpenFOAM.
#
#------------------------------------------------------------------------------
export WM_ARCH=$(uname -s) # System name
@ -216,7 +217,7 @@ unset GMP_ARCH_PATH MPFR_ARCH_PATH
# Load pre-defined compiler versions
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamEtc config.sh/compiler
_foamEtc -config compiler
# ThirdParty base for compilers
archDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
@ -246,21 +247,15 @@ GCC_NOT_FOUND
# Add ThirdParty compiler libraries to run-time environment
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
# Add ThirdParty gmp/mpfr/mpc libraries to run-time environment
if [ "${gmpDir##*-}" != system ]
then
_foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH
export GMP_ARCH_PATH=$gmpDir # For ThirdParty CGAL
fi
if [ "${mpfrDir##*-}" != system ]
then
_foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH
export MPFR_ARCH_PATH=$mpfrDir # For ThirdParty CGAL
fi
if [ "${mpcDir##*-}" != system ]
then
_foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH
fi
# 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