From f450b35fd449860b3bbf5f4872f3a88d1dc495e2 Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Mon, 24 Nov 2014 15:15:37 +0100 Subject: [PATCH] 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 --- .../LocalDev/Hydro-Quebec/PyFoam/AllMake | 39 ++++++++++--------- ThirdParty/PyFoamSiteScripts/bin/.gitStandin | 0 ThirdParty/PyFoamSiteScripts/etc/.gitStandin | 0 ThirdParty/PyFoamSiteScripts/lib/.gitStandin | 0 etc/settings.sh | 9 +++++ 5 files changed, 29 insertions(+), 19 deletions(-) create mode 100644 ThirdParty/PyFoamSiteScripts/bin/.gitStandin create mode 100644 ThirdParty/PyFoamSiteScripts/etc/.gitStandin create mode 100644 ThirdParty/PyFoamSiteScripts/lib/.gitStandin diff --git a/ThirdParty/LocalDev/Hydro-Quebec/PyFoam/AllMake b/ThirdParty/LocalDev/Hydro-Quebec/PyFoam/AllMake index c2b91b106..05f727c63 100755 --- a/ThirdParty/LocalDev/Hydro-Quebec/PyFoam/AllMake +++ b/ThirdParty/LocalDev/Hydro-Quebec/PyFoam/AllMake @@ -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 - - diff --git a/ThirdParty/PyFoamSiteScripts/bin/.gitStandin b/ThirdParty/PyFoamSiteScripts/bin/.gitStandin new file mode 100644 index 000000000..e69de29bb diff --git a/ThirdParty/PyFoamSiteScripts/etc/.gitStandin b/ThirdParty/PyFoamSiteScripts/etc/.gitStandin new file mode 100644 index 000000000..e69de29bb diff --git a/ThirdParty/PyFoamSiteScripts/lib/.gitStandin b/ThirdParty/PyFoamSiteScripts/lib/.gitStandin new file mode 100644 index 000000000..e69de29bb diff --git a/etc/settings.sh b/etc/settings.sh index 19cf15ba9..fd6001e2d 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -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 ] && {