mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
CONFIG: adjust ordering of library paths (#2200)
- previously OpenFOAM library paths were set before adding in MPI-specific elements. However, this may mask some libraries. | New library order | Old library order | |---------------------|---------------------| | user-lib (serial) | various 3rd-party | | site-lib (serial) | foam-lib (mpi) | | foam-lib (mpi) | ext-lib (mpi) | | foam-lib (serial) | system mpi-libs | | ext-lib (mpi) | user-lib (serial) | | ext-lib (serial) | site-lib (serial) | | various 3rd-party | foam-lib (serial) | | system mpi-libs | ext-lib (serial) | | dummy | dummy |
This commit is contained in:
@ -379,29 +379,18 @@ endsw
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Final
|
||||
|
||||
# A real (non-dummy) MPI
|
||||
if ( "$FOAM_MPI" != dummy ) then
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using mpi type : $WM_MPLIB"
|
||||
echo " FOAM_MPI : $FOAM_MPI"
|
||||
if ( "${MPI_ARCH_PATH}" == "" ) then
|
||||
echo " prefix : unset"
|
||||
else
|
||||
echo " prefix : $MPI_ARCH_PATH"
|
||||
endif
|
||||
# Report
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using mpi type : $WM_MPLIB"
|
||||
echo " FOAM_MPI : $FOAM_MPI"
|
||||
if ( "${MPI_ARCH_PATH}" == "" ) then
|
||||
echo " prefix : unset"
|
||||
else
|
||||
echo " prefix : $MPI_ARCH_PATH"
|
||||
endif
|
||||
|
||||
# OpenFOAM library interface to (non-dummy) MPI
|
||||
if ( $?FOAM_EXT_LIBBIN ) then
|
||||
# External libraries (can be unset)
|
||||
_foamAddLib "${FOAM_EXT_LIBBIN}/${FOAM_MPI}"
|
||||
endif
|
||||
_foamAddLib "${FOAM_LIBBIN}/${FOAM_MPI}"
|
||||
endif
|
||||
|
||||
|
||||
# Cleanup
|
||||
unset _foamMpiPrefixDir _foamMpiWarning _foamMpiVersion
|
||||
|
||||
|
||||
@ -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.
|
||||
@ -177,14 +177,10 @@ _foamAddLib "$FOAM_LIBBIN/dummy"
|
||||
# External (ThirdParty) libraries. Also allowed to be unset
|
||||
if ( -d "$WM_THIRD_PARTY_DIR" ) then
|
||||
setenv FOAM_EXT_LIBBIN "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib"
|
||||
_foamAddLib "$FOAM_EXT_LIBBIN"
|
||||
else
|
||||
unsetenv FOAM_EXT_LIBBIN
|
||||
endif
|
||||
|
||||
# OpenFOAM libraries (user, group, standard)
|
||||
_foamAddLib "${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}"
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@ -133,6 +133,9 @@ while ( $#argv > 0 )
|
||||
shift
|
||||
end
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# Verify FOAM_CONFIG_ETC (from calling environment or from prefs)
|
||||
if ( $?FOAM_CONFIG_ETC ) then
|
||||
if ( "$FOAM_CONFIG_ETC" == "etc" || "$FOAM_CONFIG_ETC" == "$WM_PROJECT_DIR/etc" ) then
|
||||
@ -143,8 +146,8 @@ endif
|
||||
|
||||
|
||||
# Clean standard environment variables (PATH, MANPATH, LD_LIBRARY_PATH)
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# Prevent local variables from shadowing setenv variables
|
||||
# - avoid local variables shadowing setenv variables
|
||||
|
||||
unset PATH MANPATH LD_LIBRARY_PATH DYLD_LIBRARY_PATH
|
||||
if (! $?MANPATH ) setenv MANPATH
|
||||
if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH
|
||||
@ -153,12 +156,11 @@ _foamClean PATH "$foamOldDirs"
|
||||
_foamClean MANPATH "$foamOldDirs"
|
||||
_foamClean LD_LIBRARY_PATH "$foamOldDirs"
|
||||
|
||||
# Setup for OpenFOAM compilation etc
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_foamEtc -config settings
|
||||
|
||||
# Setup for third-party packages
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#------------------------------------------------------------------------------
|
||||
# Base setup (OpenFOAM compilation), MPI and third-party packages
|
||||
|
||||
_foamEtc -config settings
|
||||
_foamEtc -config mpi
|
||||
_foamEtc -config paraview -- "$FOAM_SETTINGS" # Pass through for evaluation
|
||||
_foamEtc -config vtk
|
||||
@ -166,6 +168,30 @@ _foamEtc -config adios2
|
||||
_foamEtc -config CGAL
|
||||
_foamEtc -config FFTW
|
||||
|
||||
if (! $?FOAM_MPI ) then
|
||||
setenv FOAM_MPI dummy # Fallback value
|
||||
endif
|
||||
|
||||
# Finalize library paths
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# ThirdParty serial and mpi-specific libraries
|
||||
if ( $?FOAM_EXT_LIBBIN ) then
|
||||
_foamAddLib "${FOAM_EXT_LIBBIN}"
|
||||
if ( "$FOAM_MPI" != dummy ) then
|
||||
_foamAddLib "${FOAM_EXT_LIBBIN}/${FOAM_MPI}"
|
||||
endif
|
||||
endif
|
||||
|
||||
# OpenFOAM serial and mpi-specific libraries
|
||||
_foamAddLib "$FOAM_LIBBIN"
|
||||
if ( "$FOAM_MPI" != dummy ) then
|
||||
_foamAddLib "${FOAM_LIBBIN}/${FOAM_MPI}"
|
||||
endif
|
||||
|
||||
# OpenFOAM user, group libraries
|
||||
_foamAddLib "${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}"
|
||||
|
||||
if ( -d "$WM_PROJECT_DIR/doc/man1" ) then
|
||||
_foamAddMan "$WM_PROJECT_DIR/doc"
|
||||
endif
|
||||
@ -177,8 +203,9 @@ if ($?prompt) then
|
||||
endif
|
||||
|
||||
|
||||
# Clean environment paths again. Only remove duplicates
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Remove duplicates from environment paths
|
||||
|
||||
_foamClean PATH
|
||||
_foamClean MANPATH
|
||||
|
||||
Reference in New Issue
Block a user