mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: respect the I_MPI_ROOT setting for INTELMPI (issue #524)
- add note in BuildIssues about the I_MPI_CC variable, which is needed when building with Intel-MPI and gcc/clang. This additional setting is needed since the changes needed to solve the issue of building scotch with Intel-MPI and icc (issue #434) means that mpiicc is now being used as the wrapper when compiling scotch. - have the FOAM_MPI short name for INTELMPI start with 'impi-' instead of just the version number. Intel-MPI is often installed as /opt/intel/impi/4.1.3.049, which results in 'FOAM_MPI=4.1.3.049' and the mpi flavour is lost. Prefix these cases with 'impi-'
This commit is contained in:
@ -3,6 +3,21 @@ OpenFOAM-1706
|
||||
Known Build Issues
|
||||
==================
|
||||
|
||||
---------------------
|
||||
Intel MPI (Gcc/Clang)
|
||||
---------------------
|
||||
|
||||
Either I_MPI_ROOT or MPI_ROOT can be used to specify the Intel-MPI
|
||||
installation directory path.
|
||||
|
||||
The ThirdParty build of ptscotch uses `mpiicc` for Intel-MPI
|
||||
instead of the usual `mpicc`.
|
||||
When gcc or clang are used, it is highly likely that the
|
||||
I_MPI_CC environment variable also needs to be set accordingly.
|
||||
|
||||
See `mpiicc -help` for more information about environment variables.
|
||||
|
||||
|
||||
--------------
|
||||
Intel Compiler
|
||||
--------------
|
||||
|
||||
@ -33,13 +33,14 @@
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
unsetenv MPI_ARCH_PATH MPI_HOME
|
||||
setenv FOAM_MPI dummy # Fallback value
|
||||
|
||||
switch ("$WM_MPLIB")
|
||||
case SYSTEMOPENMPI:
|
||||
# Use the system installed openmpi, get library directory via mpicc
|
||||
setenv FOAM_MPI openmpi-system
|
||||
|
||||
# Bit of a hack: strip off 'lib' and hope this is the prefix for openmpi
|
||||
# Bit of a hack: strip off 'lib' and assume it is the prefix for openmpi
|
||||
# include files and libraries.
|
||||
set libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
|
||||
|
||||
@ -58,9 +59,9 @@ case OPENMPI:
|
||||
setenv OPAL_PREFIX $MPI_ARCH_PATH
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using OPENMPI:"
|
||||
echo " OPAL_PREFIX : $OPAL_PREFIX"
|
||||
echo "Using $WM_MPLIB"
|
||||
echo " FOAM_MPI : $FOAM_MPI"
|
||||
echo " OPAL_PREFIX : $MPI_ARCH_PATH"
|
||||
endif
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
@ -191,10 +192,9 @@ case SGIMPI:
|
||||
|
||||
if ( ! -d "$MPI_ROOT" ) then
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/mpi:"
|
||||
echo " MPI_ROOT not a valid mpt installation directory."
|
||||
echo " Please set MPI_ROOT to the mpt installation directory."
|
||||
echo " (usually done by loading the mpt module)"
|
||||
echo " MPI_ROOT currently set to '$MPI_ROOT'"
|
||||
echo " Not a valid $WM_MPLIB installation directory."
|
||||
echo " Please set MPI_ROOT properly (usually via the mpt module)"
|
||||
echo " Currently using '$MPI_ARCH_PATH'"
|
||||
endif
|
||||
|
||||
if ( "${MPI_ROOT:h}/" == $MPI_ROOT ) then
|
||||
@ -205,9 +205,9 @@ case SGIMPI:
|
||||
setenv MPI_ARCH_PATH $MPI_ROOT
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using SGI MPT:"
|
||||
echo " MPI_ROOT : $MPI_ROOT"
|
||||
echo "Using $WM_MPLIB"
|
||||
echo " FOAM_MPI : $FOAM_MPI"
|
||||
echo " MPI_ROOT : $MPI_ARCH_PATH"
|
||||
endif
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
@ -215,36 +215,65 @@ case SGIMPI:
|
||||
breaksw
|
||||
|
||||
case INTELMPI:
|
||||
if ( ! $?MPI_ROOT ) setenv MPI_ROOT /dummy
|
||||
if ( $?I_MPI_ROOT ) then
|
||||
# I_MPI_ROOT: The Intel MPI Library installation directory
|
||||
|
||||
if ( ! -d "$MPI_ROOT" ) then
|
||||
# Remove trailing slash
|
||||
if ( "${I_MPI_ROOT:h}/" == $I_MPI_ROOT ) then
|
||||
setenv I_MPI_ROOT ${I_MPI_ROOT:h}
|
||||
endif
|
||||
setenv MPI_ARCH_PATH $I_MPI_ROOT
|
||||
setenv FOAM_MPI ${MPI_ARCH_PATH:t}
|
||||
|
||||
# If subdirectory is version number only, prefix with 'impi-'
|
||||
switch ("$FOAM_MPI")
|
||||
case [0-9]*:
|
||||
setenv FOAM_MPI "impi-$FOAM_MPI"
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using $WM_MPLIB"
|
||||
echo " FOAM_MPI : $FOAM_MPI"
|
||||
echo " I_MPI_ROOT : $MPI_ARCH_PATH"
|
||||
endif
|
||||
else if ( $?MPI_ROOT ) then
|
||||
# MPI_ROOT: General specification
|
||||
|
||||
# Remove trailing slash
|
||||
if ( "${MPI_ROOT:h}/" == $MPI_ROOT ) then
|
||||
setenv MPI_ROOT ${MPI_ROOT:h}
|
||||
endif
|
||||
|
||||
setenv MPI_ARCH_PATH $MPI_ROOT
|
||||
setenv FOAM_MPI ${MPI_ARCH_PATH:t}
|
||||
|
||||
# If subdirectory is version number only, prefix with 'impi-'
|
||||
switch ("$FOAM_MPI")
|
||||
case [0-9]*:
|
||||
setenv FOAM_MPI "impi-$FOAM_MPI"
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using $WM_MPLIB"
|
||||
echo " FOAM_MPI : $FOAM_MPI"
|
||||
echo " MPI_ROOT : $MPI_ARCH_PATH"
|
||||
endif
|
||||
else
|
||||
setenv MPI_ARCH_PATH /dummy
|
||||
endif
|
||||
|
||||
if ( ! -d "$MPI_ARCH_PATH" ) then
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/mpi:"
|
||||
echo " MPI_ROOT not a valid mpt installation directory."
|
||||
echo " Please set MPI_ROOT to the mpt installation directory."
|
||||
echo " (usually done by loading the mpt module)"
|
||||
echo " MPI_ROOT currently set to '$MPI_ROOT'"
|
||||
endif
|
||||
|
||||
if ( "${MPI_ROOT:h}/" == $MPI_ROOT ) then
|
||||
setenv MPI_ROOT ${MPI_ROOT:h}
|
||||
endif
|
||||
|
||||
setenv FOAM_MPI ${MPI_ROOT:t}
|
||||
setenv MPI_ARCH_PATH $MPI_ROOT
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using INTEL MPT:"
|
||||
echo " MPI_ROOT : $MPI_ROOT"
|
||||
echo " FOAM_MPI : $FOAM_MPI"
|
||||
echo " Not a valid $WM_MPLIB installation directory."
|
||||
echo " Please set I_MPI_ROOT or MPI_ROOT properly."
|
||||
echo " Currently using '$MPI_ARCH_PATH'"
|
||||
endif
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin64
|
||||
_foamAddLib $MPI_ARCH_PATH/lib64
|
||||
breaksw
|
||||
|
||||
default:
|
||||
setenv FOAM_MPI dummy
|
||||
breaksw
|
||||
endsw
|
||||
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
unset MPI_ARCH_PATH MPI_HOME
|
||||
export FOAM_MPI=dummy # Fallback value
|
||||
|
||||
case "$WM_MPLIB" in
|
||||
SYSTEMOPENMPI)
|
||||
@ -45,7 +46,7 @@ SYSTEMOPENMPI)
|
||||
unset OPAL_PREFIX
|
||||
fi
|
||||
|
||||
# Bit of a hack: strip off 'lib' and hope this is the prefix for openmpi
|
||||
# Bit of a hack: strip off 'lib' and assume it is the prefix for openmpi
|
||||
# include files and libraries.
|
||||
libDir=$(mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/')
|
||||
|
||||
@ -65,9 +66,9 @@ OPENMPI)
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using OPENMPI:" 1>&2
|
||||
echo " OPAL_PREFIX : $OPAL_PREFIX" 1>&2
|
||||
echo "Using $WM_MPLIB" 1>&2
|
||||
echo " FOAM_MPI : $FOAM_MPI" 1>&2
|
||||
echo " OPAL_PREFIX : $MPI_ARCH_PATH" 1>&2
|
||||
fi
|
||||
|
||||
# Could be sourced from ThirdParty with incomplete environment
|
||||
@ -208,25 +209,23 @@ QSMPI)
|
||||
|
||||
SGIMPI)
|
||||
# No trailing slash
|
||||
[ "${MPI_ROOT%/}" = "${MPI_ROOT}" ] || MPI_ROOT="${MPI_ROOT%/}"
|
||||
MPI_ROOT="${MPI_ROOT%/}" # Remove trailing slash
|
||||
|
||||
export FOAM_MPI="${MPI_ROOT##*/}"
|
||||
export MPI_ARCH_PATH=$MPI_ROOT
|
||||
export MPI_ARCH_PATH="${MPI_ROOT%/}" # Remove trailing slash
|
||||
export FOAM_MPI="${MPI_ARCH_PATH##*/}"
|
||||
|
||||
if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ]
|
||||
then
|
||||
[ -d "$MPI_ARCH_PATH" ] || {
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/mpi:" 1>&2
|
||||
echo " MPI_ROOT not a valid mpt installation directory or ending" \
|
||||
" in a '/'." 1>&2
|
||||
echo " Please set MPI_ROOT to the mpt installation directory." 1>&2
|
||||
echo " MPI_ROOT currently set to '$MPI_ROOT'" 1>&2
|
||||
fi
|
||||
echo " Not a valid $WM_MPLIB installation directory." 1>&2
|
||||
echo " Please set MPI_ROOT properly (usually via the mpt module)" 1>&2
|
||||
echo " Currently using '$MPI_ARCH_PATH'" 1>&2
|
||||
}
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using SGI MPT:" 1>&2
|
||||
echo " MPI_ROOT : $MPI_ROOT" 1>&2
|
||||
echo "Using $WM_MPLIB" 1>&2
|
||||
echo " FOAM_MPI : $FOAM_MPI" 1>&2
|
||||
echo " MPI_ROOT : $MPI_ARCH_PATH" 1>&2
|
||||
fi
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin
|
||||
@ -234,35 +233,53 @@ SGIMPI)
|
||||
;;
|
||||
|
||||
INTELMPI)
|
||||
MPI_ROOT="${MPI_ROOT%/}" # No trailing slash
|
||||
|
||||
export FOAM_MPI="${MPI_ROOT##*/}"
|
||||
export MPI_ARCH_PATH=$MPI_ROOT
|
||||
|
||||
if [ ! -d "$MPI_ROOT" -o -z "$MPI_ARCH_PATH" ]
|
||||
if [ -n "$I_MPI_ROOT" ]
|
||||
then
|
||||
# I_MPI_ROOT: The Intel MPI Library installation directory
|
||||
|
||||
MPI_ARCH_PATH="${I_MPI_ROOT%/}" # Remove trailing slash
|
||||
FOAM_MPI="${MPI_ARCH_PATH##*/}"
|
||||
|
||||
# If subdirectory is version number only, prefix with 'impi-'
|
||||
case "$FOAM_MPI" in ([0-9]*) FOAM_MPI="impi-$FOAM_MPI";; esac
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using $WM_MPLIB" 1>&2
|
||||
echo " FOAM_MPI : $FOAM_MPI" 1>&2
|
||||
echo " I_MPI_ROOT : $MPI_ARCH_PATH" 1>&2
|
||||
fi
|
||||
else
|
||||
# MPI_ROOT: General specification
|
||||
MPI_ARCH_PATH="${MPI_ROOT%/}" # Remove trailing slash
|
||||
FOAM_MPI="${MPI_ARCH_PATH##*/}"
|
||||
|
||||
# If subdirectory is version number only, prefix with 'impi-'
|
||||
case "$FOAM_MPI" in ([0-9]*) FOAM_MPI="impi-$FOAM_MPI";; esac
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using $WM_MPLIB" 1>&2
|
||||
echo " FOAM_MPI : $FOAM_MPI" 1>&2
|
||||
echo " MPI_ROOT : $MPI_ARCH_PATH" 1>&2
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -d "$MPI_ARCH_PATH" ] || {
|
||||
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/mpi:" 1>&2
|
||||
echo " MPI_ROOT not a valid mpt installation directory or ending" \
|
||||
" in a '/'." 1>&2
|
||||
echo " Please set MPI_ROOT to the mpt installation directory." 1>&2
|
||||
echo " MPI_ROOT currently set to '$MPI_ROOT'" 1>&2
|
||||
fi
|
||||
echo " Not a valid $WM_MPLIB installation directory." 1>&2
|
||||
echo " Please set I_MPI_ROOT or MPI_ROOT properly." 1>&2
|
||||
echo " Currently using '$MPI_ARCH_PATH'" 1>&2
|
||||
}
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using INTEL MPI:" 1>&2
|
||||
echo " MPI_ROOT : $MPI_ROOT" 1>&2
|
||||
echo " FOAM_MPI : $FOAM_MPI" 1>&2
|
||||
fi
|
||||
export FOAM_MPI MPI_ARCH_PATH
|
||||
|
||||
_foamAddPath $MPI_ARCH_PATH/bin64
|
||||
_foamAddLib $MPI_ARCH_PATH/lib64
|
||||
;;
|
||||
*)
|
||||
export FOAM_MPI=dummy
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# Add (non-dummy) MPI implementation
|
||||
# - dummy MPI already added to LD_LIBRARY_PATH and has no external libraries
|
||||
if [ "$FOAM_MPI" != dummy ] && type _foamAddLib > /dev/null 2>&1
|
||||
|
||||
Reference in New Issue
Block a user