mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: foamConfigurePaths given scotch version and path arguments
This commit is contained in:
@ -41,6 +41,8 @@ usage: ${0##*/}
|
|||||||
--archOption arch specify architecture option (only 32 or 64 applicable)
|
--archOption arch specify architecture option (only 32 or 64 applicable)
|
||||||
--paraviewInstall dir specify ParaView_DIR (e.g. /opt/paraviewopenfoam3120)
|
--paraviewInstall dir specify ParaView_DIR (e.g. /opt/paraviewopenfoam3120)
|
||||||
--paraviewVersion ver specify ParaView_VERSION (e.g. 3.12.0)
|
--paraviewVersion ver specify ParaView_VERSION (e.g. 3.12.0)
|
||||||
|
--scotchArchPath dir specify SCOTCH_ARCH_PATH (e.g. /opt/OpenFOAM-scotch-6.0.0/)
|
||||||
|
--scotchVersion ver specify SCOTCH_VERSION (e.g. 6.0.0)
|
||||||
|
|
||||||
* hardcode paths to installation
|
* hardcode paths to installation
|
||||||
|
|
||||||
@ -49,32 +51,6 @@ USAGE
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Function to do replacement on file. Checks if any replacement has been done.
|
|
||||||
# inlineSed <file> <sedCommand> <description>
|
|
||||||
#_inlineSed()
|
|
||||||
#{
|
|
||||||
# [ -f "$1" ] || {
|
|
||||||
# echo "Missing file: $1"
|
|
||||||
# exit 1
|
|
||||||
# }
|
|
||||||
#
|
|
||||||
# backup="temp.$$"
|
|
||||||
# cp $1 $backup
|
|
||||||
# sed -i -e "$2" $1
|
|
||||||
#
|
|
||||||
# if cmp $1 $backup > /dev/null 2>&1
|
|
||||||
# then
|
|
||||||
# echo "Failed: $3 in $1"
|
|
||||||
# rm $backup 2>/dev/null
|
|
||||||
# exit 1
|
|
||||||
# else
|
|
||||||
# echo "Okay: $3 in $1"
|
|
||||||
# rm $backup 2>/dev/null
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# return 0
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Function to do replacement on file. Checks if any replacement has been done.
|
# Function to do replacement on file. Checks if any replacement has been done.
|
||||||
# _inlineSed <file> <regexp> <replacement> <msg>
|
# _inlineSed <file> <regexp> <replacement> <msg>
|
||||||
_inlineSed()
|
_inlineSed()
|
||||||
@ -103,7 +79,8 @@ _inlineSed()
|
|||||||
|
|
||||||
[ -f etc/bashrc ] || usage "Please run from top-level directory of installation"
|
[ -f etc/bashrc ] || usage "Please run from top-level directory of installation"
|
||||||
|
|
||||||
unset foamInstall projectName projectVersion archOption paraviewInstall
|
unset foamInstall projectName projectVersion archOption
|
||||||
|
unset paraviewInstall scotchArchPath
|
||||||
|
|
||||||
# parse options
|
# parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
@ -186,13 +163,36 @@ do
|
|||||||
"Replacing ParaView_VERSION setting by '$paraviewVersion'"
|
"Replacing ParaView_VERSION setting by '$paraviewVersion'"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
-scotchVersion | --scotchVersion)
|
||||||
|
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
|
||||||
|
scotchVersion="$2"
|
||||||
|
_inlineSed \
|
||||||
|
etc/config/scotch.sh \
|
||||||
|
'SCOTCH_VERSION=.*' \
|
||||||
|
'SCOTCH_VERSION='"$scotchVersion" \
|
||||||
|
"Replacing SCOTCH_VERSION setting by '$scotchVersion'"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
-scotchArchPath | --scotchArchPath)
|
||||||
|
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
|
||||||
|
scotchArchPath="$2"
|
||||||
|
_inlineSed \
|
||||||
|
etc/config/scotch.sh \
|
||||||
|
'SCOTCH_ARCH_PATH=.*' \
|
||||||
|
'SCOTCH_ARCH_PATH='"$scotchArchPath" \
|
||||||
|
"Replacing SCOTCH_ARCH_PATH setting by '$scotchArchPath'"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage "unknown option/argument: '$*'"
|
usage "unknown option/argument: '$*'"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -n "$foamInstall" -o -n "$projectName" -o -n "$projectVersion" -o -n "$archOption" -o -n "$paraviewInstall" -o -n "$paraviewVersion" ] || usage "Please specify at least one configure option"
|
[ -n "$foamInstall" -o -n "$projectName" -o -n "$projectVersion" -o -n "$archOption" \
|
||||||
|
-o -n "$paraviewInstall" -o -n "$paraviewVersion" \
|
||||||
|
-o -n "$scotchVersion" -o -n "$scotchArchPath" \
|
||||||
|
] || usage "Please specify at least one configure option"
|
||||||
|
|
||||||
#echo "Replacing WM_PROJECT setting by '$projectName'"
|
#echo "Replacing WM_PROJECT setting by '$projectName'"
|
||||||
#sed -i -e 's@WM_PROJECT=.*@WM_PROJECT='"$projectName@" etc/bashrc
|
#sed -i -e 's@WM_PROJECT=.*@WM_PROJECT='"$projectName@" etc/bashrc
|
||||||
|
|||||||
Reference in New Issue
Block a user