COMP: improve robustness and warning messages when building paraview plugins

This commit is contained in:
Mark Olesen
2016-06-17 09:31:41 +02:00
parent 98e951e8ba
commit 97943ed819
10 changed files with 140 additions and 61 deletions

View File

@ -3,12 +3,6 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for compilation (at least for error catching)
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
# Get CGAL and boost versions
. $WM_PROJECT_DIR/etc/config.sh/functions
_foamEval SOURCE_CGAL_VERSIONS_ONLY=yes \
$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL)
set -x
wmake -all blockMesh
@ -16,10 +10,6 @@ wmake -all extrude
wmake -all extrude2DMesh
wmake -all snappyHexMesh
if [ -n "$CGAL_ARCH_PATH" -o "$cgal_version" = "cgal-system" ]
then
foamyMesh/Allwmake $*
fi
foamyMesh/Allwmake $*
#------------------------------------------------------------------------------

View File

@ -4,15 +4,21 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType conformalVoronoiMesh
wmake $targetType conformalVoronoi2DMesh
wmake foamyQuadMesh
wmake foamyHexMesh
#wmake foamyHexMeshBackgroundMesh
#(cd foamyHexMeshSurfaceSimplify && ./Allwmake)
#wmake cellSizeAndAlignmentGrid
if [ -d "$CGAL_ARCH_PATH/include/CGAL" ] || \
[ "${CGAL_ARCH_PATH##*-}" = system -a -d /usr/include/CGAL ]
then
set -x
wmake $targetType conformalVoronoiMesh
wmake $targetType conformalVoronoi2DMesh
wmake foamyQuadMesh
wmake foamyHexMesh
# wmake foamyHexMeshBackgroundMesh
# (cd foamyHexMeshSurfaceSimplify && ./Allwmake)
# wmake cellSizeAndAlignmentGrid
else
echo "WARNING: cannot build ${PWD##*/} without CGAL"
fi
#------------------------------------------------------------------------------

View File

@ -1,32 +1,66 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Optional unit: continue-on-error
export WM_CONTINUE_ON_ERROR=true
# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
#set -x
#
# There are several prerequisites for building a plugin
#
#set -x
canBuildPlugin()
{
[ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] || {
echo
echo "WARNING: cannot build ParaView plugin(s) without paraview directory"
echo " ParaView_DIR=$ParaView_DIR"
echo
return 1
}
[ -n "$PV_PLUGIN_PATH" ] || {
echo
echo "${PWD##*/} : invalid PV_PLUGIN_PATH for building ParaView plugin(s)"
echo " PV_PLUGIN_PATH=${PV_PLUGIN_PATH:-unset}"
echo
return 1
}
type cmake > /dev/null 2>&1 || {
echo
echo "WARNING: cannot build ParaView plugin(s) without cmake"
echo
return 1
}
return 0 # success
}
# -----------------------------------------------------------------------------
case "$ParaView_VERSION" in
3*)
if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]
if canBuildPlugin
then
[ -n "$PV_PLUGIN_PATH" ] || {
echo "$0 : PV_PLUGIN_PATH not valid - it is unset"
exit 1
}
# ensure CMake gets the correct C++ compiler
(
# C++ compiler for CMake
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
wmake $targetType vtkPV3Readers
PV3blockMeshReader/Allwmake $*
PV3FoamReader/Allwmake $*
else
echo "ERROR: ParaView not found in $ParaView_DIR"
)
fi
;;
*)
echo "WARN: PV3 readers not building: ParaView_VERSION=$ParaView_VERSION"
echo
echo "NOTE: skipping build of ParaView V3 plugin(s)"
echo " different version: ParaView_VERSION=$ParaView_VERSION"
echo
;;
esac

View File

@ -1,32 +1,66 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Optional unit: continue-on-error
export WM_CONTINUE_ON_ERROR=true
# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
#set -x
#
# There are several prerequisites for building a plugin
#
#set -x
canBuildPlugin()
{
[ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ] || {
echo
echo "WARNING: cannot build ParaView plugin(s) without paraview directory"
echo " ParaView_DIR=$ParaView_DIR"
echo
return 1
}
[ -n "$PV_PLUGIN_PATH" ] || {
echo
echo "${PWD##*/} : invalid PV_PLUGIN_PATH for building ParaView plugin(s)"
echo " PV_PLUGIN_PATH=${PV_PLUGIN_PATH:-unset}"
echo
return 1
}
type cmake > /dev/null 2>&1 || {
echo
echo "WARNING: cannot build ParaView plugin(s) without cmake"
echo
return 1
}
return 0 # success
}
# -----------------------------------------------------------------------------
case "$ParaView_VERSION" in
4* | 5*)
if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]
if canBuildPlugin
then
[ -n "$PV_PLUGIN_PATH" ] || {
echo "$0 : PV_PLUGIN_PATH not valid - it is unset"
exit 1
}
# ensure CMake gets the correct C++ compiler
(
# C++ compiler for CMake
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
wmake $targetType vtkPVReaders
PVblockMeshReader/Allwmake $*
PVFoamReader/Allwmake $*
else
echo "ERROR: ParaView not found in $ParaView_DIR"
)
fi
;;
*)
echo "WARN: PV readers not building: ParaView_VERSION=$ParaView_VERSION"
echo
echo "NOTE: skipping build of ParaView plugin(s)"
echo " different version: ParaView_VERSION=$ParaView_VERSION"
echo
;;
esac

View File

@ -2,14 +2,18 @@
cd ${0%/*} || exit 1 # Run from this directory
set -x
if [ -z "$CGAL_ARCH_PATH" ]
unset COMPILE_FLAGS LINK_FLAGS
if [ -d "$CGAL_ARCH_PATH/include/CGAL" ] || \
[ "${CGAL_ARCH_PATH##*-}" = system -a -d /usr/include/CGAL ]
then
export COMPILE_FLAGS="-DNO_CGAL"
else
wmake PolyhedronReader
export COMPILE_FLAGS='-IPolyhedronReader'
export LINK_FLAGS='${CGAL_LIBS} -lPolyhedronReader'
else
export COMPILE_FLAGS="-DNO_CGAL"
fi
wmake
# ----------------------------------------------------------------- end-of-file

View File

@ -15,7 +15,6 @@ EXE_INC = \
${CGAL_INC} \
${c++CGALWARN} \
$(COMPILE_FLAGS) \
-IPolyhedronReader \
-I$(FOAM_SRC)/surfMesh/lnInclude \
-I$(FOAM_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/edgeMesh/lnInclude \