Commit a9f50585 authored by Mark Olesen's avatar Mark Olesen

ENH: more forgiving if scotch is missing, provide download hints (#45)

- include makeAdios2 into the Allwmake list (as optional component)
parent 54d6b799
......@@ -59,7 +59,8 @@ esac
#------------------------------------------------------------------------------
./makeSCOTCH
# Treat as optional, but really isn't if anyone wants parallel calculations
./makeSCOTCH || warnBuildIssues SCOTCH
#------------------------------------------------------------------------------
echo
......@@ -71,7 +72,7 @@ then
fi
if [ -n "$KAHIP_ARCH_PATH" ]
then
echo KaHIP decomposition
echo KAHIP decomposition
./makeKAHIP -test "$KAHIP_ARCH_PATH" || \
./makeKAHIP || warnBuildIssues KAHIP
else
......@@ -88,7 +89,7 @@ then
fi
if [ -n "$METIS_ARCH_PATH" ]
then
echo Metis decomposition
echo METIS decomposition
./makeMETIS -test "$METIS_ARCH_PATH" || \
./makeMETIS || warnBuildIssues METIS
else
......@@ -107,6 +108,7 @@ else
warnNotFound CGAL # is optional
fi
#------------------------------------------------------------------------------
echo
echo ========================================
if [ -n "$FFTW_ARCH_PATH" ]
......@@ -118,6 +120,26 @@ else
warnNotFound FFTW # is optional
fi
#------------------------------------------------------------------------------
echo
echo ========================================
# Get ADIOS2_ARCH_PATH
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/adios2)
then
. $settings
fi
if [ -n "$ADIOS2_ARCH_PATH" ]
then
echo ADIOS2
./makeAdios2 -test "$ADIOS2_ARCH_PATH" || \
./makeAdios2 || warnBuildIssues ADIOS2
else
warnNotFound ADIOS2 # is optional
fi
#------------------------------------------------------------------------------
echo
echo ========================================
echo Done ThirdParty Allwmake
......
......@@ -276,6 +276,25 @@ requireWMakeToolchain()
}
# grep for package http or ftp entries in BUILD.md
# Should be of the form "[link xx]: http://..."
showDownloadHint()
{
local package="$1"
if [ -n "$package" ]
then
echo "Possible download locations for $package :"
if [ -f "$WM_THIRD_PARTY_DIR/BUILD.md" ]
then
grep -i "$package" "$WM_THIRD_PARTY_DIR/BUILD.md" | \
grep -E '(http|ftp)' | sed -ne 's/^ *\[.*\]: */ /p'
fi
fi
}
#------------------------------------------------------------------------------
# Some functions as per OpenFOAM etc/config.sh/functions
......
......@@ -18,6 +18,24 @@
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Dynamic library ending (default is .so)
[ "$(uname -s)" = Darwin ] && EXT_SO=.dylib || EXT_SO=.so
# Short-circuit test for an installation
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- FFTW_ARCH_PATH
if [ -d "$dir/include" -a -r "$dir/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
then
echo " adios2 include: $dir/include"
echo " adios2 library: $dir/lib$WM_COMPILER_LIB_ARCH"
exit 0
else
exit 2
fi
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
......@@ -107,16 +125,13 @@ echo ========================================
echo "Build adios library $adiosPACKAGE for $FOAM_MPI"
echo
# Needs future adjustment
# - for shared library
# - for mpi-specific library locations
if [ -f $ADIOS2_ARCH_PATH/include/adios.h \
-a -r $ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios_${FOAM_MPI}.a ]
if [ -f $ADIOS2_ARCH_PATH/include/adios2.h \
-a -r $ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO ]
then
echo " ADIOS2 header in $ADIOS2_ARCH_PATH/include"
### echo " ADIOS2 libs in $FOAM_EXT_LIBBIN" # dynamic
echo " ADIOS2 libs in $ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" # static
echo " ADIOS2 libs in $ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
else
# CMake options often lag the configure ones
echo "Starting build: $adiosPACKAGE (using cmake)"
......
......@@ -134,6 +134,7 @@ HYPRE_SOURCE_DIR=$sourceBASE/$hyprePACKAGE
[ -d "$HYPRE_SOURCE_DIR" ] || {
echo "Missing sources: '$hyprePACKAGE'"
showDownloadHint HYPER
exit 1
}
......
......@@ -136,7 +136,8 @@ KAHIP_ARCH_PATH=$installBASE/$kahipPACKAGE
[ -d "$KAHIP_SOURCE_DIR" ] || {
echo "Missing sources: '$kahipPACKAGE'"
exit 1
showDownloadHint KAHIP
exit 2
}
#
......
......@@ -134,7 +134,8 @@ METIS_SOURCE_DIR=$sourceBASE/$metisPACKAGE
[ -d "$METIS_SOURCE_DIR" ] || {
echo "Missing sources: '$metisPACKAGE'"
exit 1
showDownloadHint METIS
exit 2
}
#
......
......@@ -134,7 +134,8 @@ PETSC_SOURCE_DIR=$sourceBASE/$petscPACKAGE
[ -d "$PETSC_SOURCE_DIR" ] || {
echo "Missing sources: '$petscPACKAGE'"
exit 1
showDownloadHint PETSC
exit 2
}
......
......@@ -123,9 +123,10 @@ makefileInc="../../$scotchMakefile"
SCOTCH_SOURCE_DIR=$sourceBASE/$scotchPACKAGE
: "${SCOTCH_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$scotchPACKAGE}"
[ -d "$SCOTCH_SOURCE_DIR" ] || {
[ -d "$SCOTCH_SOURCE_DIR/src" ] || {
echo "Missing sources: '$scotchPACKAGE'"
exit 1
showDownloadHint SCOTCH
exit 2
}
echo
......@@ -218,7 +219,7 @@ echo "pt-scotch decomposition ($scotchPACKAGE with $FOAM_MPI)"
# Report that the above tests failed and pass-through the failure
echo
echo " skipping - no <scotch.h> found"
exit 1
exit 2
}
if [ -f "$SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h" ] && \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment