Skip to content

Commit

Permalink
makeParaView: Provide feedback if ParaView version is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Bainbridge committed Jul 5, 2024
1 parent 16b85c3 commit 0840c1e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
6 changes: 2 additions & 4 deletions etc/tools/ParaViewFunctions
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,12 @@ setVersion()
{
if [ "$#" -ge 1 ]
then
ParaView_VERSION="${1##paraview-}"
export ParaView_VERSION="$1"
fi

# The major version is "<digits>.<digits>"
ParaView_MAJOR=$(echo $ParaView_VERSION | \
export ParaView_MAJOR=$(echo $ParaView_VERSION | \
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')

export ParaView_VERSION ParaView_MAJOR
}


Expand Down
37 changes: 33 additions & 4 deletions makeParaView
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. $WM_PROJECT_DIR/etc/config.sh/functions
. etc/tools/ThirdPartyFunctions
. etc/tools/ParaViewFunctions
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -110,10 +111,9 @@ For finer control, the build stages can be selected or deselected individually:
-make -no-make
-install -no-install
* Make and install paraview-$ParaView_VERSION located under
* Make and install ParaView-$ParaView_VERSION located under
\$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/ParaView-$ParaView_VERSION
USAGE
exit 1
Expand All @@ -133,7 +133,7 @@ case "$Script" in *-mpi*) withMPI=true;; esac
case "$Script" in *-python*) withPYTHON=true;; esac
case "$Script" in *-qt*) withQT=true;; esac

# set ParaView_MAJOR based on current value of ParaView_VERSION
# set ParaView_MAJOR based on current value of ParaView_VERSION (if any)
setVersion

#
Expand All @@ -150,6 +150,14 @@ do
-h | -help)
usage
;;
paraview-*)
setVersion "${2##paraview-*}"
shift 2
;;
ParaView-*)
setVersion "${2##ParaView-*}"
shift 2
;;
[A-Z]*=*) # cmake variables
addCMakeVariable "$1"
shift
Expand Down Expand Up @@ -272,13 +280,34 @@ do
esac
done


# If we don't have a version, then try to detect it
if [ -z "$ParaView_VERSION" ]
then
ParaView_SOURCE_DIR=$(_foamMostRecentDir ParaView-*)
if [ -d "$ParaView_SOURCE_DIR" ]
then
setVersion "${ParaView_SOURCE_DIR##*ParaView-}"
fi
fi

# If we still don't have a version, then quit, asking the user to specify one
if [ -z "$ParaView_VERSION" ]
then
ParaView_VERSION=?.?.?
usage "The version was not specified on the command line, set in the OpenFOAM
configuration, or detected on disk. Specify a version with '-version VER'."
fi


if [ "$runDEFAULT" = true ]
then
: ${runCONFIG:=true}
: ${runMAKE:=true}
: ${runINSTALL:=true}
fi


# Download ParaView sources
#~~~~~~~~~~~~~~~~~~~~~~~~~~
downloadParaView || usage "ParaView download failed. Re-run to retry download"
Expand Down

0 comments on commit 0840c1e

Please sign in to comment.