From 76b9563dc3f33356dc44217732ad2be3038f67fd Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 3 Jul 2017 23:54:50 +0100 Subject: new OpenFOAM June 2017 release: OpenFOAM-v1706 (#4652) - renamed develop version from 'plus' to 'develop' - patches now prefixed by corresponding OpenFOAM version number. This makes it easier to sort and see what old/junk exists. - remove MPI_BUFFER_SIZEk env variable (for all openfoam variants). The OpenFOAM shell setup addresses this and there is no reason to pollute the module environment at this stage. --- .../repos/builtin/packages/foam-extend/package.py | 1 - .../builtin/packages/openfoam-com/1612-bin.patch | 503 +++++++++++++++++++++ .../builtin/packages/openfoam-com/1612-build.patch | 17 + .../builtin/packages/openfoam-com/1612-etc.patch | 41 ++ .../packages/openfoam-com/1612-mgridgen-lib.patch | 41 ++ .../builtin/packages/openfoam-com/1612-mpi.patch | 36 ++ .../openfoam-com/1612-scotch-metis-lib.patch | 48 ++ .../builtin/packages/openfoam-com/1612-site.patch | 42 ++ .../packages/openfoam-com/1612-zoltan-lib.patch | 84 ++++ .../packages/openfoam-com/mgridgen-lib-1612.patch | 41 -- .../packages/openfoam-com/openfoam-bin-1612.patch | 503 --------------------- .../openfoam-com/openfoam-build-1612.patch | 17 - .../packages/openfoam-com/openfoam-etc-1612.patch | 41 -- .../packages/openfoam-com/openfoam-mpi-1612.patch | 36 -- .../packages/openfoam-com/openfoam-site-1612.patch | 42 -- .../packages/openfoam-com/openfoam-site-plus.patch | 35 -- .../packages/openfoam-com/openfoam-site.patch | 35 ++ .../repos/builtin/packages/openfoam-com/package.py | 44 +- .../openfoam-com/scotch-metis-lib-1612.patch | 48 -- .../packages/openfoam-com/zoltan-lib-1612.patch | 84 ---- .../builtin/packages/openfoam-org/41-etc.patch | 25 + .../builtin/packages/openfoam-org/41-site.patch | 42 ++ .../packages/openfoam-org/openfoam-etc-41.patch | 25 - .../packages/openfoam-org/openfoam-site-41.patch | 42 -- .../repos/builtin/packages/openfoam-org/package.py | 5 +- 25 files changed, 941 insertions(+), 937 deletions(-) create mode 100644 var/spack/repos/builtin/packages/openfoam-com/1612-bin.patch create mode 100644 var/spack/repos/builtin/packages/openfoam-com/1612-build.patch create mode 100644 var/spack/repos/builtin/packages/openfoam-com/1612-etc.patch create mode 100644 var/spack/repos/builtin/packages/openfoam-com/1612-mgridgen-lib.patch create mode 100644 var/spack/repos/builtin/packages/openfoam-com/1612-mpi.patch create mode 100644 var/spack/repos/builtin/packages/openfoam-com/1612-scotch-metis-lib.patch create mode 100644 var/spack/repos/builtin/packages/openfoam-com/1612-site.patch create mode 100644 var/spack/repos/builtin/packages/openfoam-com/1612-zoltan-lib.patch delete mode 100644 var/spack/repos/builtin/packages/openfoam-com/mgridgen-lib-1612.patch delete mode 100644 var/spack/repos/builtin/packages/openfoam-com/openfoam-bin-1612.patch delete mode 100644 var/spack/repos/builtin/packages/openfoam-com/openfoam-build-1612.patch delete mode 100644 var/spack/repos/builtin/packages/openfoam-com/openfoam-etc-1612.patch delete mode 100644 var/spack/repos/builtin/packages/openfoam-com/openfoam-mpi-1612.patch delete mode 100644 var/spack/repos/builtin/packages/openfoam-com/openfoam-site-1612.patch delete mode 100644 var/spack/repos/builtin/packages/openfoam-com/openfoam-site-plus.patch create mode 100644 var/spack/repos/builtin/packages/openfoam-com/openfoam-site.patch delete mode 100644 var/spack/repos/builtin/packages/openfoam-com/scotch-metis-lib-1612.patch delete mode 100644 var/spack/repos/builtin/packages/openfoam-com/zoltan-lib-1612.patch create mode 100644 var/spack/repos/builtin/packages/openfoam-org/41-etc.patch create mode 100644 var/spack/repos/builtin/packages/openfoam-org/41-site.patch delete mode 100644 var/spack/repos/builtin/packages/openfoam-org/openfoam-etc-41.patch delete mode 100644 var/spack/repos/builtin/packages/openfoam-org/openfoam-site-41.patch diff --git a/var/spack/repos/builtin/packages/foam-extend/package.py b/var/spack/repos/builtin/packages/foam-extend/package.py index a6776b182f..9e4a6c4d0b 100644 --- a/var/spack/repos/builtin/packages/foam-extend/package.py +++ b/var/spack/repos/builtin/packages/foam-extend/package.py @@ -143,7 +143,6 @@ class FoamExtend(Package): run_env.set('WM_PROJECT_DIR', self.projectdir) for d in ['wmake', self.archbin]: # bin already added automatically run_env.prepend_path('PATH', join_path(self.projectdir, d)) - run_env.set('MPI_BUFFER_SIZE', "20000000") def setup_dependent_environment(self, spack_env, run_env, dependent_spec): """Provide location of the OpenFOAM project. diff --git a/var/spack/repos/builtin/packages/openfoam-com/1612-bin.patch b/var/spack/repos/builtin/packages/openfoam-com/1612-bin.patch new file mode 100644 index 0000000000..b9e87a7ec8 --- /dev/null +++ b/var/spack/repos/builtin/packages/openfoam-com/1612-bin.patch @@ -0,0 +1,503 @@ +--- OpenFOAM-v1612+.orig/bin/foamEtcFile 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/bin/foamEtcFile 2017-03-23 10:08:37.296887070 +0100 +@@ -4,7 +4,7 @@ + # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + # \\ / O peration | + # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation +-# \\/ M anipulation | ++# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. + #------------------------------------------------------------------------------- + # License + # This file is part of OpenFOAM. +@@ -26,7 +26,7 @@ + # foamEtcFile + # + # Description +-# Locate user/group/shipped file with semantics similar to the ++# Locate user/group/other files with semantics similar to the + # ~OpenFOAM/fileName expansion. + # + # The -mode option can be used to allow chaining from +@@ -34,40 +34,53 @@ + # + # For example, within the user ~/.OpenFOAM//prefs.sh: + # \code +-# foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile -m go prefs.sh` \ +-# && _foamSource $foamPrefs ++# eval $(foamEtcFile -sh -mode=go prefs.sh) + # \endcode + # ++# Environment ++# - WM_PROJECT: (unset defaults to OpenFOAM) ++# - WM_PROJECT_SITE: (unset defaults to PREFIX/site) ++# - WM_PROJECT_VERSION: (unset defaults to detect from path) ++# + # Note +-# This script must exist in $FOAM_INST_DIR/OpenFOAM-/bin/ +-# or $FOAM_INST_DIR/openfoam/bin/ (for the debian version) ++# This script must exist in one of these locations: ++# - $WM_PROJECT_INST_DIR/OpenFOAM-/bin ++# - $WM_PROJECT_INST_DIR/openfoam-/bin ++# - $WM_PROJECT_INST_DIR/OpenFOAM+/bin ++# - $WM_PROJECT_INST_DIR/openfoam+/bin ++# - $WM_PROJECT_INST_DIR/openfoam/bin (debian version) + # + #------------------------------------------------------------------------------- ++unset optQuiet optSilent + usage() { + [ "${optQuiet:-$optSilent}" = true ] && exit 1 +- + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat< any combination of u(user), g(group), o(other) +- -prefix specify an alternative installation prefix +- -quiet suppress all normal output +- -silent suppress all stderr output +- -version specify an alternative OpenFOAM version +- in the form Maj.Min.Rev (eg, 1.7.0) +- -help print the usage ++ -a, -all Return all files (otherwise stop after the first match) ++ -l, -list List directories or files to be checked ++ -list-test List (existing) directories or files to be checked ++ -mode=MODE Any combination of u(user), g(group), o(other) ++ -prefix=DIR Specify an alternative installation prefix ++ -version=VER Specify alternative OpenFOAM version (eg, 3.0, 1612, ...) ++ -csh | -sh Produce output suitable for a csh or sh 'eval' ++ -csh-verbose | -sh-verbose ++ As per -csh | -sh, with additional verbosity ++ -q, -quiet Suppress all normal output ++ -s, -silent Suppress stderr, except -csh-verbose, -sh-verbose output ++ -help Print the usage + +- Locate user/group/shipped file with semantics similar to the ++ Locate user/group/other file with semantics similar to the + ~OpenFOAM/fileName expansion. + +- The options can also be specified as a single character +- (eg, '-q' instead of '-quiet'), but must not be grouped. ++ Single character options must not be grouped. Equivalent options: ++ -mode=MODE, -mode MODE, -m MODE ++ -prefix=DIR, -prefix DIR, -p DIR ++ -version=VER, -version VER, -v VER + + Exit status + 0 when the file is found. Print resolved path to stdout. +@@ -78,61 +91,117 @@ + exit 1 + } + +-#------------------------------------------------------------------------------- ++# Report error and exit ++die() ++{ ++ [ "${optQuiet:-$optSilent}" = true ] && exit 1 ++ exec 1>&2 ++ echo ++ echo "Error encountered:" ++ while [ "$#" -ge 1 ]; do echo " $1"; shift; done ++ echo ++ echo "See 'foamEtcFile -help' for usage" ++ echo ++ exit 1 ++} + +-# the bin dir: +-binDir="${0%/*}" ++#------------------------------------------------------------------------------- ++binDir="${0%/*}" # The bin dir ++projectDir="${binDir%/bin}" # The project dir ++prefixDir="${projectDir%/*}" # The prefix dir (same as $WM_PROJECT_INST_DIR) + +-# the project dir: ++# Could not resolve projectDir, prefixDir? (eg, called as ./bin/foamEtcFile) ++if [ "$prefixDir" = "$projectDir" ] ++then ++ binDir="$(cd $binDir && pwd -L)" + projectDir="${binDir%/bin}" +- +-# the prefix dir (same as $FOAM_INST_DIR): + prefixDir="${projectDir%/*}" ++fi ++projectDirName="${projectDir##*/}" # The project directory name + +-# the name used for the project directory +-projectDirName="${projectDir##*/}" ++projectName="${WM_PROJECT:-OpenFOAM}" # The project name ++projectVersion="$WM_PROJECT_VERSION" # Empty? - will be treated later + +-# version number used for debian packaging +-unset versionNum + ++#------------------------------------------------------------------------------- ++ ++# Guess project version or simply get the stem part of the projectDirName. ++# Handle standard and debian naming conventions. + # +-# handle standard and debian naming convention ++# - projectVersion: update unless already set + # +-case "$projectDirName" in +-OpenFOAM-*) # standard naming convention OpenFOAM- +- version="${projectDirName##OpenFOAM-}" +- ;; ++# Helper variables: ++# - dirBase (for reassembling name) == projectDirName without the version ++# - versionNum (debian packaging) ++unset dirBase versionNum ++guessVersion() ++{ ++ local version + +-openfoam[0-9]* | openfoam-dev) # debian naming convention 'openfoam' +- versionNum="${projectDirName##openfoam}" +- case "$versionNum" in +- ??) # convert 2 digit version number to decimal delineated +- version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)@\1.\2@') +- ;; +- ???) # convert 3 digit version number to decimal delineated +- version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)@\1.\2.\3@') +- ;; +- ????) # convert 4 digit version number to decimal delineated +- version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)\(.\)@\1.\2.\3.\4@') +- ;; +- *) # failback - use current environment setting +- version="$WM_PROJECT_VERSION" ++ case "$projectDirName" in ++ (OpenFOAM-* | openfoam-*) ++ # Standard naming: OpenFOAM- or openfoam- ++ dirBase="${projectDirName%%-*}-" ++ version="${projectDirName#*-}" ++ version="${version%%*-}" # Extra safety, eg openfoam-version-packager ++ ;; ++ ++ (OpenFOAM+* | openfoam+*) ++ # Alternative naming: OpenFOAM+ or openfoam+ ++ dirBase="${projectDirName%%+*}+" ++ version="${projectDirName#*+}" ++ version="${version%%*-}" # Extra safety, eg openfoam-version-packager ++ ;; ++ ++ (openfoam[0-9]*) ++ # Debian naming: openfoam ++ dirBase="openfoam" ++ version="${projectDirName#openfoam}" ++ versionNum="$version" ++ ++ # Convert digits version number to decimal delineated ++ case "${#versionNum}" in (2|3|4) ++ version=$(echo "$versionNum" | sed -e 's@\([0-9]\)@\1.@g') ++ version="${version%.}" + ;; + esac ++ ++ # Ignore special treatment if no decimals were inserted. ++ [ "${#version}" -gt "${#versionNum}" ] || unset versionNum + ;; + +-*) +- echo "Error : unknown/unsupported naming convention" +- exit 1 ++ (*) ++ die "unknown/unsupported naming convention for '$projectDirName'" + ;; + esac + ++ # Set projectVersion if required ++ : ${projectVersion:=$version} ++} ++ ++ ++# Set projectVersion and update versionNum, projectDirName accordingly ++setVersion() ++{ ++ projectVersion="$1" ++ ++ # Need dirBase when reassembling projectDirName ++ [ -n "$dirBase" ] || guessVersion ++ ++ # Debian: update x.y.z -> xyz version ++ if [ -n "$versionNum" ] ++ then ++ versionNum=$(echo "$projectVersion" | sed -e 's@\.@@g') ++ fi ++ ++ projectDirName="$dirBase${versionNum:-$projectVersion}" ++} ++ + +-# default mode is 'ugo' +-mode=ugo +-unset optAll optList optQuiet optSilent ++optMode=ugo # Default mode is always 'ugo' ++unset optAll optList optShell optVersion + +-# parse options ++# Parse options + while [ "$#" -gt 0 ] + do + case "$1" in +@@ -141,27 +210,45 @@ + ;; + -a | -all) + optAll=true ++ unset optShell + ;; + -l | -list) + optList=true ++ unset optShell ++ ;; ++ -list-test) ++ optList='test' ++ unset optShell ++ ;; ++ -csh | -sh | -csh-verbose | -sh-verbose) ++ optShell="${1#-}" ++ unset optAll ++ ;; ++ -mode=[ugo]*) ++ optMode="${1#*=}" ++ ;; ++ -prefix=/*) ++ prefixDir="${1#*=}" ++ prefixDir="${prefixDir%/}" ++ ;; ++ -version=*) ++ optVersion="${1#*=}" + ;; + -m | -mode) +- [ "$#" -ge 2 ] || usage "'$1' option requires an argument" +- mode="$2" +- +- # sanity check: +- case "$mode" in +- *u* | *g* | *o* ) ++ optMode="$2" ++ shift ++ # Sanity check. Handles missing argument too. ++ case "$optMode" in ++ ([ugo]*) + ;; +- *) +- usage "'$1' option with invalid mode '$mode'" ++ (*) ++ die "invalid mode '$optMode'" + ;; + esac +- shift + ;; + -p | -prefix) +- [ "$#" -ge 2 ] || usage "'$1' option requires an argument" +- prefixDir="$2" ++ [ "$#" -ge 2 ] || die "'$1' option requires an argument" ++ prefixDir="${2%/}" + shift + ;; + -q | -quiet) +@@ -171,13 +258,8 @@ + optSilent=true + ;; + -v | -version) +- [ "$#" -ge 2 ] || usage "'$1' option requires an argument" +- version="$2" +- # convert x.y.z -> xyz version (if installation looked like debian) +- if [ -n "$versionNum" ] +- then +- versionNum=$(echo "$version" | sed -e 's@\.@@g') +- fi ++ [ "$#" -ge 2 ] || die "'$1' option requires an argument" ++ optVersion="$2" + shift + ;; + --) +@@ -185,7 +267,7 @@ + break + ;; + -*) +- usage "unknown option: '$*'" ++ die "unknown option: '$1'" + ;; + *) + break +@@ -195,11 +277,28 @@ + done + + +-# debugging: +-# echo "Installed locations:" +-# for i in projectDir prefixDir projectDirName version versionNum ++#------------------------------------------------------------------------------- ++ ++if [ -n "$optVersion" ] ++then ++ setVersion $optVersion ++elif [ -z "$projectVersion" ] ++then ++ guessVersion ++fi ++ ++# Updates: ++# - projectDir for changes via -prefix or -version ++# - projectSite for changes via -prefix ++projectDir="$prefixDir/$projectDirName" ++projectSite="${WM_PROJECT_SITE:-$prefixDir/site}" ++ ++ ++# Debugging: ++# echo "Installed locations:" 1>&2 ++# for i in projectDir prefixDir projectDirName projectVersion + # do +-# eval echo "$i=\$$i" ++# eval echo "$i=\$$i" 1>&2 + # done + + +@@ -210,30 +309,18 @@ + + # Define the various places to be searched: + unset dirList +-case "$mode" in +-*u*) # user +- userDir="$HOME/.${WM_PROJECT:-OpenFOAM}" +- dirList="$dirList $userDir/$version $userDir" ++case "$optMode" in (*u*) # (U)ser ++ dirList="$dirList $HOME/.$projectName/$projectVersion $HOME/.$projectName" + ;; + esac + +-case "$mode" in +-*g*) # group (site) +- siteDir="${WM_PROJECT_SITE:-$prefixDir/site}" +- dirList="$dirList $siteDir/$version $siteDir" ++case "$optMode" in (*g*) # (G)roup == site ++ dirList="$dirList $projectSite/$projectVersion $projectSite" + ;; + esac + +-case "$mode" in +-*o*) # other (shipped) +- if [ -n "$versionNum" ] +- then +- # debian packaging +- dirList="$dirList $prefixDir/openfoam$versionNum/etc" +- else +- # standard packaging +- dirList="$dirList $prefixDir/${WM_PROJECT:-OpenFOAM}-$version/etc" +- fi ++case "$optMode" in (*o*) # (O)ther == shipped ++ dirList="$dirList $projectDir/etc" + ;; + esac + set -- $dirList +@@ -244,50 +331,87 @@ + # + + exitCode=0 +-if [ "$optList" = true ] ++if [ -n "$optList" ] + then + +- # list directories, or potential file locations +- [ "$nArgs" -le 1 ] || usage ++ # List directories, or potential file locations ++ [ "$nArgs" -le 1 ] || \ ++ die "-list expects 0 or 1 filename, but $nArgs provided" ++ ++ # A silly combination, but -quiet does have precedence ++ [ -n "$optQuiet" ] && exit 0 + +- # a silly combination, but -quiet does have precedence +- [ "$optQuiet" = true ] && exit 0 ++ # Test for directory or file too? ++ if [ "$optList" = "test" ] ++ then ++ exitCode=2 # Fallback to a general error (file not found) + ++ if [ "$nArgs" -eq 1 ] ++ then + for dir + do +- if [ "$nArgs" -eq 1 ] ++ resolved="$dir/$fileName" ++ if [ -f "$resolved" ] + then +- echo "$dir/$fileName" ++ echo "$resolved" ++ exitCode=0 # OK ++ fi ++ done + else ++ for dir ++ do ++ if [ -d "$dir" ] ++ then + echo "$dir" ++ exitCode=0 # OK + fi + done ++ fi ++ else ++ for dir ++ do ++ echo "$dir${fileName:+/}$fileName" ++ done ++ fi + + else + +- [ "$nArgs" -eq 1 ] || usage ++ [ "$nArgs" -eq 1 ] || die "One filename expected - $nArgs provided" + +- # general error, eg file not found +- exitCode=2 ++ exitCode=2 # Fallback to a general error (file not found) + + for dir + do + if [ -f "$dir/$fileName" ] + then + exitCode=0 +- if [ "$optQuiet" = true ] +- then ++ [ -n "$optQuiet" ] && break ++ ++ case "$optShell" in ++ (*verbose) ++ echo "Using: $dir/$fileName" 1>&2 ++ ;; ++ esac ++ ++ case "$optShell" in ++ csh*) ++ echo "source $dir/$fileName" + break +- else ++ ;; ++ sh*) ++ echo ". $dir/$fileName" ++ break ++ ;; ++ *) + echo "$dir/$fileName" +- [ "$optAll" = true ] || break +- fi ++ [ -n "$optAll" ] || break ++ ;; ++ esac + fi + done + + fi + +- + exit $exitCode + + #------------------------------------------------------------------------------ diff --git a/var/spack/repos/builtin/packages/openfoam-com/1612-build.patch b/var/spack/repos/builtin/packages/openfoam-com/1612-build.patch new file mode 100644 index 0000000000..26e2d8f085 --- /dev/null +++ b/var/spack/repos/builtin/packages/openfoam-com/1612-build.patch @@ -0,0 +1,17 @@ +--- OpenFOAM-v1612+.orig/Allwmake 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/Allwmake 2017-03-29 09:08:15.503865203 +0200 +@@ -17,6 +17,14 @@ + exit 1 + } + ++#------------------------------------------------------------------------------ ++echo "========================================" ++date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown" ++echo "Starting ${WM_PROJECT_DIR##*/} ${0##*}" ++echo " $WM_COMPILER $WM_COMPILER_TYPE compiler" ++echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}" ++echo ++ + # Compile wmake support applications + (cd wmake/src && make) + diff --git a/var/spack/repos/builtin/packages/openfoam-com/1612-etc.patch b/var/spack/repos/builtin/packages/openfoam-com/1612-etc.patch new file mode 100644 index 0000000000..dd8146e953 --- /dev/null +++ b/var/spack/repos/builtin/packages/openfoam-com/1612-etc.patch @@ -0,0 +1,41 @@ +--- OpenFOAM-v1612+.orig/etc/bashrc 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/etc/bashrc 2017-03-22 16:05:05.751237072 +0100 +@@ -42,7 +42,8 @@ + # + # Please set to the appropriate path if the default is not correct. + # +-[ $BASH_SOURCE ] && FOAM_INST_DIR=$(\cd ${BASH_SOURCE%/*/*/*} && \pwd -P) || \ ++rc="${BASH_SOURCE:-${ZSH_NAME:+$0}}" ++[ -n "$rc" ] && FOAM_INST_DIR=$(\cd $(dirname $rc)/../.. && \pwd -L) || \ + FOAM_INST_DIR=$HOME/$WM_PROJECT + # FOAM_INST_DIR=~$WM_PROJECT + # FOAM_INST_DIR=/opt/$WM_PROJECT +@@ -135,8 +136,10 @@ + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + . $WM_PROJECT_DIR/etc/config.sh/functions + +-# Add in preset user or site preferences: +-_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` ++# Override definitions via prefs, with 'other' first so the sys-admin ++# can provide base values independent of WM_PROJECT_SITE ++_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -mode o prefs.sh` ++_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -mode ug prefs.sh` + + # Evaluate command-line parameters and record settings for later + # these can be used to set/unset values, or specify alternative pref files +diff -uw OpenFOAM-v1612+.orig/etc/cshrc OpenFOAM-v1612+/etc/cshrc +--- OpenFOAM-v1612+.orig/etc/cshrc 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/etc/cshrc 2017-03-22 16:04:51.839291067 +0100 +@@ -148,8 +148,10 @@ + # Source files, possibly with some verbosity + alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*' + +-# Add in preset user or site preferences: +-_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh` ++# Override definitions via prefs, with 'other' first so the sys-admin ++# can provide base values independent of WM_PROJECT_SITE ++_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -mode o prefs.csh` ++_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -mode ug prefs.csh` + + # Evaluate command-line parameters and record settings for later + # these can be used to set/unset values, or specify alternative pref files diff --git a/var/spack/repos/builtin/packages/openfoam-com/1612-mgridgen-lib.patch b/var/spack/repos/builtin/packages/openfoam-com/1612-mgridgen-lib.patch new file mode 100644 index 0000000000..8dc0b995ff --- /dev/null +++ b/var/spack/repos/builtin/packages/openfoam-com/1612-mgridgen-lib.patch @@ -0,0 +1,41 @@ +--- OpenFOAM-v1612+.orig/src/fvAgglomerationMethods/Allwmake 2017-01-02 09:56:17.578558265 +0100 ++++ OpenFOAM-v1612+/src/fvAgglomerationMethods/Allwmake 2017-04-18 18:58:38.236795902 +0200 +@@ -4,9 +4,13 @@ + # Parse arguments for library compilation + . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments + +-export ParMGridGen=$WM_THIRD_PARTY_DIR/ParMGridGen-1.0 ++unset MGRIDGEN_ARCH_PATH ++if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mgridgen) ++then ++ . $settings ++fi + +-if [ -e "$FOAM_LIBBIN/libMGridGen.so" ] ++if [ -e "$MGRIDGEN_ARCH_PATH/include/mgridgen.h" ] + then + wmake $targetType MGridGenGamgAgglomeration + fi +--- OpenFOAM-v1612+.orig/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options 2017-01-02 09:56:17.578558265 +0100 ++++ OpenFOAM-v1612+/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options 2017-04-18 18:59:16.860662811 +0200 +@@ -1,15 +1,9 @@ +-/* Needs ParMGridGen environment variable set. (see Allwmake script) */ +- +-TYPE_REAL= +-#if defined(WM_SP) +-TYPE_REAL=-DTYPE_REAL +-#endif +- + EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ +- -I$(ParMGridGen)/MGridGen/Lib/lnInclude \ +- -I$(ParMGridGen)/MGridGen/IMlib/lnInclude \ +- $(TYPE_REAL) ++ -I$(MGRIDGEN_ARCH_PATH)/include + + LIB_LIBS = \ +- -L$(FOAM_EXT_LIBBIN) -lMGridGen ++ -L$(FOAM_EXT_LIBBIN) \ ++ -L$(MGRIDGEN_ARCH_PATH)/lib \ ++ -L$(MGRIDGEN_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ ++ -lmgrid diff --git a/var/spack/repos/builtin/packages/openfoam-com/1612-mpi.patch b/var/spack/repos/builtin/packages/openfoam-com/1612-mpi.patch new file mode 100644 index 0000000000..b3663b0a49 --- /dev/null +++ b/var/spack/repos/builtin/packages/openfoam-com/1612-mpi.patch @@ -0,0 +1,36 @@ +--- OpenFOAM-v1612+.orig/etc/config.sh/mpi 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/etc/config.sh/mpi 2017-03-29 13:55:57.507980699 +0200 +@@ -75,8 +75,15 @@ + _foamAddMan $MPI_ARCH_PATH/share/man + ;; + ++USERMPI) ++ # Use an arbitrary, user-specified mpi implementation ++ export FOAM_MPI=mpi-user ++ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/mpi-user` ++ ;; ++ + SYSTEMMPI) + export FOAM_MPI=mpi-system ++ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/mpi-system` + + if [ -z "$MPI_ROOT" ] + then +--- OpenFOAM-v1612+.orig/etc/config.csh/mpi 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/etc/config.csh/mpi 2017-03-29 13:56:36.347835938 +0200 +@@ -71,8 +71,15 @@ + _foamAddMan $MPI_ARCH_PATH/share/man + breaksw + ++case USERMPI: ++ # Use an arbitrary, user-specified mpi implementation ++ setenv FOAM_MPI mpi-user ++ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/mpi-user` ++ breaksw ++ + case SYSTEMMPI: + setenv FOAM_MPI mpi-system ++ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/mpi-system` + + if ( ! ($?MPI_ROOT) ) then + echo diff --git a/var/spack/repos/builtin/packages/openfoam-com/1612-scotch-metis-lib.patch b/var/spack/repos/builtin/packages/openfoam-com/1612-scotch-metis-lib.patch new file mode 100644 index 0000000000..b7530e6320 --- /dev/null +++ b/var/spack/repos/builtin/packages/openfoam-com/1612-scotch-metis-lib.patch @@ -0,0 +1,48 @@ +--- OpenFOAM-v1612+.orig/src/parallel/decompose/Allwmake 2017-03-21 16:34:44.599021283 +0100 ++++ OpenFOAM-v1612+/src/parallel/decompose/Allwmake 2017-03-21 16:28:57.243969660 +0100 +@@ -36,6 +36,7 @@ + + # Library + [ -r $FOAM_EXT_LIBBIN/libmetis.so ] || \ ++ [ -r $METIS_ARCH_PATH/lib/libmetis.so ] || \ + [ -r $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.so ] || \ + [ "${METIS_ARCH_PATH##*-}" = system ] || { + echo "$warning (missing library)" +@@ -90,6 +91,7 @@ + + # Library + [ -r $FOAM_EXT_LIBBIN/libscotch.so ] || \ ++ [ -r $SCOTCH_ARCH_PATH/lib/libscotch.so ] || \ + [ -r $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.so ] || \ + [ "${SCOTCH_ARCH_PATH##*-}" = system ] || { + echo "$warning (missing library)" +--- OpenFOAM-v1612+.orig/src/parallel/decompose/metisDecomp/Make/options 2017-03-21 16:34:25.383075328 +0100 ++++ OpenFOAM-v1612+/src/parallel/decompose/metisDecomp/Make/options 2017-03-21 16:30:15.727758338 +0100 +@@ -8,6 +8,7 @@ + * to support central, non-thirdparty installations + */ + LIB_LIBS = \ ++ -L$(METIS_ARCH_PATH)/lib \ + -L$(METIS_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ + -L$(FOAM_EXT_LIBBIN) \ + -lmetis +--- OpenFOAM-v1612+.orig/src/parallel/decompose/ptscotchDecomp/Make/options 2017-03-21 16:34:34.607049385 +0100 ++++ OpenFOAM-v1612+/src/parallel/decompose/ptscotchDecomp/Make/options 2017-03-21 16:30:00.479799399 +0100 +@@ -16,6 +16,7 @@ + * to support central, non-thirdparty installations + */ + LIB_LIBS = \ ++ -L$(SCOTCH_ARCH_PATH)/lib \ + -L$(SCOTCH_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ + -L$(FOAM_EXT_LIBBIN) \ + -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) \ +--- OpenFOAM-v1612+.orig/src/parallel/decompose/scotchDecomp/Make/options 2017-03-21 16:34:39.159036582 +0100 ++++ OpenFOAM-v1612+/src/parallel/decompose/scotchDecomp/Make/options 2017-03-21 16:29:46.719836452 +0100 +@@ -16,6 +16,7 @@ + * to support central, non-thirdparty installations + */ + LIB_LIBS = \ ++ -L$(SCOTCH_ARCH_PATH)/lib \ + -L$(SCOTCH_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ + -L$(FOAM_EXT_LIBBIN) \ + -lscotch \ diff --git a/var/spack/repos/builtin/packages/openfoam-com/1612-site.patch b/var/spack/repos/builtin/packages/openfoam-com/1612-site.patch new file mode 100644 index 0000000000..d988c2f9b8 --- /dev/null +++ b/var/spack/repos/builtin/packages/openfoam-com/1612-site.patch @@ -0,0 +1,42 @@ +diff -uw OpenFOAM-v1612+.orig/etc/config.sh/settings OpenFOAM-v1612+/etc/config.sh/settings +--- OpenFOAM-v1612+.orig/etc/config.sh/settings 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/etc/config.sh/settings 2017-03-23 12:22:52.002101020 +0100 +@@ -141,7 +141,7 @@ + #------------------------------------------------------------------------------ + + # Location of the jobControl directory +-export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl ++export FOAM_JOB_DIR=$HOME/.OpenFOAM/jobControl #SPACK: non-central location + + # wmake configuration + export WM_DIR=$WM_PROJECT_DIR/wmake +@@ -157,7 +157,7 @@ + export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib + + # Site-specific directory +-siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_INST_DIR/site}" ++siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_DIR/site}" #SPACK: not in parent directory + + # Shared site executables/libraries + # Similar naming convention as ~OpenFOAM expansion +diff -uw OpenFOAM-v1612+.orig/etc/config.csh/settings OpenFOAM-v1612+/etc/config.csh/settings +--- OpenFOAM-v1612+.orig/etc/config.csh/settings 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/etc/config.csh/settings 2017-03-23 12:23:52.737891912 +0100 +@@ -137,7 +137,7 @@ + #------------------------------------------------------------------------------ + + # Location of the jobControl directory +-setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl ++setenv FOAM_JOB_DIR=$HOME/.OpenFOAM/jobControl #SPACK: non-central location + + # wmake configuration + setenv WM_DIR $WM_PROJECT_DIR/wmake +@@ -156,7 +156,7 @@ + if ( $?WM_PROJECT_SITE ) then + set siteDir=$WM_PROJECT_SITE + else +- set siteDir=$WM_PROJECT_INST_DIR/site ++ set siteDir=$WM_PROJECT_DIR/site #SPACK: not in parent directory + endif + + # Shared site executables/libraries diff --git a/var/spack/repos/builtin/packages/openfoam-com/1612-zoltan-lib.patch b/var/spack/repos/builtin/packages/openfoam-com/1612-zoltan-lib.patch new file mode 100644 index 0000000000..712e6a7dfd --- /dev/null +++ b/var/spack/repos/builtin/packages/openfoam-com/1612-zoltan-lib.patch @@ -0,0 +1,84 @@ +--- OpenFOAM-v1612+.orig/applications/utilities/mesh/manipulation/renumberMesh/Allwmake 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/applications/utilities/mesh/manipulation/renumberMesh/Allwmake 2017-03-28 11:13:35.222727218 +0200 +@@ -4,20 +4,35 @@ + # Parse arguments for compilation (at least for error catching) + . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments + +-export COMPILE_FLAGS='' +-export LINK_FLAGS='' ++unset COMP_FLAGS LINK_FLAGS + + if [ -f "${FOAM_LIBBIN}/libSloanRenumber.so" ] + then +- echo "Found libSloanRenumber.so -- enabling Sloan renumbering support." ++ echo " found libSloanRenumber -- enabling sloan renumbering support." + export LINK_FLAGS="${LINK_FLAGS} -lSloanRenumber" + fi + +-if [ -f "${ZOLTAN_ARCH_PATH}/lib/libzoltan.a" -a -f "${FOAM_LIBBIN}/libzoltanRenumber.so" ] ++if [ -f "${FOAM_LIBBIN}/libzoltanRenumber.so" ] + then +- echo "Found libzoltanRenumber.so -- enabling zoltan renumbering support." +- export COMPILE_FLAGS="-DFOAM_USE_ZOLTAN" +- export LINK_FLAGS="${LINK_FLAGS} -lzoltanRenumber -L${ZOLTAN_ARCH_PATH}/lib -lzoltan" ++ if [ -z "$ZOLTAN_ARCH_PATH" ] ++ then ++ # Optional: get ZOLTAN_ARCH_PATH ++ if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan) ++ then ++ . $settings ++ fi ++ fi ++ ++ for libdir in lib "lib${WM_COMPILER_LIB_ARCH}" ++ do ++ if [ -f "$ZOLTAN_ARCH_PATH/$libdir/libzoltan.a" ] ++ then ++ echo " found libzoltanRenumber -- enabling zoltan renumbering support." ++ export COMP_FLAGS="-DFOAM_USE_ZOLTAN" ++ export LINK_FLAGS="${LINK_FLAGS} -lzoltanRenumber -L$ZOLTAN_ARCH_PATH/$libdir -lzoltan" ++ break ++ fi ++ done + fi + + wmake $targetType +--- OpenFOAM-v1612+.orig/src/renumber/Allwmake 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/src/renumber/Allwmake 2017-03-28 11:10:22.195543610 +0200 +@@ -5,14 +5,11 @@ + targetType=libso + . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments + +-## Get ZOLTAN_ARCH_PATH +-#if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan) +-#then +-# . $settings +-# echo "using ZOLTAN_ARCH_PATH=$ZOLTAN_ARCH_PATH" +-#else +-# echo "Error: no config.sh/zoltan settings" +-#fi ++# Optional: get ZOLTAN_ARCH_PATH ++if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan) ++then ++ . $settings ++fi + + wmake $targetType renumberMethods + +--- OpenFOAM-v1612+.orig/src/renumber/zoltanRenumber/Make/options 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/src/renumber/zoltanRenumber/Make/options 2017-03-28 11:50:46.484343848 +0200 +@@ -4,10 +4,13 @@ + EXE_INC = \ + /* -DFULLDEBUG -g -O0 */ \ + $(PFLAGS) $(PINC) \ ++ ${c++LESSWARN} \ + -I$(FOAM_SRC)/renumber/renumberMethods/lnInclude \ + -I$(ZOLTAN_ARCH_PATH)/include/ \ + -I$(LIB_SRC)/meshTools/lnInclude + + LIB_LIBS = \ +- /* -L$(ZOLTAN_ARCH_PATH)/lib -lzoltan */ \ ++ -L$(ZOLTAN_ARCH_PATH)/lib \ ++ -L$(ZOLTAN_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ ++ -lzoltan \ + -lmeshTools diff --git a/var/spack/repos/builtin/packages/openfoam-com/mgridgen-lib-1612.patch b/var/spack/repos/builtin/packages/openfoam-com/mgridgen-lib-1612.patch deleted file mode 100644 index 8dc0b995ff..0000000000 --- a/var/spack/repos/builtin/packages/openfoam-com/mgridgen-lib-1612.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- OpenFOAM-v1612+.orig/src/fvAgglomerationMethods/Allwmake 2017-01-02 09:56:17.578558265 +0100 -+++ OpenFOAM-v1612+/src/fvAgglomerationMethods/Allwmake 2017-04-18 18:58:38.236795902 +0200 -@@ -4,9 +4,13 @@ - # Parse arguments for library compilation - . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments - --export ParMGridGen=$WM_THIRD_PARTY_DIR/ParMGridGen-1.0 -+unset MGRIDGEN_ARCH_PATH -+if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mgridgen) -+then -+ . $settings -+fi - --if [ -e "$FOAM_LIBBIN/libMGridGen.so" ] -+if [ -e "$MGRIDGEN_ARCH_PATH/include/mgridgen.h" ] - then - wmake $targetType MGridGenGamgAgglomeration - fi ---- OpenFOAM-v1612+.orig/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options 2017-01-02 09:56:17.578558265 +0100 -+++ OpenFOAM-v1612+/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options 2017-04-18 18:59:16.860662811 +0200 -@@ -1,15 +1,9 @@ --/* Needs ParMGridGen environment variable set. (see Allwmake script) */ -- --TYPE_REAL= --#if defined(WM_SP) --TYPE_REAL=-DTYPE_REAL --#endif -- - EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ -- -I$(ParMGridGen)/MGridGen/Lib/lnInclude \ -- -I$(ParMGridGen)/MGridGen/IMlib/lnInclude \ -- $(TYPE_REAL) -+ -I$(MGRIDGEN_ARCH_PATH)/include - - LIB_LIBS = \ -- -L$(FOAM_EXT_LIBBIN) -lMGridGen -+ -L$(FOAM_EXT_LIBBIN) \ -+ -L$(MGRIDGEN_ARCH_PATH)/lib \ -+ -L$(MGRIDGEN_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ -+ -lmgrid diff --git a/var/spack/repos/builtin/packages/openfoam-com/openfoam-bin-1612.patch b/var/spack/repos/builtin/packages/openfoam-com/openfoam-bin-1612.patch deleted file mode 100644 index b9e87a7ec8..0000000000 --- a/var/spack/repos/builtin/packages/openfoam-com/openfoam-bin-1612.patch +++ /dev/null @@ -1,503 +0,0 @@ ---- OpenFOAM-v1612+.orig/bin/foamEtcFile 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/bin/foamEtcFile 2017-03-23 10:08:37.296887070 +0100 -@@ -4,7 +4,7 @@ - # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - # \\ / O peration | - # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation --# \\/ M anipulation | -+# \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. - #------------------------------------------------------------------------------- - # License - # This file is part of OpenFOAM. -@@ -26,7 +26,7 @@ - # foamEtcFile - # - # Description --# Locate user/group/shipped file with semantics similar to the -+# Locate user/group/other files with semantics similar to the - # ~OpenFOAM/fileName expansion. - # - # The -mode option can be used to allow chaining from -@@ -34,40 +34,53 @@ - # - # For example, within the user ~/.OpenFOAM//prefs.sh: - # \code --# foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile -m go prefs.sh` \ --# && _foamSource $foamPrefs -+# eval $(foamEtcFile -sh -mode=go prefs.sh) - # \endcode - # -+# Environment -+# - WM_PROJECT: (unset defaults to OpenFOAM) -+# - WM_PROJECT_SITE: (unset defaults to PREFIX/site) -+# - WM_PROJECT_VERSION: (unset defaults to detect from path) -+# - # Note --# This script must exist in $FOAM_INST_DIR/OpenFOAM-/bin/ --# or $FOAM_INST_DIR/openfoam/bin/ (for the debian version) -+# This script must exist in one of these locations: -+# - $WM_PROJECT_INST_DIR/OpenFOAM-/bin -+# - $WM_PROJECT_INST_DIR/openfoam-/bin -+# - $WM_PROJECT_INST_DIR/OpenFOAM+/bin -+# - $WM_PROJECT_INST_DIR/openfoam+/bin -+# - $WM_PROJECT_INST_DIR/openfoam/bin (debian version) - # - #------------------------------------------------------------------------------- -+unset optQuiet optSilent - usage() { - [ "${optQuiet:-$optSilent}" = true ] && exit 1 -- - exec 1>&2 - while [ "$#" -ge 1 ]; do echo "$1"; shift; done - cat< any combination of u(user), g(group), o(other) -- -prefix specify an alternative installation prefix -- -quiet suppress all normal output -- -silent suppress all stderr output -- -version specify an alternative OpenFOAM version -- in the form Maj.Min.Rev (eg, 1.7.0) -- -help print the usage -+ -a, -all Return all files (otherwise stop after the first match) -+ -l, -list List directories or files to be checked -+ -list-test List (existing) directories or files to be checked -+ -mode=MODE Any combination of u(user), g(group), o(other) -+ -prefix=DIR Specify an alternative installation prefix -+ -version=VER Specify alternative OpenFOAM version (eg, 3.0, 1612, ...) -+ -csh | -sh Produce output suitable for a csh or sh 'eval' -+ -csh-verbose | -sh-verbose -+ As per -csh | -sh, with additional verbosity -+ -q, -quiet Suppress all normal output -+ -s, -silent Suppress stderr, except -csh-verbose, -sh-verbose output -+ -help Print the usage - -- Locate user/group/shipped file with semantics similar to the -+ Locate user/group/other file with semantics similar to the - ~OpenFOAM/fileName expansion. - -- The options can also be specified as a single character -- (eg, '-q' instead of '-quiet'), but must not be grouped. -+ Single character options must not be grouped. Equivalent options: -+ -mode=MODE, -mode MODE, -m MODE -+ -prefix=DIR, -prefix DIR, -p DIR -+ -version=VER, -version VER, -v VER - - Exit status - 0 when the file is found. Print resolved path to stdout. -@@ -78,61 +91,117 @@ - exit 1 - } - --#------------------------------------------------------------------------------- -+# Report error and exit -+die() -+{ -+ [ "${optQuiet:-$optSilent}" = true ] && exit 1 -+ exec 1>&2 -+ echo -+ echo "Error encountered:" -+ while [ "$#" -ge 1 ]; do echo " $1"; shift; done -+ echo -+ echo "See 'foamEtcFile -help' for usage" -+ echo -+ exit 1 -+} - --# the bin dir: --binDir="${0%/*}" -+#------------------------------------------------------------------------------- -+binDir="${0%/*}" # The bin dir -+projectDir="${binDir%/bin}" # The project dir -+prefixDir="${projectDir%/*}" # The prefix dir (same as $WM_PROJECT_INST_DIR) - --# the project dir: -+# Could not resolve projectDir, prefixDir? (eg, called as ./bin/foamEtcFile) -+if [ "$prefixDir" = "$projectDir" ] -+then -+ binDir="$(cd $binDir && pwd -L)" - projectDir="${binDir%/bin}" -- --# the prefix dir (same as $FOAM_INST_DIR): - prefixDir="${projectDir%/*}" -+fi -+projectDirName="${projectDir##*/}" # The project directory name - --# the name used for the project directory --projectDirName="${projectDir##*/}" -+projectName="${WM_PROJECT:-OpenFOAM}" # The project name -+projectVersion="$WM_PROJECT_VERSION" # Empty? - will be treated later - --# version number used for debian packaging --unset versionNum - -+#------------------------------------------------------------------------------- -+ -+# Guess project version or simply get the stem part of the projectDirName. -+# Handle standard and debian naming conventions. - # --# handle standard and debian naming convention -+# - projectVersion: update unless already set - # --case "$projectDirName" in --OpenFOAM-*) # standard naming convention OpenFOAM- -- version="${projectDirName##OpenFOAM-}" -- ;; -+# Helper variables: -+# - dirBase (for reassembling name) == projectDirName without the version -+# - versionNum (debian packaging) -+unset dirBase versionNum -+guessVersion() -+{ -+ local version - --openfoam[0-9]* | openfoam-dev) # debian naming convention 'openfoam' -- versionNum="${projectDirName##openfoam}" -- case "$versionNum" in -- ??) # convert 2 digit version number to decimal delineated -- version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)@\1.\2@') -- ;; -- ???) # convert 3 digit version number to decimal delineated -- version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)@\1.\2.\3@') -- ;; -- ????) # convert 4 digit version number to decimal delineated -- version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)\(.\)@\1.\2.\3.\4@') -- ;; -- *) # failback - use current environment setting -- version="$WM_PROJECT_VERSION" -+ case "$projectDirName" in -+ (OpenFOAM-* | openfoam-*) -+ # Standard naming: OpenFOAM- or openfoam- -+ dirBase="${projectDirName%%-*}-" -+ version="${projectDirName#*-}" -+ version="${version%%*-}" # Extra safety, eg openfoam-version-packager -+ ;; -+ -+ (OpenFOAM+* | openfoam+*) -+ # Alternative naming: OpenFOAM+ or openfoam+ -+ dirBase="${projectDirName%%+*}+" -+ version="${projectDirName#*+}" -+ version="${version%%*-}" # Extra safety, eg openfoam-version-packager -+ ;; -+ -+ (openfoam[0-9]*) -+ # Debian naming: openfoam -+ dirBase="openfoam" -+ version="${projectDirName#openfoam}" -+ versionNum="$version" -+ -+ # Convert digits version number to decimal delineated -+ case "${#versionNum}" in (2|3|4) -+ version=$(echo "$versionNum" | sed -e 's@\([0-9]\)@\1.@g') -+ version="${version%.}" - ;; - esac -+ -+ # Ignore special treatment if no decimals were inserted. -+ [ "${#version}" -gt "${#versionNum}" ] || unset versionNum - ;; - --*) -- echo "Error : unknown/unsupported naming convention" -- exit 1 -+ (*) -+ die "unknown/unsupported naming convention for '$projectDirName'" - ;; - esac - -+ # Set projectVersion if required -+ : ${projectVersion:=$version} -+} -+ -+ -+# Set projectVersion and update versionNum, projectDirName accordingly -+setVersion() -+{ -+ projectVersion="$1" -+ -+ # Need dirBase when reassembling projectDirName -+ [ -n "$dirBase" ] || guessVersion -+ -+ # Debian: update x.y.z -> xyz version -+ if [ -n "$versionNum" ] -+ then -+ versionNum=$(echo "$projectVersion" | sed -e 's@\.@@g') -+ fi -+ -+ projectDirName="$dirBase${versionNum:-$projectVersion}" -+} -+ - --# default mode is 'ugo' --mode=ugo --unset optAll optList optQuiet optSilent -+optMode=ugo # Default mode is always 'ugo' -+unset optAll optList optShell optVersion - --# parse options -+# Parse options - while [ "$#" -gt 0 ] - do - case "$1" in -@@ -141,27 +210,45 @@ - ;; - -a | -all) - optAll=true -+ unset optShell - ;; - -l | -list) - optList=true -+ unset optShell -+ ;; -+ -list-test) -+ optList='test' -+ unset optShell -+ ;; -+ -csh | -sh | -csh-verbose | -sh-verbose) -+ optShell="${1#-}" -+ unset optAll -+ ;; -+ -mode=[ugo]*) -+ optMode="${1#*=}" -+ ;; -+ -prefix=/*) -+ prefixDir="${1#*=}" -+ prefixDir="${prefixDir%/}" -+ ;; -+ -version=*) -+ optVersion="${1#*=}" - ;; - -m | -mode) -- [ "$#" -ge 2 ] || usage "'$1' option requires an argument" -- mode="$2" -- -- # sanity check: -- case "$mode" in -- *u* | *g* | *o* ) -+ optMode="$2" -+ shift -+ # Sanity check. Handles missing argument too. -+ case "$optMode" in -+ ([ugo]*) - ;; -- *) -- usage "'$1' option with invalid mode '$mode'" -+ (*) -+ die "invalid mode '$optMode'" - ;; - esac -- shift - ;; - -p | -prefix) -- [ "$#" -ge 2 ] || usage "'$1' option requires an argument" -- prefixDir="$2" -+ [ "$#" -ge 2 ] || die "'$1' option requires an argument" -+ prefixDir="${2%/}" - shift - ;; - -q | -quiet) -@@ -171,13 +258,8 @@ - optSilent=true - ;; - -v | -version) -- [ "$#" -ge 2 ] || usage "'$1' option requires an argument" -- version="$2" -- # convert x.y.z -> xyz version (if installation looked like debian) -- if [ -n "$versionNum" ] -- then -- versionNum=$(echo "$version" | sed -e 's@\.@@g') -- fi -+ [ "$#" -ge 2 ] || die "'$1' option requires an argument" -+ optVersion="$2" - shift - ;; - --) -@@ -185,7 +267,7 @@ - break - ;; - -*) -- usage "unknown option: '$*'" -+ die "unknown option: '$1'" - ;; - *) - break -@@ -195,11 +277,28 @@ - done - - --# debugging: --# echo "Installed locations:" --# for i in projectDir prefixDir projectDirName version versionNum -+#------------------------------------------------------------------------------- -+ -+if [ -n "$optVersion" ] -+then -+ setVersion $optVersion -+elif [ -z "$projectVersion" ] -+then -+ guessVersion -+fi -+ -+# Updates: -+# - projectDir for changes via -prefix or -version -+# - projectSite for changes via -prefix -+projectDir="$prefixDir/$projectDirName" -+projectSite="${WM_PROJECT_SITE:-$prefixDir/site}" -+ -+ -+# Debugging: -+# echo "Installed locations:" 1>&2 -+# for i in projectDir prefixDir projectDirName projectVersion - # do --# eval echo "$i=\$$i" -+# eval echo "$i=\$$i" 1>&2 - # done - - -@@ -210,30 +309,18 @@ - - # Define the various places to be searched: - unset dirList --case "$mode" in --*u*) # user -- userDir="$HOME/.${WM_PROJECT:-OpenFOAM}" -- dirList="$dirList $userDir/$version $userDir" -+case "$optMode" in (*u*) # (U)ser -+ dirList="$dirList $HOME/.$projectName/$projectVersion $HOME/.$projectName" - ;; - esac - --case "$mode" in --*g*) # group (site) -- siteDir="${WM_PROJECT_SITE:-$prefixDir/site}" -- dirList="$dirList $siteDir/$version $siteDir" -+case "$optMode" in (*g*) # (G)roup == site -+ dirList="$dirList $projectSite/$projectVersion $projectSite" - ;; - esac - --case "$mode" in --*o*) # other (shipped) -- if [ -n "$versionNum" ] -- then -- # debian packaging -- dirList="$dirList $prefixDir/openfoam$versionNum/etc" -- else -- # standard packaging -- dirList="$dirList $prefixDir/${WM_PROJECT:-OpenFOAM}-$version/etc" -- fi -+case "$optMode" in (*o*) # (O)ther == shipped -+ dirList="$dirList $projectDir/etc" - ;; - esac - set -- $dirList -@@ -244,50 +331,87 @@ - # - - exitCode=0 --if [ "$optList" = true ] -+if [ -n "$optList" ] - then - -- # list directories, or potential file locations -- [ "$nArgs" -le 1 ] || usage -+ # List directories, or potential file locations -+ [ "$nArgs" -le 1 ] || \ -+ die "-list expects 0 or 1 filename, but $nArgs provided" -+ -+ # A silly combination, but -quiet does have precedence -+ [ -n "$optQuiet" ] && exit 0 - -- # a silly combination, but -quiet does have precedence -- [ "$optQuiet" = true ] && exit 0 -+ # Test for directory or file too? -+ if [ "$optList" = "test" ] -+ then -+ exitCode=2 # Fallback to a general error (file not found) - -+ if [ "$nArgs" -eq 1 ] -+ then - for dir - do -- if [ "$nArgs" -eq 1 ] -+ resolved="$dir/$fileName" -+ if [ -f "$resolved" ] - then -- echo "$dir/$fileName" -+ echo "$resolved" -+ exitCode=0 # OK -+ fi -+ done - else -+ for dir -+ do -+ if [ -d "$dir" ] -+ then - echo "$dir" -+ exitCode=0 # OK - fi - done -+ fi -+ else -+ for dir -+ do -+ echo "$dir${fileName:+/}$fileName" -+ done -+ fi - - else - -- [ "$nArgs" -eq 1 ] || usage -+ [ "$nArgs" -eq 1 ] || die "One filename expected - $nArgs provided" - -- # general error, eg file not found -- exitCode=2 -+ exitCode=2 # Fallback to a general error (file not found) - - for dir - do - if [ -f "$dir/$fileName" ] - then - exitCode=0 -- if [ "$optQuiet" = true ] -- then -+ [ -n "$optQuiet" ] && break -+ -+ case "$optShell" in -+ (*verbose) -+ echo "Using: $dir/$fileName" 1>&2 -+ ;; -+ esac -+ -+ case "$optShell" in -+ csh*) -+ echo "source $dir/$fileName" - break -- else -+ ;; -+ sh*) -+ echo ". $dir/$fileName" -+ break -+ ;; -+ *) - echo "$dir/$fileName" -- [ "$optAll" = true ] || break -- fi -+ [ -n "$optAll" ] || break -+ ;; -+ esac - fi - done - - fi - -- - exit $exitCode - - #------------------------------------------------------------------------------ diff --git a/var/spack/repos/builtin/packages/openfoam-com/openfoam-build-1612.patch b/var/spack/repos/builtin/packages/openfoam-com/openfoam-build-1612.patch deleted file mode 100644 index 26e2d8f085..0000000000 --- a/var/spack/repos/builtin/packages/openfoam-com/openfoam-build-1612.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- OpenFOAM-v1612+.orig/Allwmake 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/Allwmake 2017-03-29 09:08:15.503865203 +0200 -@@ -17,6 +17,14 @@ - exit 1 - } - -+#------------------------------------------------------------------------------ -+echo "========================================" -+date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown" -+echo "Starting ${WM_PROJECT_DIR##*/} ${0##*}" -+echo " $WM_COMPILER $WM_COMPILER_TYPE compiler" -+echo " ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}" -+echo -+ - # Compile wmake support applications - (cd wmake/src && make) - diff --git a/var/spack/repos/builtin/packages/openfoam-com/openfoam-etc-1612.patch b/var/spack/repos/builtin/packages/openfoam-com/openfoam-etc-1612.patch deleted file mode 100644 index dd8146e953..0000000000 --- a/var/spack/repos/builtin/packages/openfoam-com/openfoam-etc-1612.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- OpenFOAM-v1612+.orig/etc/bashrc 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/etc/bashrc 2017-03-22 16:05:05.751237072 +0100 -@@ -42,7 +42,8 @@ - # - # Please set to the appropriate path if the default is not correct. - # --[ $BASH_SOURCE ] && FOAM_INST_DIR=$(\cd ${BASH_SOURCE%/*/*/*} && \pwd -P) || \ -+rc="${BASH_SOURCE:-${ZSH_NAME:+$0}}" -+[ -n "$rc" ] && FOAM_INST_DIR=$(\cd $(dirname $rc)/../.. && \pwd -L) || \ - FOAM_INST_DIR=$HOME/$WM_PROJECT - # FOAM_INST_DIR=~$WM_PROJECT - # FOAM_INST_DIR=/opt/$WM_PROJECT -@@ -135,8 +136,10 @@ - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - . $WM_PROJECT_DIR/etc/config.sh/functions - --# Add in preset user or site preferences: --_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh` -+# Override definitions via prefs, with 'other' first so the sys-admin -+# can provide base values independent of WM_PROJECT_SITE -+_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -mode o prefs.sh` -+_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -mode ug prefs.sh` - - # Evaluate command-line parameters and record settings for later - # these can be used to set/unset values, or specify alternative pref files -diff -uw OpenFOAM-v1612+.orig/etc/cshrc OpenFOAM-v1612+/etc/cshrc ---- OpenFOAM-v1612+.orig/etc/cshrc 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/etc/cshrc 2017-03-22 16:04:51.839291067 +0100 -@@ -148,8 +148,10 @@ - # Source files, possibly with some verbosity - alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*' - --# Add in preset user or site preferences: --_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh` -+# Override definitions via prefs, with 'other' first so the sys-admin -+# can provide base values independent of WM_PROJECT_SITE -+_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -mode o prefs.csh` -+_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -mode ug prefs.csh` - - # Evaluate command-line parameters and record settings for later - # these can be used to set/unset values, or specify alternative pref files diff --git a/var/spack/repos/builtin/packages/openfoam-com/openfoam-mpi-1612.patch b/var/spack/repos/builtin/packages/openfoam-com/openfoam-mpi-1612.patch deleted file mode 100644 index b3663b0a49..0000000000 --- a/var/spack/repos/builtin/packages/openfoam-com/openfoam-mpi-1612.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- OpenFOAM-v1612+.orig/etc/config.sh/mpi 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/etc/config.sh/mpi 2017-03-29 13:55:57.507980699 +0200 -@@ -75,8 +75,15 @@ - _foamAddMan $MPI_ARCH_PATH/share/man - ;; - -+USERMPI) -+ # Use an arbitrary, user-specified mpi implementation -+ export FOAM_MPI=mpi-user -+ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/mpi-user` -+ ;; -+ - SYSTEMMPI) - export FOAM_MPI=mpi-system -+ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/mpi-system` - - if [ -z "$MPI_ROOT" ] - then ---- OpenFOAM-v1612+.orig/etc/config.csh/mpi 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/etc/config.csh/mpi 2017-03-29 13:56:36.347835938 +0200 -@@ -71,8 +71,15 @@ - _foamAddMan $MPI_ARCH_PATH/share/man - breaksw - -+case USERMPI: -+ # Use an arbitrary, user-specified mpi implementation -+ setenv FOAM_MPI mpi-user -+ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/mpi-user` -+ breaksw -+ - case SYSTEMMPI: - setenv FOAM_MPI mpi-system -+ _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/mpi-system` - - if ( ! ($?MPI_ROOT) ) then - echo diff --git a/var/spack/repos/builtin/packages/openfoam-com/openfoam-site-1612.patch b/var/spack/repos/builtin/packages/openfoam-com/openfoam-site-1612.patch deleted file mode 100644 index d988c2f9b8..0000000000 --- a/var/spack/repos/builtin/packages/openfoam-com/openfoam-site-1612.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -uw OpenFOAM-v1612+.orig/etc/config.sh/settings OpenFOAM-v1612+/etc/config.sh/settings ---- OpenFOAM-v1612+.orig/etc/config.sh/settings 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/etc/config.sh/settings 2017-03-23 12:22:52.002101020 +0100 -@@ -141,7 +141,7 @@ - #------------------------------------------------------------------------------ - - # Location of the jobControl directory --export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl -+export FOAM_JOB_DIR=$HOME/.OpenFOAM/jobControl #SPACK: non-central location - - # wmake configuration - export WM_DIR=$WM_PROJECT_DIR/wmake -@@ -157,7 +157,7 @@ - export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib - - # Site-specific directory --siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_INST_DIR/site}" -+siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_DIR/site}" #SPACK: not in parent directory - - # Shared site executables/libraries - # Similar naming convention as ~OpenFOAM expansion -diff -uw OpenFOAM-v1612+.orig/etc/config.csh/settings OpenFOAM-v1612+/etc/config.csh/settings ---- OpenFOAM-v1612+.orig/etc/config.csh/settings 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/etc/config.csh/settings 2017-03-23 12:23:52.737891912 +0100 -@@ -137,7 +137,7 @@ - #------------------------------------------------------------------------------ - - # Location of the jobControl directory --setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl -+setenv FOAM_JOB_DIR=$HOME/.OpenFOAM/jobControl #SPACK: non-central location - - # wmake configuration - setenv WM_DIR $WM_PROJECT_DIR/wmake -@@ -156,7 +156,7 @@ - if ( $?WM_PROJECT_SITE ) then - set siteDir=$WM_PROJECT_SITE - else -- set siteDir=$WM_PROJECT_INST_DIR/site -+ set siteDir=$WM_PROJECT_DIR/site #SPACK: not in parent directory - endif - - # Shared site executables/libraries diff --git a/var/spack/repos/builtin/packages/openfoam-com/openfoam-site-plus.patch b/var/spack/repos/builtin/packages/openfoam-com/openfoam-site-plus.patch deleted file mode 100644 index a1f5d8a08a..0000000000 --- a/var/spack/repos/builtin/packages/openfoam-com/openfoam-site-plus.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -uw OpenFOAM-plus.orig/etc/config.sh/settings OpenFOAM-plus/etc/config.sh/settings ---- OpenFOAM-plus.orig/etc/config.sh/settings 2017-04-04 17:34:29.875873400 +0200 -+++ OpenFOAM-plus/etc/config.sh/settings 2017-04-04 17:38:40.174992466 +0200 -@@ -154,10 +154,10 @@ - export FOAM_LIBBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib - - # External (ThirdParty) libraries --export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib -+unset FOAM_EXT_LIBBIN #SPACK: none - - # Site-specific directory --siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_INST_DIR/site}" -+siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_DIR/site}" #SPACK: not in parent directory - - # Shared site executables/libraries - # Similar naming convention as ~OpenFOAM expansion -diff -uw OpenFOAM-plus.orig/etc/config.csh/settings OpenFOAM-plus/etc/config.csh/settings ---- OpenFOAM-plus.orig/etc/config.csh/settings 2017-04-04 17:34:28.255879107 +0200 -+++ OpenFOAM-plus/etc/config.csh/settings 2017-04-04 17:39:22.214844670 +0200 -@@ -151,13 +151,13 @@ - setenv FOAM_LIBBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib - - # External (ThirdParty) libraries --setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib -+unsetenv FOAM_EXT_LIBBIN #SPACK: none - - # Site-specific directory - if ( $?WM_PROJECT_SITE ) then - set siteDir=$WM_PROJECT_SITE - else -- set siteDir=$WM_PROJECT_INST_DIR/site -+ set siteDir=$WM_PROJECT_DIR/site #SPACK: not in parent directory - endif - - # Shared site executables/libraries diff --git a/var/spack/repos/builtin/packages/openfoam-com/openfoam-site.patch b/var/spack/repos/builtin/packages/openfoam-com/openfoam-site.patch new file mode 100644 index 0000000000..a1f5d8a08a --- /dev/null +++ b/var/spack/repos/builtin/packages/openfoam-com/openfoam-site.patch @@ -0,0 +1,35 @@ +diff -uw OpenFOAM-plus.orig/etc/config.sh/settings OpenFOAM-plus/etc/config.sh/settings +--- OpenFOAM-plus.orig/etc/config.sh/settings 2017-04-04 17:34:29.875873400 +0200 ++++ OpenFOAM-plus/etc/config.sh/settings 2017-04-04 17:38:40.174992466 +0200 +@@ -154,10 +154,10 @@ + export FOAM_LIBBIN=$WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib + + # External (ThirdParty) libraries +-export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib ++unset FOAM_EXT_LIBBIN #SPACK: none + + # Site-specific directory +-siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_INST_DIR/site}" ++siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_DIR/site}" #SPACK: not in parent directory + + # Shared site executables/libraries + # Similar naming convention as ~OpenFOAM expansion +diff -uw OpenFOAM-plus.orig/etc/config.csh/settings OpenFOAM-plus/etc/config.csh/settings +--- OpenFOAM-plus.orig/etc/config.csh/settings 2017-04-04 17:34:28.255879107 +0200 ++++ OpenFOAM-plus/etc/config.csh/settings 2017-04-04 17:39:22.214844670 +0200 +@@ -151,13 +151,13 @@ + setenv FOAM_LIBBIN $WM_PROJECT_DIR/platforms/$WM_OPTIONS/lib + + # External (ThirdParty) libraries +-setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib ++unsetenv FOAM_EXT_LIBBIN #SPACK: none + + # Site-specific directory + if ( $?WM_PROJECT_SITE ) then + set siteDir=$WM_PROJECT_SITE + else +- set siteDir=$WM_PROJECT_INST_DIR/site ++ set siteDir=$WM_PROJECT_DIR/site #SPACK: not in parent directory + endif + + # Shared site executables/libraries diff --git a/var/spack/repos/builtin/packages/openfoam-com/package.py b/var/spack/repos/builtin/packages/openfoam-com/package.py index 9e930535a0..0e2c0275d3 100644 --- a/var/spack/repos/builtin/packages/openfoam-com/package.py +++ b/var/spack/repos/builtin/packages/openfoam-com/package.py @@ -54,6 +54,9 @@ # - Combining +zoltan with +int64 has not been tested, but probably won't work. # - Combining +mgridgen with +int64 or +float32 probably won't work. # +# The spack 'develop' version of openfoam-com retains the upstream +# WM_PROJECT_VERSION=plus naming internally. +# ############################################################################## from spack import * from spack.environment import * @@ -258,12 +261,14 @@ class OpenfoamCom(Package): """ homepage = "http://www.openfoam.com/" - baseurl = "https://sourceforge.net/projects/openfoamplus/files" + baseurl = "https://sourceforge.net/projects/openfoamplus/files/" + gitrepo = "https://develop.openfoam.com/Development/OpenFOAM-plus.git" + version('1706', '630d30770f7b54d6809efbf94b7d7c8f', + url=baseurl + 'v1706/OpenFOAM-v1706.tgz') version('1612', 'ca02c491369150ab127cbb88ec60fbdf', - url=baseurl + '/v1612+/OpenFOAM-v1612+.tgz') - version('plus', branch='develop', # Note: needs user credentials - git='https://develop.openfoam.com/Development/OpenFOAM-plus.git') + url=baseurl + 'v1612+/OpenFOAM-v1612+.tgz') + version('develop', branch='develop', git=gitrepo) # Needs credentials variant('int64', default=False, description='Compile with 64-bit label') @@ -309,27 +314,29 @@ class OpenfoamCom(Package): # Workaround: use preferred variants "+plugins +qt" in # ~/.spack/packages.yaml + # 1706 ok with newer paraview but avoid pv-5.2, pv-5.3 readers + depends_on('paraview@5.4:', when='@1706:+paraview') # 1612 plugins need older paraview - # The native reader in paraview 5.2 is broken, so start after that depends_on('paraview@:5.0.1', when='@1612+paraview') - depends_on('paraview@5.3:', when='@1706:+paraview') - depends_on('paraview@5.3:', when='@plus+paraview') # General patches common = ['spack-Allwmake', 'README-spack'] assets = [] # Version-specific patches - patch('openfoam-bin-1612.patch', when='@1612') - patch('openfoam-etc-1612.patch', when='@1612') - patch('openfoam-site-1612.patch', when='@1612') - patch('openfoam-mpi-1612.patch', when='@1612') - patch('openfoam-build-1612.patch', when='@1612') - patch('mgridgen-lib-1612.patch', when='@1612') - patch('scotch-metis-lib-1612.patch', when='@1612') - patch('zoltan-lib-1612.patch', when='@1612') - - patch('openfoam-site-plus.patch', when='@plus') + patch('1612-bin.patch', when='@1612') + patch('1612-build.patch', when='@1612') + patch('1612-etc.patch', when='@1612') + patch('1612-site.patch', when='@1612') + patch('1612-mpi.patch', when='@1612') + patch('1612-mgridgen-lib.patch', when='@1612') + patch('1612-scotch-metis-lib.patch', when='@1612') + patch('1612-zoltan-lib.patch', when='@1612') + + # This patch is reasonably version-invariant + # 1) default site directly under WM_PROJECT_DIR + # 2) no FOAM_EXT_LIBBIN required + patch('openfoam-site.patch', when='@1706:') # Some user config settings # default: 'compile-option': 'RpathOpt', @@ -349,7 +356,7 @@ class OpenfoamCom(Package): etc_config = {} phases = ['configure', 'build', 'install'] - build_script = './spack-Allwmake' # <- Added by patch() method. + build_script = './spack-Allwmake' # From patch() method. # # - End of definitions / setup - @@ -360,7 +367,6 @@ class OpenfoamCom(Package): run_env.set('WM_PROJECT_DIR', self.projectdir) for d in ['wmake', self.archbin]: # bin already added automatically run_env.prepend_path('PATH', join_path(self.projectdir, d)) - run_env.set('MPI_BUFFER_SIZE', "20000000") def setup_dependent_environment(self, spack_env, run_env, dependent_spec): """Provide location of the OpenFOAM project. diff --git a/var/spack/repos/builtin/packages/openfoam-com/scotch-metis-lib-1612.patch b/var/spack/repos/builtin/packages/openfoam-com/scotch-metis-lib-1612.patch deleted file mode 100644 index b7530e6320..0000000000 --- a/var/spack/repos/builtin/packages/openfoam-com/scotch-metis-lib-1612.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- OpenFOAM-v1612+.orig/src/parallel/decompose/Allwmake 2017-03-21 16:34:44.599021283 +0100 -+++ OpenFOAM-v1612+/src/parallel/decompose/Allwmake 2017-03-21 16:28:57.243969660 +0100 -@@ -36,6 +36,7 @@ - - # Library - [ -r $FOAM_EXT_LIBBIN/libmetis.so ] || \ -+ [ -r $METIS_ARCH_PATH/lib/libmetis.so ] || \ - [ -r $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.so ] || \ - [ "${METIS_ARCH_PATH##*-}" = system ] || { - echo "$warning (missing library)" -@@ -90,6 +91,7 @@ - - # Library - [ -r $FOAM_EXT_LIBBIN/libscotch.so ] || \ -+ [ -r $SCOTCH_ARCH_PATH/lib/libscotch.so ] || \ - [ -r $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.so ] || \ - [ "${SCOTCH_ARCH_PATH##*-}" = system ] || { - echo "$warning (missing library)" ---- OpenFOAM-v1612+.orig/src/parallel/decompose/metisDecomp/Make/options 2017-03-21 16:34:25.383075328 +0100 -+++ OpenFOAM-v1612+/src/parallel/decompose/metisDecomp/Make/options 2017-03-21 16:30:15.727758338 +0100 -@@ -8,6 +8,7 @@ - * to support central, non-thirdparty installations - */ - LIB_LIBS = \ -+ -L$(METIS_ARCH_PATH)/lib \ - -L$(METIS_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ - -L$(FOAM_EXT_LIBBIN) \ - -lmetis ---- OpenFOAM-v1612+.orig/src/parallel/decompose/ptscotchDecomp/Make/options 2017-03-21 16:34:34.607049385 +0100 -+++ OpenFOAM-v1612+/src/parallel/decompose/ptscotchDecomp/Make/options 2017-03-21 16:30:00.479799399 +0100 -@@ -16,6 +16,7 @@ - * to support central, non-thirdparty installations - */ - LIB_LIBS = \ -+ -L$(SCOTCH_ARCH_PATH)/lib \ - -L$(SCOTCH_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ - -L$(FOAM_EXT_LIBBIN) \ - -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) \ ---- OpenFOAM-v1612+.orig/src/parallel/decompose/scotchDecomp/Make/options 2017-03-21 16:34:39.159036582 +0100 -+++ OpenFOAM-v1612+/src/parallel/decompose/scotchDecomp/Make/options 2017-03-21 16:29:46.719836452 +0100 -@@ -16,6 +16,7 @@ - * to support central, non-thirdparty installations - */ - LIB_LIBS = \ -+ -L$(SCOTCH_ARCH_PATH)/lib \ - -L$(SCOTCH_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ - -L$(FOAM_EXT_LIBBIN) \ - -lscotch \ diff --git a/var/spack/repos/builtin/packages/openfoam-com/zoltan-lib-1612.patch b/var/spack/repos/builtin/packages/openfoam-com/zoltan-lib-1612.patch deleted file mode 100644 index 712e6a7dfd..0000000000 --- a/var/spack/repos/builtin/packages/openfoam-com/zoltan-lib-1612.patch +++ /dev/null @@ -1,84 +0,0 @@ ---- OpenFOAM-v1612+.orig/applications/utilities/mesh/manipulation/renumberMesh/Allwmake 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/applications/utilities/mesh/manipulation/renumberMesh/Allwmake 2017-03-28 11:13:35.222727218 +0200 -@@ -4,20 +4,35 @@ - # Parse arguments for compilation (at least for error catching) - . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments - --export COMPILE_FLAGS='' --export LINK_FLAGS='' -+unset COMP_FLAGS LINK_FLAGS - - if [ -f "${FOAM_LIBBIN}/libSloanRenumber.so" ] - then -- echo "Found libSloanRenumber.so -- enabling Sloan renumbering support." -+ echo " found libSloanRenumber -- enabling sloan renumbering support." - export LINK_FLAGS="${LINK_FLAGS} -lSloanRenumber" - fi - --if [ -f "${ZOLTAN_ARCH_PATH}/lib/libzoltan.a" -a -f "${FOAM_LIBBIN}/libzoltanRenumber.so" ] -+if [ -f "${FOAM_LIBBIN}/libzoltanRenumber.so" ] - then -- echo "Found libzoltanRenumber.so -- enabling zoltan renumbering support." -- export COMPILE_FLAGS="-DFOAM_USE_ZOLTAN" -- export LINK_FLAGS="${LINK_FLAGS} -lzoltanRenumber -L${ZOLTAN_ARCH_PATH}/lib -lzoltan" -+ if [ -z "$ZOLTAN_ARCH_PATH" ] -+ then -+ # Optional: get ZOLTAN_ARCH_PATH -+ if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan) -+ then -+ . $settings -+ fi -+ fi -+ -+ for libdir in lib "lib${WM_COMPILER_LIB_ARCH}" -+ do -+ if [ -f "$ZOLTAN_ARCH_PATH/$libdir/libzoltan.a" ] -+ then -+ echo " found libzoltanRenumber -- enabling zoltan renumbering support." -+ export COMP_FLAGS="-DFOAM_USE_ZOLTAN" -+ export LINK_FLAGS="${LINK_FLAGS} -lzoltanRenumber -L$ZOLTAN_ARCH_PATH/$libdir -lzoltan" -+ break -+ fi -+ done - fi - - wmake $targetType ---- OpenFOAM-v1612+.orig/src/renumber/Allwmake 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/src/renumber/Allwmake 2017-03-28 11:10:22.195543610 +0200 -@@ -5,14 +5,11 @@ - targetType=libso - . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments - --## Get ZOLTAN_ARCH_PATH --#if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan) --#then --# . $settings --# echo "using ZOLTAN_ARCH_PATH=$ZOLTAN_ARCH_PATH" --#else --# echo "Error: no config.sh/zoltan settings" --#fi -+# Optional: get ZOLTAN_ARCH_PATH -+if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan) -+then -+ . $settings -+fi - - wmake $targetType renumberMethods - ---- OpenFOAM-v1612+.orig/src/renumber/zoltanRenumber/Make/options 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/src/renumber/zoltanRenumber/Make/options 2017-03-28 11:50:46.484343848 +0200 -@@ -4,10 +4,13 @@ - EXE_INC = \ - /* -DFULLDEBUG -g -O0 */ \ - $(PFLAGS) $(PINC) \ -+ ${c++LESSWARN} \ - -I$(FOAM_SRC)/renumber/renumberMethods/lnInclude \ - -I$(ZOLTAN_ARCH_PATH)/include/ \ - -I$(LIB_SRC)/meshTools/lnInclude - - LIB_LIBS = \ -- /* -L$(ZOLTAN_ARCH_PATH)/lib -lzoltan */ \ -+ -L$(ZOLTAN_ARCH_PATH)/lib \ -+ -L$(ZOLTAN_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \ -+ -lzoltan \ - -lmeshTools diff --git a/var/spack/repos/builtin/packages/openfoam-org/41-etc.patch b/var/spack/repos/builtin/packages/openfoam-org/41-etc.patch new file mode 100644 index 0000000000..6fe3b7b4d3 --- /dev/null +++ b/var/spack/repos/builtin/packages/openfoam-org/41-etc.patch @@ -0,0 +1,25 @@ +--- OpenFOAM-4.x.orig/etc/bashrc 2016-10-16 16:11:45.000000000 +0200 ++++ OpenFOAM-4.x/etc/bashrc 2017-03-24 12:41:25.233267894 +0100 +@@ -43,17 +43,17 @@ + # Please set to the appropriate path if the default is not correct. + # + [ $BASH_SOURCE ] && \ +-export FOAM_INST_DIR=$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \ +-export FOAM_INST_DIR=$HOME/$WM_PROJECT +-# export FOAM_INST_DIR=~$WM_PROJECT +-# export FOAM_INST_DIR=/opt/$WM_PROJECT +-# export FOAM_INST_DIR=/usr/local/$WM_PROJECT ++FOAM_INST_DIR=$(\cd $(dirname $BASH_SOURCE)/../.. && \pwd -P) || \ ++FOAM_INST_DIR=$HOME/$WM_PROJECT ++# FOAM_INST_DIR=/opt/$WM_PROJECT ++# FOAM_INST_DIR=/usr/local/$WM_PROJECT + # + # Build foamyHexMesh + export FOAMY_HEX_MESH=yes + # + # END OF (NORMAL) USER EDITABLE PART + ################################################################################ ++export FOAM_INST_DIR + + # The default environment variables below can be overridden in a prefs.sh file + # located in ~/.OpenFOAM/$WM_PROJECT_VERSION, ~/.OpenFOAM, diff --git a/var/spack/repos/builtin/packages/openfoam-org/41-site.patch b/var/spack/repos/builtin/packages/openfoam-org/41-site.patch new file mode 100644 index 0000000000..d988c2f9b8 --- /dev/null +++ b/var/spack/repos/builtin/packages/openfoam-org/41-site.patch @@ -0,0 +1,42 @@ +diff -uw OpenFOAM-v1612+.orig/etc/config.sh/settings OpenFOAM-v1612+/etc/config.sh/settings +--- OpenFOAM-v1612+.orig/etc/config.sh/settings 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/etc/config.sh/settings 2017-03-23 12:22:52.002101020 +0100 +@@ -141,7 +141,7 @@ + #------------------------------------------------------------------------------ + + # Location of the jobControl directory +-export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl ++export FOAM_JOB_DIR=$HOME/.OpenFOAM/jobControl #SPACK: non-central location + + # wmake configuration + export WM_DIR=$WM_PROJECT_DIR/wmake +@@ -157,7 +157,7 @@ + export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib + + # Site-specific directory +-siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_INST_DIR/site}" ++siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_DIR/site}" #SPACK: not in parent directory + + # Shared site executables/libraries + # Similar naming convention as ~OpenFOAM expansion +diff -uw OpenFOAM-v1612+.orig/etc/config.csh/settings OpenFOAM-v1612+/etc/config.csh/settings +--- OpenFOAM-v1612+.orig/etc/config.csh/settings 2016-12-23 15:22:59.000000000 +0100 ++++ OpenFOAM-v1612+/etc/config.csh/settings 2017-03-23 12:23:52.737891912 +0100 +@@ -137,7 +137,7 @@ + #------------------------------------------------------------------------------ + + # Location of the jobControl directory +-setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl ++setenv FOAM_JOB_DIR=$HOME/.OpenFOAM/jobControl #SPACK: non-central location + + # wmake configuration + setenv WM_DIR $WM_PROJECT_DIR/wmake +@@ -156,7 +156,7 @@ + if ( $?WM_PROJECT_SITE ) then + set siteDir=$WM_PROJECT_SITE + else +- set siteDir=$WM_PROJECT_INST_DIR/site ++ set siteDir=$WM_PROJECT_DIR/site #SPACK: not in parent directory + endif + + # Shared site executables/libraries diff --git a/var/spack/repos/builtin/packages/openfoam-org/openfoam-etc-41.patch b/var/spack/repos/builtin/packages/openfoam-org/openfoam-etc-41.patch deleted file mode 100644 index 6fe3b7b4d3..0000000000 --- a/var/spack/repos/builtin/packages/openfoam-org/openfoam-etc-41.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- OpenFOAM-4.x.orig/etc/bashrc 2016-10-16 16:11:45.000000000 +0200 -+++ OpenFOAM-4.x/etc/bashrc 2017-03-24 12:41:25.233267894 +0100 -@@ -43,17 +43,17 @@ - # Please set to the appropriate path if the default is not correct. - # - [ $BASH_SOURCE ] && \ --export FOAM_INST_DIR=$(cd ${BASH_SOURCE%/*/*/*} && pwd -P) || \ --export FOAM_INST_DIR=$HOME/$WM_PROJECT --# export FOAM_INST_DIR=~$WM_PROJECT --# export FOAM_INST_DIR=/opt/$WM_PROJECT --# export FOAM_INST_DIR=/usr/local/$WM_PROJECT -+FOAM_INST_DIR=$(\cd $(dirname $BASH_SOURCE)/../.. && \pwd -P) || \ -+FOAM_INST_DIR=$HOME/$WM_PROJECT -+# FOAM_INST_DIR=/opt/$WM_PROJECT -+# FOAM_INST_DIR=/usr/local/$WM_PROJECT - # - # Build foamyHexMesh - export FOAMY_HEX_MESH=yes - # - # END OF (NORMAL) USER EDITABLE PART - ################################################################################ -+export FOAM_INST_DIR - - # The default environment variables below can be overridden in a prefs.sh file - # located in ~/.OpenFOAM/$WM_PROJECT_VERSION, ~/.OpenFOAM, diff --git a/var/spack/repos/builtin/packages/openfoam-org/openfoam-site-41.patch b/var/spack/repos/builtin/packages/openfoam-org/openfoam-site-41.patch deleted file mode 100644 index d988c2f9b8..0000000000 --- a/var/spack/repos/builtin/packages/openfoam-org/openfoam-site-41.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -uw OpenFOAM-v1612+.orig/etc/config.sh/settings OpenFOAM-v1612+/etc/config.sh/settings ---- OpenFOAM-v1612+.orig/etc/config.sh/settings 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/etc/config.sh/settings 2017-03-23 12:22:52.002101020 +0100 -@@ -141,7 +141,7 @@ - #------------------------------------------------------------------------------ - - # Location of the jobControl directory --export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl -+export FOAM_JOB_DIR=$HOME/.OpenFOAM/jobControl #SPACK: non-central location - - # wmake configuration - export WM_DIR=$WM_PROJECT_DIR/wmake -@@ -157,7 +157,7 @@ - export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/lib - - # Site-specific directory --siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_INST_DIR/site}" -+siteDir="${WM_PROJECT_SITE:-$WM_PROJECT_DIR/site}" #SPACK: not in parent directory - - # Shared site executables/libraries - # Similar naming convention as ~OpenFOAM expansion -diff -uw OpenFOAM-v1612+.orig/etc/config.csh/settings OpenFOAM-v1612+/etc/config.csh/settings ---- OpenFOAM-v1612+.orig/etc/config.csh/settings 2016-12-23 15:22:59.000000000 +0100 -+++ OpenFOAM-v1612+/etc/config.csh/settings 2017-03-23 12:23:52.737891912 +0100 -@@ -137,7 +137,7 @@ - #------------------------------------------------------------------------------ - - # Location of the jobControl directory --setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl -+setenv FOAM_JOB_DIR=$HOME/.OpenFOAM/jobControl #SPACK: non-central location - - # wmake configuration - setenv WM_DIR $WM_PROJECT_DIR/wmake -@@ -156,7 +156,7 @@ - if ( $?WM_PROJECT_SITE ) then - set siteDir=$WM_PROJECT_SITE - else -- set siteDir=$WM_PROJECT_INST_DIR/site -+ set siteDir=$WM_PROJECT_DIR/site #SPACK: not in parent directory - endif - - # Shared site executables/libraries diff --git a/var/spack/repos/builtin/packages/openfoam-org/package.py b/var/spack/repos/builtin/packages/openfoam-org/package.py index a31cc2e210..bc0658597a 100644 --- a/var/spack/repos/builtin/packages/openfoam-org/package.py +++ b/var/spack/repos/builtin/packages/openfoam-org/package.py @@ -103,8 +103,8 @@ class OpenfoamOrg(Package): assets = ['bin/foamEtcFile'] # Version-specific patches - patch('openfoam-etc-41.patch', when='@4.1') - patch('openfoam-site-41.patch', when='@4.1') + patch('41-etc.patch', when='@4.1') + patch('41-site.patch', when='@4.1') # Some user config settings config = { @@ -134,7 +134,6 @@ class OpenfoamOrg(Package): run_env.set('WM_PROJECT_DIR', self.projectdir) for d in ['wmake', self.archbin]: # bin already added automatically run_env.prepend_path('PATH', join_path(self.projectdir, d)) - run_env.set('MPI_BUFFER_SIZE', "20000000") def setup_dependent_environment(self, spack_env, run_env, dependent_spec): """Provide location of the OpenFOAM project. -- cgit v1.2.3-70-g09d2