Add a separate directory for scripts and libraries not part of the PyFoam-distribution. This will only work with Pyfoam 0.6.4 or later
This commit is contained in:
parent
5e5c8a8afc
commit
f450b35fd4
5 changed files with 29 additions and 19 deletions
39
ThirdParty/LocalDev/Hydro-Quebec/PyFoam/AllMake
vendored
39
ThirdParty/LocalDev/Hydro-Quebec/PyFoam/AllMake
vendored
|
@ -36,43 +36,46 @@
|
|||
command -v python -V >/dev/null
|
||||
if [ ! $? -eq 0 ];
|
||||
then
|
||||
echo "Error: You need to install python in order to run these PyFoam scripts"
|
||||
echo "Error: You need to install python in order to run these PyFoam scripts"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if [ -z "$PYFOAM_DIR" ]
|
||||
if [ -z "$PYFOAM_SITE_DIR" ]
|
||||
then
|
||||
echo "Error: Missing environment variable \$PYFOAM_DIR."
|
||||
echo " Please execute the script ThirdParty/AllMake.stage5 to install PyFoam."
|
||||
echo "Error: Missing environment variable \$PYFOAM_SITE_DIR."
|
||||
echo " Please execute the script ThirdParty/AllMake.stage5 to install PyFoam."
|
||||
echo " Then, make sure to freshen your foam-extend environment by sourcing your main"
|
||||
echo " foam-extend configuration file."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
pythonVersion=$(python -V 2>&1 | awk -F ' ' {'print $2'} | awk -F \. {'print $1 "." $2'})
|
||||
|
||||
set -x
|
||||
if [ ! -d $PYFOAM_SITE_DIR/lib -o ! -d $PYFOAM_SITE_DIR/bin ]
|
||||
then
|
||||
echo "Directory $PYFOAM_SITE_DIR/lib or $PYFOAM_SITE_DIR/bin missing"
|
||||
exit -1
|
||||
fi
|
||||
set -x
|
||||
|
||||
# pyFoamChangeMixingPlaneBoundary.py
|
||||
cp pyFoamChangeMixingPlaneBoundary.py $PYFOAM_DIR/bin
|
||||
cp ChangeMixingPlaneBoundary.py $PYFOAM_DIR/lib/python$pythonVersion/site-packages/PyFoam/Applications
|
||||
cp pyFoamChangeMixingPlaneBoundary.py $PYFOAM_SITE_DIR/bin
|
||||
cp ChangeMixingPlaneBoundary.py $PYFOAM_SITE_DIR/lib
|
||||
|
||||
# pyFoamChangeGGIBoundary.py
|
||||
# Same as pyFoamModifyGGIBoundary.py. We just harmonize the name with rest of PyFoam
|
||||
cp pyFoamChangeGGIBoundary.py $PYFOAM_DIR/bin
|
||||
cp ChangeGGIBoundary.py $PYFOAM_DIR/lib/python$pythonVersion/site-packages/PyFoam/Applications
|
||||
cp pyFoamChangeGGIBoundary.py $PYFOAM_SITE_DIR/bin
|
||||
cp ChangeGGIBoundary.py $PYFOAM_SITE_DIR/lib
|
||||
|
||||
# pyFoamInitializeMixingPlane.py
|
||||
cp pyFoamInitMixingPlaneInterface.py $PYFOAM_DIR/bin
|
||||
cp InitMixingPlaneInterface.py $PYFOAM_DIR/lib/python$pythonVersion/site-packages/PyFoam/Applications
|
||||
cp pyFoamInitMixingPlaneInterface.py $PYFOAM_SITE_DIR/bin
|
||||
cp InitMixingPlaneInterface.py $PYFOAM_SITE_DIR/lib
|
||||
|
||||
# pyFoamInitializeGGI.py
|
||||
cp pyFoamInitGgiInterface.py $PYFOAM_DIR/bin
|
||||
cp InitGgiInterface.py $PYFOAM_DIR/lib/python$pythonVersion/site-packages/PyFoam/Applications
|
||||
cp pyFoamInitGgiInterface.py $PYFOAM_SITE_DIR/bin
|
||||
cp InitGgiInterface.py $PYFOAM_SITE_DIR/lib
|
||||
|
||||
# pyFoamConvertMixingPlaneBoundaryToNewSyntax.py
|
||||
cp pyFoamConvertMixingPlaneBoundaryToNewSyntax.py $PYFOAM_DIR/bin
|
||||
cp ConvertMixingPlaneBoundaryToNewSyntax.py $PYFOAM_DIR/lib/python$pythonVersion/site-packages/PyFoam/Applications
|
||||
cp pyFoamConvertMixingPlaneBoundaryToNewSyntax.py $PYFOAM_SITE_DIR/bin
|
||||
cp ConvertMixingPlaneBoundaryToNewSyntax.py $PYFOAM_SITE_DIR/lib
|
||||
|
||||
set +x
|
||||
echo ========================================
|
||||
|
@ -81,5 +84,3 @@ echo ========================================
|
|||
echo
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
|
||||
|
|
0
ThirdParty/PyFoamSiteScripts/bin/.gitStandin
vendored
Normal file
0
ThirdParty/PyFoamSiteScripts/bin/.gitStandin
vendored
Normal file
0
ThirdParty/PyFoamSiteScripts/etc/.gitStandin
vendored
Normal file
0
ThirdParty/PyFoamSiteScripts/etc/.gitStandin
vendored
Normal file
0
ThirdParty/PyFoamSiteScripts/lib/.gitStandin
vendored
Normal file
0
ThirdParty/PyFoamSiteScripts/lib/.gitStandin
vendored
Normal file
|
@ -640,6 +640,15 @@ export MPI_BUFFER_SIZE
|
|||
}
|
||||
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PYFOAM_DIR is initialized to: $PYFOAM_DIR"
|
||||
|
||||
# Make sure that there is a special directory for special PyFoam-scripts
|
||||
[ -z "$PYFOAM_SITE_DIR" ] && export PYFOAM_SITE_DIR=$WM_THIRD_PARTY_DIR/PyFoamSiteScripts
|
||||
if [ -d $PYFOAM_SITE_DIR/bin ]
|
||||
then
|
||||
_foamAddPath $PYFOAM_SITE_DIR/bin
|
||||
fi
|
||||
|
||||
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PYFOAM_SITE_DIR is initialized to: $PYFOAM_SITE_DIR"
|
||||
|
||||
# Load hwloc
|
||||
# ~~~~~~~~~~~
|
||||
[ -z "$HWLOC_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/hwloc-1.7.2/platforms/$WM_OPTIONS ] && {
|
||||
|
|
Reference in a new issue