mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
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:
@ -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,19 +11,11 @@
|
||||
#
|
||||
# File
|
||||
# etc/config.csh/settings
|
||||
# - sourced by OpenFOAM-*/etc/cshrc
|
||||
#
|
||||
# Description
|
||||
# Settings for OpenFOAM, sourced from OpenFOAM-<VERSION>/etc/cshrc
|
||||
# Settings for OpenFOAM
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Prefix to PATH
|
||||
alias _foamAddPath 'setenv PATH \!*\:${PATH}'
|
||||
# Prefix to LD_LIBRARY_PATH
|
||||
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
|
||||
# Prefix to MANPATH
|
||||
alias _foamAddMan 'setenv MANPATH \!*\:${MANPATH}'
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
setenv WM_ARCH `uname -s` # System name
|
||||
if (! $?WM_OSTYPE ) setenv WM_OSTYPE POSIX # System type (POSIX is default)
|
||||
@ -228,7 +220,7 @@ unsetenv GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||
|
||||
# Load pre-defined compiler versions
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_foamEtc config.csh/compiler
|
||||
_foamEtc -config compiler
|
||||
|
||||
# ThirdParty base for compilers
|
||||
set archDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
|
||||
@ -263,19 +255,19 @@ 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
|
||||
# Add gmp/mpfr/mpc libraries to run-time environment.
|
||||
# Require that they exist, automatically find lib64/ or lib/.
|
||||
if ( "${gmpDir:t}" != "gmp-system" ) then
|
||||
_foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH
|
||||
setenv GMP_ARCH_PATH $gmpDir # For ThirdParty CGAL
|
||||
_foamAddLibAuto $gmpDir
|
||||
setenv GMP_ARCH_PATH $gmpDir # For non-system CGAL
|
||||
endif
|
||||
if ( "${mpfrDir:t}" != "mpfr-system" ) then
|
||||
_foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH
|
||||
setenv MPFR_ARCH_PATH $mpfrDir # For ThirdParty CGAL
|
||||
endif
|
||||
if ( "${mpcDir:t}" != "mpc-system" ) then
|
||||
_foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH
|
||||
_foamAddLibAuto $mpfrDir
|
||||
setenv MPFR_ARCH_PATH $mpfrDir # For non-system CGAL
|
||||
endif
|
||||
|
||||
_foamAddLibAuto $mpcDir
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using ThirdParty compiler"
|
||||
echo " ${gccDir:t} (${gmpDir:t} ${mpfrDir:t} ${mpcDir:t})"
|
||||
@ -332,6 +324,6 @@ unset archDir
|
||||
unset gcc_version gccDir
|
||||
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
||||
unset clang_version clangDir
|
||||
# Retain: _foamAddPath _foamAddLib _foamAddMan
|
||||
# Retain: _foamAddPath _foamAddLib _foamAddMan _foamAddLibAuto
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user