mirror of
https://develop.openfoam.com/Development/ThirdParty-common.git
synced 2025-12-08 06:57:50 +00:00
ENH: improve test for existing libraries (fixes #56)
- check lib as well as lib64 - support -force option in a few more places
This commit is contained in:
44
makeMVAPICH
44
makeMVAPICH
@ -28,18 +28,24 @@ if [ "$1" = "-test" ]
|
||||
then
|
||||
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
|
||||
dir="${2%/}" # <- *_ARCH_PATH
|
||||
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
then
|
||||
echo "Have mpich shared library (${dir##*/})"
|
||||
exit 0
|
||||
elif [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
then
|
||||
echo "Have mpich static library (${dir##*/})"
|
||||
exit 0
|
||||
else
|
||||
echo "No mpich libraries found: ${dir:-not-specified}"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
package="mvapich"
|
||||
libName="libmpi"
|
||||
for lib in \
|
||||
"$dir/lib/$libName.a" \
|
||||
"$dir/lib/$libName$EXT_SO" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName.a" \
|
||||
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
|
||||
;
|
||||
do
|
||||
if [ -r "$lib" ]
|
||||
then
|
||||
echo "Have $package library (${dir##*/})"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
echo "No $package libraries found: ${dir:-not-specified}"
|
||||
exit 2
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
# Run from third-party directory only
|
||||
@ -137,13 +143,19 @@ MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
|
||||
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
|
||||
|
||||
if [ -z "$optForce" ] \
|
||||
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
&& {
|
||||
[ -r "$MPI_ARCH_PATH/lib/libmpi$EXT_SO" ] \
|
||||
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
|
||||
}
|
||||
then
|
||||
echo "Already has shared library"
|
||||
echo "Already has shared library: $MPI_ARCH_PATH"
|
||||
elif [ -z "$optForce" ] \
|
||||
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
&& {
|
||||
[ -r "$MPI_ARCH_PATH/lib/libmpi.a" ] \
|
||||
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
|
||||
}
|
||||
then
|
||||
echo "Already has static library"
|
||||
echo "Already has static library: $MPI_ARCH_PATH"
|
||||
else
|
||||
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
|
||||
echo
|
||||
|
||||
Reference in New Issue
Block a user