From bcaaa26a75b5bfe29a2b4c697bca3fe487937d12 Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Thu, 11 Jul 2013 17:46:01 +0200 Subject: [PATCH 1/7] Allow having a second installation of the same version without touching the sources --HG-- branch : bgschaid/minorAdditionsBranch --- etc/bashrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/bashrc b/etc/bashrc index 381e6e129..7298cd29a 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -34,6 +34,10 @@ export WM_PROJECT=OpenFOAM export WM_PROJECT_VERSION=1.6-ext +if [ -n "$WM_PROJECT_VERSION_ADDITION" ] +then + export WM_PROJECT_VERSION=$WM_PROJECT_VERSION-$WM_PROJECT_VERSION_ADDITION +fi # helps to easily write #ifdefs to detect a dev-version export FOAM_DEV=1 From 9bfd822a9b183f2000a9907ce26d7ce29ba33b19 Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Thu, 11 Jul 2013 18:21:35 +0200 Subject: [PATCH 2/7] Move the site configuration up so that WM_THIRD_PARTY_DIR can be unset before it is set --HG-- branch : bgschaid/minorAdditionsBranch --- etc/bashrc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index 7298cd29a..70f6f6ee8 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -78,12 +78,6 @@ export WM_PROJECT_INST_DIR=$FOAM_INST_DIR export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION : ${WM_PROJECT_USER_DIR:=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION}; export WM_PROJECT_USER_DIR - -# Location of third-party software -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#: ${WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION}; export WM_THIRD_PARTY_DIR -: ${WM_THIRD_PARTY_DIR=$WM_PROJECT_DIR/ThirdParty}; export WM_THIRD_PARTY_DIR - # Source files, possibly with some verbosity _foamSource() { @@ -99,6 +93,12 @@ _foamSource() foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` && _foamSource $foamPrefs unset foamPrefs + +# Location of third-party software +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +#: ${WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION}; export WM_THIRD_PARTY_DIR +: ${WM_THIRD_PARTY_DIR=$WM_PROJECT_DIR/ThirdParty}; export WM_THIRD_PARTY_DIR + # Evaluate command-line parameters while [ $# -gt 0 ] do From e17e20289ab5caeed4eaac24184711704f2c396b Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Thu, 11 Jul 2013 18:22:11 +0200 Subject: [PATCH 3/7] Add the possibility to inject variables BEFORE WM_PROJECT_DIR is set --HG-- branch : bgschaid/minorAdditionsBranch --- .gitignore | 3 +++ .hgignore | 3 +++ etc/bashrc | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/.gitignore b/.gitignore index 88b59834b..10a017af9 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,9 @@ etc/bashrc etc/settings.csh etc/settings.sh +# make sure that this settings file is not used +etc/bashrc.preset + # The following files are blacklisted because of a DMCA complaint by ANSYS. src/lduSolvers/tools/PriorityArray.C src/lduSolvers/tools/PriorityArray.H diff --git a/.hgignore b/.hgignore index b256cc978..ff3ef0f1f 100644 --- a/.hgignore +++ b/.hgignore @@ -77,6 +77,9 @@ PlyParser_FoamFileParser_parsetab.py # .gitignore .timeStamp +# make sure that this settings file is not used +etc/bashrc.preset + #Test-Harness generated stuff testHarness/OpenFOAM/1.6-ext/runDir/tutorialsTestSuites_oneTimeStep testHarness/OpenFOAM/1.6-ext/runDir/Testing diff --git a/etc/bashrc b/etc/bashrc index 70f6f6ee8..00d8ff419 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -32,6 +32,14 @@ # #------------------------------------------------------------------------------ +prefSettingFile=$0.preset +if [ -f $prefSettingFile ] +then + # echo "Found presettings $prefSettingFile" + . $prefSettingFile +fi + + export WM_PROJECT=OpenFOAM export WM_PROJECT_VERSION=1.6-ext if [ -n "$WM_PROJECT_VERSION_ADDITION" ] From 298d5fc0fe24e336964e57e5e32cd55aa1586c05 Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Thu, 11 Jul 2013 18:26:35 +0200 Subject: [PATCH 4/7] Remove duplicates (probably from rebasing) from .gitignore and add to .hgignore --HG-- branch : bgschaid/minorAdditionsBranch --- .gitignore | 96 ------------------------------------------------------ .hgignore | 10 ++++++ 2 files changed, 10 insertions(+), 96 deletions(-) diff --git a/.gitignore b/.gitignore index 10a017af9..c64431797 100644 --- a/.gitignore +++ b/.gitignore @@ -96,100 +96,4 @@ src/lduSolvers/amg/amgPolicy/samgPolicy.H src/lduSolvers/amg/amgPolicy/aamgPolicy.C src/lduSolvers/amg/amgPolicy/aamgPolicy.H -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - -# The following files are blacklisted because of a DMCA complaint by ANSYS. -src/lduSolvers/tools/PriorityArray.C -src/lduSolvers/tools/PriorityArray.H -src/lduSolvers/amg/amgPolicy/samgPolicy.C -src/lduSolvers/amg/amgPolicy/samgPolicy.H -src/lduSolvers/amg/amgPolicy/aamgPolicy.C -src/lduSolvers/amg/amgPolicy/aamgPolicy.H - # end-of-file diff --git a/.hgignore b/.hgignore index ff3ef0f1f..b7d2d7028 100644 --- a/.hgignore +++ b/.hgignore @@ -88,3 +88,13 @@ testHarness/OpenFOAM/1.6-ext/runDir/CTestTestfile.cmake testHarness/OpenFOAM/1.6-ext/runDir/DartConfiguration.tcl testHarness/OpenFOAM/1.6-ext/runDir/Makefile testHarness/OpenFOAM/1.6-ext/runDir/cmake_install.cmake + +# The following files are blacklisted because of a DMCA complaint by ANSYS. +src/lduSolvers/tools/PriorityArray.C +src/lduSolvers/tools/PriorityArray.H +src/lduSolvers/amg/amgPolicy/samgPolicy.C +src/lduSolvers/amg/amgPolicy/samgPolicy.H +src/lduSolvers/amg/amgPolicy/aamgPolicy.C +src/lduSolvers/amg/amgPolicy/aamgPolicy.H + +# end-of-file From 7ac8e597dec92cbed74b9608a74d40631f755262 Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Thu, 11 Jul 2013 19:19:57 +0200 Subject: [PATCH 5/7] Fix strange results when using a zsh --HG-- branch : bgschaid/minorAdditionsBranch --- etc/bashrc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index 00d8ff419..db2a10e54 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -261,8 +261,12 @@ Darwin) # Make sure that binaries use the best features of the used OS-Version # We need to get rid of the revision number from this string. eg turn "10.7.5" into "10.7" - v=(`sw_vers -productVersion | sed 's/\./ /g'`) - export MACOSX_DEPLOYMENT_TARGET="${v[0]}.${v[1]}" + + # this gives strange results with some shells + # v=(`sw_vers -productVersion | sed 's/\./ /g'`) + # export MACOSX_DEPLOYMENT_TARGET="${v[0]}.${v[1]}" + + export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion | sed -e "s/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1.\2/g"` if [ "$compilerInstall" == "System" ] then From bb0d8e90a621a96c5cc0c77f6c980849ab9008fb Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Thu, 11 Jul 2013 19:20:30 +0200 Subject: [PATCH 6/7] Make sure that MacPorts never gets to the DYLD_LIBRARY_PATH --HG-- branch : bgschaid/minorAdditionsBranch --- etc/settings.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etc/settings.sh b/etc/settings.sh index 042269c11..e6a1bb0a3 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -49,7 +49,11 @@ _foamAddLib() export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH if [ "$WM_ARCH_BASE" = "darwin" ] then - export DYLD_LIBRARY_PATH=$1:$DYLD_LIBRARY_PATH + # do NOT add the lib of MacPort as this might break programs + if [ "$1" != "/opt/local/lib" ] + then + export DYLD_LIBRARY_PATH=$1:$DYLD_LIBRARY_PATH + fi fi shift done From 1713e3dcf96937b9fc602975a3b469f2ce118b6b Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Fri, 12 Jul 2013 00:58:42 +0200 Subject: [PATCH 7/7] On Mac use different compilers with the same settings if no separate configuration directory is set --HG-- branch : bgschaid/minorAdditionsBranch --- etc/bashrc | 80 ++++++++++++++++++++++++++--------- etc/settings.sh | 24 ++++++----- wmake/rules/darwinIntel64/c | 2 +- wmake/rules/darwinIntel64/c++ | 2 +- 4 files changed, 76 insertions(+), 32 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index db2a10e54..4baf7024e 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -268,26 +268,68 @@ Darwin) export MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion | sed -e "s/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\)/\1.\2/g"` - if [ "$compilerInstall" == "System" ] + which -s port >/dev/null + if [ $? -eq "0" -a -d '/opt/local/etc/macports' ] then - # Use Mac-Ports-Compiler instead of Apple-gcc-4.2 - case $WM_COMPILER in - Gcc43) - export WM_CC='gcc-mp-4.3' - export WM_CXX='g++-mp-4.3' - ;; - Gcc44) - export WM_CC='gcc-mp-4.4' - export WM_CXX='g++-mp-4.4' - ;; - Gcc45) - export WM_CC='gcc-mp-4.5' - export WM_CXX='g++-mp-4.5' - ;; - *) - export WM_COMPILER= - ;; - esac + if [ "$FOAM_VERBOSE" -a "$PS1" ] + then + echo "Using Macports binaries" + fi + + export WM_USE_MACPORT=1 + + if [ "$compilerInstall" == "System" ] + then + # Use Mac-Ports-Compiler instead of Apple-gcc-4.2 + case $WM_COMPILER in + Gcc42) + export WM_MACPORT_VERSION=4.2 + ;; + Gcc43) + export WM_MACPORT_VERSION=4.3 + ;; + Gcc44) + export WM_MACPORT_VERSION=4.4 + ;; + Gcc45) + export WM_MACPORT_VERSION=4.5 + ;; + Gcc46) + export WM_MACPORT_VERSION=4.6 + ;; + Gcc47) + export WM_MACPORT_VERSION=4.7 + ;; + Gcc48) + export WM_MACPORT_VERSION=4.8 + ;; + Gcc) + ;; + *) + echo "Unsupported MacPorts-Compiler $WM_COMPILER" + ;; + esac + if [ "$WM_COMPILER" != "Gcc" ] + then + export WM_CC="gcc-mp-$WM_MACPORT_VERSION" + export WM_CXX="g++-mp-$WM_MACPORT_VERSION" + + ruleDirBase=$WM_DIR/rules/$WM_ARCH + ruleDir=$ruleDirBase$WM_COMPILER + if [ ! -e $ruleDir ] + then + echo "Rule directory $ruleDir not existing. Linking to $ruleDirBase" + ln -s $ruleDirBase $ruleDir + fi + unset ruleDir ruleDirBase + fi + fi + fi + if [ -z "$WM_CC" ] + then + # nobody set the compiler + export WM_CC="gcc" + export WM_CXX="g++" fi ;; diff --git a/etc/settings.sh b/etc/settings.sh index e6a1bb0a3..01fe4ed2a 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -187,17 +187,19 @@ fi unset compilerBin compilerLib compilerInstall -case "$WM_COMPILER" in -Gcc*) - export WM_CC='gcc' - export WM_CXX='g++' - ;; -Icc) - export WM_CC='icc' - export WM_CXX='icpc' - ;; -esac - +if [ -z "$WM_CC" ] +then + case "$WM_COMPILER" in + Gcc*) + export WM_CC='gcc' + export WM_CXX='g++' + ;; + Icc) + export WM_CC='icc' + export WM_CXX='icpc' + ;; + esac +fi # Communications library # ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/wmake/rules/darwinIntel64/c b/wmake/rules/darwinIntel64/c index a686d4eeb..7d81ffc19 100644 --- a/wmake/rules/darwinIntel64/c +++ b/wmake/rules/darwinIntel64/c @@ -2,7 +2,7 @@ cWARN = -Wall -cc = gcc $(WM_CXXFLAGS) +cc = $(WM_CC) $(WM_CXXFLAGS) include $(RULES)/c$(WM_COMPILE_OPTION) diff --git a/wmake/rules/darwinIntel64/c++ b/wmake/rules/darwinIntel64/c++ index 27fcb0c34..27b66c29e 100644 --- a/wmake/rules/darwinIntel64/c++ +++ b/wmake/rules/darwinIntel64/c++ @@ -2,7 +2,7 @@ c++WARN = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -CC = g++ $(WM_CXXFLAGS) +CC = $(WM_CXX) $(WM_CXXFLAGS) include $(RULES)/c++$(WM_COMPILE_OPTION)