Skip to content
Snippets Groups Projects
Commit b16ef5f0 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: set PINC, PLIBS in the rules (not the env) for system-openmpi

BUG: syntax error in settings.sh
parent 0d445841
No related branches found
No related tags found
No related merge requests found
...@@ -137,8 +137,7 @@ case OpenFOAM: ...@@ -137,8 +137,7 @@ case OpenFOAM:
_foamAddPath $gccDir/bin _foamAddPath $gccDir/bin
# 64-bit needs lib64, but 32-bit needs lib (not lib32) # 64-bit needs lib64, but 32-bit needs lib (not lib32)
if ( "$WM_ARCH_OPTION" = 64 ) then if ($WM_ARCH_OPTION == 64) then
then
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH _foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
else else
_foamAddLib $gccDir/lib _foamAddLib $gccDir/lib
...@@ -150,7 +149,6 @@ case OpenFOAM: ...@@ -150,7 +149,6 @@ case OpenFOAM:
# add in mpc libraries (not need for older gcc) # add in mpc libraries (not need for older gcc)
if ( $?mpc_version ) then if ( $?mpc_version ) then
then
_foamAddLib $mpcDir/lib _foamAddLib $mpcDir/lib
endif endif
...@@ -209,18 +207,14 @@ case OPENMPI: ...@@ -209,18 +207,14 @@ case OPENMPI:
breaksw breaksw
case SYSTEMOPENMPI: case SYSTEMOPENMPI:
# This uses the installed openmpi. It needs mpicc installed! # use the system installed openmpi, get library directory via mpicc
set mpi_version=openmpi-system set mpi_version=openmpi-system
set libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
# Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
setenv PINC `mpicc --showme:compile`
setenv PLIBS `mpicc --showme:link`
set libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
if ($?FOAM_VERBOSE && $?prompt) then if ($?FOAM_VERBOSE && $?prompt) then
echo "Using system installed MPI:" echo "Using system installed OpenMPI:"
echo " compile flags : $PINC" echo " compile flags : `mpicc --showme:compile`"
echo " link flags : $PLIBS" echo " link flags : `mpicc --showme:link`"
echo " libmpi dir : $libDir" echo " libmpi dir : $libDir"
endif endif
......
...@@ -235,19 +235,15 @@ OPENMPI) ...@@ -235,19 +235,15 @@ OPENMPI)
;; ;;
SYSTEMOPENMPI) SYSTEMOPENMPI)
# This uses the installed openmpi. It needs mpicc installed! # use the system installed openmpi, get library directory via mpicc
mpi_version=openmpi-system mpi_version=openmpi-system
libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
# Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
export PINC=`mpicc --showme:compile`
export PLIBS=`mpicc --showme:link`
libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
if [ "$FOAM_VERBOSE" -a "$PS1" ] if [ "$FOAM_VERBOSE" -a "$PS1" ]
then then
echo "Using system installed MPI:" echo "Using system installed OpenMPI:"
echo " compile flags : $PINC" echo " compile flags : `mpicc --showme:compile`"
echo " link flags : $PLIBS" echo " link flags : `mpicc --showme:link`"
echo " libmpi dir : $libDir" echo " libmpi dir : $libDir"
fi fi
......
# use the system installed openmpi - mpicc must be installed
PFLAGS = -DOMPI_SKIP_MPICXX PFLAGS = -DOMPI_SKIP_MPICXX
PINC = $(shell mpicc --showme:compile)
PLIBS = $(shell mpicc --showme:link)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment