Commit 363691ff authored by mark's avatar mark
Browse files

STYLE: inconsistency in scotch, metis library locations

- avoid leaving any duplicate run-time libraries about that are
  not part of the LD_LIBRARY_PATH.

- incorrect ADIOS library path reported
parent 6b8eecff
......@@ -52,6 +52,25 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
warnBuildIssues()
{
echo
echo " ---------------------------------------------------"
echo " Optional component ($1) had build issues"
echo " OpenFOAM will nonetheless remain largely functional"
echo " ---------------------------------------------------"
echo
}
warnNotFound()
{
echo " Optional component ($1) was not found"
echo
}
#------------------------------------------------------------------------------
echo
echo ========================================
echo Start ThirdParty Allwmake
......@@ -216,6 +235,8 @@ elif [ -d "$SCOTCH_VERSION" ]
then
(
cd $SCOTCH_VERSION/src || exit 1
rm -rf $SCOTCH_ARCH_PATH
applyPatch $SCOTCH_VERSION .. # patch at parent-level
prefixDIR=$SCOTCH_ARCH_PATH
......@@ -248,15 +269,16 @@ then
# cleanup, could also remove Makefile.inc
make realclean 2>/dev/null
)
) || warnBuildIssues SCOTCH
else
echo " Optional component (SCOTCH) was not found"
warnNotFound SCOTCH
fi
# build ptscotch if MPI (ThirdParty or system) is available
# and there is a scotch include available (ie, normal scotch was built)
# Build ptscotch if MPI (ThirdParty or system) is available
# and normal scotch was build (has include and library)
if [ "${FOAM_MPI:-dummy}" != dummy ] && \
[ -f $SCOTCH_ARCH_PATH/include/scotch.h ] || \
[ -f $SCOTCH_ARCH_PATH/include/scotch.h \
-a -r $FOAM_EXT_LIBBIN/libscotch.so ] || \
{
echo
echo " WARNING: skipping pt-scotch - 'scotch.h' include file not found!"
......@@ -314,7 +336,7 @@ then
)
fi
# verify existence of scotch include
# verify existence of ptscotch include
[ -f $SCOTCH_ARCH_PATH/include/$FOAM_MPI/ptscotch.h ] || {
echo
echo " WARNING: required include file 'ptscotch.h' not found!"
......@@ -334,66 +356,53 @@ if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis)
then
. $settings
fi
if [ -d "$METIS_VERSION" ]
if [ -f $METIS_ARCH_PATH/include/metis.h \
-a -r $FOAM_EXT_LIBBIN/libmetis.so ]
then
echo " metis header in $METIS_ARCH_PATH/include"
echo " metis libs in $FOAM_EXT_LIBBIN"
echo
elif [ -d "$METIS_VERSION" ]
then
(
cd $METIS_VERSION || exit 1
rm -rf $METIS_ARCH_PATH
case "$WM_PRECISION_OPTION" in
SP)
WM_SCALAR_SIZE=32
;;
DP)
WM_SCALAR_SIZE=64
;;
*)
echo " Metis pre-configure error:"
echo " WM_PRECISION_OPTION neither DP nor SP"
exit 1
esac
if [ -f $METIS_ARCH_PATH/include/metis.h \
-a -r $FOAM_EXT_LIBBIN/libmetis.so ]
then
echo " metis header in $METIS_ARCH_PATH/include"
echo " metis libs in $FOAM_EXT_LIBBIN"
echo
else
(
set -x
cd $METIS_VERSION || exit 1
# Change user settings automatically
sed -i -e 's=\(#define IDXTYPEWIDTH\).*=\1 '$WM_LABEL_SIZE'=' \
-e 's=\(#define REALTYPEWIDTH\).*=\1 '$WM_SCALAR_SIZE'=' \
include/metis.h
if [ "$WM_PRECISION_OPTION" = "DP" ]
then
FLOAT_PRECISION=64
elif [ "$WM_PRECISION_OPTION" = "SP" ]
then
FLOAT_PRECISION=32
else
echo " Metis pre-configure error:"
echo " WM_PRECISION_OPTION is neither DP nor SP"
exit 1
fi
# No config option for the library location.
# - build normally and use mv to relocate it
# Change user settings automatically
sed -i -e 's=\(#define IDXTYPEWIDTH\).*=\1 '$WM_LABEL_SIZE'=' \
-e 's=\(#define REALTYPEWIDTH\).*=\1 '$FLOAT_PRECISION'=' \
include/metis.h
make config shared=true prefix=$METIS_ARCH_PATH \
&& make -j $WM_NCOMPPROCS install \
&& mv $METIS_ARCH_PATH/lib/libmetis.so $FOAM_EXT_LIBBIN
make config shared=1 prefix=$METIS_ARCH_PATH
make -j $WM_NCOMPPROCS install
cp $METIS_ARCH_PATH/lib/libmetis.so $FOAM_EXT_LIBBIN
)
fi
rmdir $METIS_ARCH_PATH/lib 2>/dev/null || true # failure is not critical
) || warnBuildIssues METIS
else
echo " Optional component (METIS) was not found"
warnNotFound METIS
fi
#------------------------------------------------------------------------------
warnBuildIssues()
{
echo
echo " ---------------------------------------------------"
echo " Optional component ($1) had build issues"
echo " OpenFOAM will nonetheless remain largely functional"
echo " ---------------------------------------------------"
echo
}
warnNotFound()
{
echo " Optional component ($1) was not found"
echo
}
# CGAL is optional
echo
echo ========================================
......
......@@ -127,7 +127,8 @@ if [ -f $ADIOS_ARCH_PATH/include/adios.h \
-a -r $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios_${FOAM_MPI}.a ]
then
echo " ADIOS header in $ADIOS_ARCH_PATH/include"
echo " ADIOS libs in $FOAM_EXT_LIBBIN"
### echo " ADIOS libs in $FOAM_EXT_LIBBIN" # dynamic
echo " ADIOS libs in $ADIOS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" # static
echo
else
(
......
Supports Markdown
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