Commit bffad7c1 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

Merge remote-tracking branch 'origin/master' into develop

parents 2c235578 a0368f32
......@@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
# \\/ M anipulation | Copyright (C) 2017-2019 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
......@@ -300,8 +300,14 @@ case INTELMPI:
echo " Currently using '$MPI_ARCH_PATH'"
endif
_foamAddPath $MPI_ARCH_PATH/bin64
_foamAddLib $MPI_ARCH_PATH/lib64
# Newer versions (5.0.3 or earlier?) with intel64/bin ...
if ( -d "$MPI_ARCH_PATH/intel64/bin" ) then
_foamAddPath "$MPI_ARCH_PATH/intel64/bin"
_foamAddLib "$MPI_ARCH_PATH/intel64/lib"
else
_foamAddPath "$MPI_ARCH_PATH/bin64"
_foamAddLib "$MPI_ARCH_PATH/lib64"
endif
breaksw
endsw
......
......@@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
# \\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
......@@ -29,7 +29,7 @@
# ParaView_DIR
# PV_PLUGIN_PATH
# The OpenFOAM plugin must be the first in PV_PLUGIN_PATH and have
# paraview-major.minor version encoded in its name.
# paraview-major.minor encoded in its name.
#
# For central installations not located under ThirdParty, the environment
# values must be set manually. For example,
......@@ -66,16 +66,10 @@ set archDir="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER"
eval `$WM_PROJECT_DIR/bin/foamCleanPath -csh-env=PATH "$ParaView_DIR $archDir/ParaView- $archDir/qt- $archDir/cmake-"`
eval `$WM_PROJECT_DIR/bin/foamCleanPath -csh-env=LD_LIBRARY_PATH "$ParaView_DIR $archDir/ParaView- $archDir/qt-"`
# ThirdParty cmake
set cmake="$archDir/$cmake_version"
if ( -r "$cmake/bin/cmake" ) then
# _foamAddPath not available when foamPV alias is used
setenv PATH "$cmake/bin:${PATH}"
endif
# Evaluate command-line parameters for ParaView
# Evaluate command-line parameters for ParaView and cmake
while ( $#argv > 0 )
switch ($argv[1])
case cmake*=*:
case ParaView*=*:
# name=value -> set name=value
eval "set $argv[1]"
......@@ -84,6 +78,13 @@ while ( $#argv > 0 )
shift
end
# ThirdParty cmake
set cmake="$archDir/$cmake_version"
if ( -r "$cmake/bin/cmake" ) then
# _foamAddPath not available when foamPV alias is used
setenv PATH "$cmake/bin:${PATH}"
endif
if ($?ParaView_VERSION) then
switch ("$ParaView_VERSION")
case "":
......
......@@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
# \\/ M anipulation | Copyright (C) 2017-2019 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
......@@ -303,8 +303,15 @@ INTELMPI)
export FOAM_MPI MPI_ARCH_PATH
_foamAddPath $MPI_ARCH_PATH/bin64
_foamAddLib $MPI_ARCH_PATH/lib64
# Newer versions (5.0.3 or earlier?) with intel64/bin ...
if [ -d "$MPI_ARCH_PATH/intel64/bin" ]
then
_foamAddPath "$MPI_ARCH_PATH/intel64/bin"
_foamAddLib "$MPI_ARCH_PATH/intel64/lib"
else
_foamAddPath "$MPI_ARCH_PATH/bin64"
_foamAddLib "$MPI_ARCH_PATH/lib64"
fi
;;
esac
......
......@@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
# \\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
......@@ -71,25 +71,25 @@ eval \
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=LD_LIBRARY_PATH \
$ParaView_DIR $archDir/ParaView- $archDir/qt-)"
# ThirdParty cmake
cmake="$archDir/$cmake_version"
if [ -r "$cmake/bin/cmake" ]
then
# _foamAddPath not available when foamPV function is used
PATH="$cmake/bin:$PATH"
fi
# Evaluate command-line parameters for ParaView
# Evaluate command-line parameters for ParaView and cmake
for i
do
case "$i" in
(ParaView*=*)
(cmake*=* | ParaView*=*)
# name=value -> export name=value
eval "export $i"
;;
esac
done
# ThirdParty cmake
cmake="$archDir/$cmake_version"
if [ -r "$cmake/bin/cmake" ]
then
# _foamAddPath not available when foamPV function is used
PATH="$cmake/bin:$PATH"
fi
case "$ParaView_VERSION" in
('')
# empty - do nothing
......
Subproject commit f0c9f44bcb94a2bdb195fb60ccf32a9615f05ff1
Subproject commit 22a67b4d48436563896c5d7df1ba63c3f93ba07a
......@@ -224,7 +224,15 @@ Foam::vtk::Tools::zeroField
data->SetNumberOfComponents(static_cast<int>(pTraits<Type>::nComponents));
data->SetNumberOfTuples(size);
// Fill() was not available before VTK-8
#if (VTK_MAJOR_VERSION < 8)
for (int i = 0; i < data->GetNumberOfComponents(); ++i)
{
data->FillComponent(i, 0);
}
#else
data->Fill(0);
#endif
return data;
}
......
#!/bin/bash
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
......@@ -26,7 +26,7 @@
# wmakeBuildInfo
#
# Description
# Print the version used when building the project
# Print the api/version and other build information for the project.
#
# Environment
# - WM_PROJECT_DIR
......@@ -51,7 +51,7 @@ usage() {
Usage: ${0##*/} [OPTION]
${0##*/} [-update] -filter FILE
options:
-check Compare make and meta information (exit 0 for no changes)
-cmp, -check Compare make and meta information (exit 0 for no changes)
-diff Display differences between make and meta information
(exit code 0 for no changes)
-dry-run In combination with -update
......@@ -96,7 +96,7 @@ do
-h | -help*)
usage
;;
-check)
-cmp | -check)
optCheck=true
;;
-diff)
......@@ -156,12 +156,11 @@ fi
#------------------------------------------------------------------------------
# Variables
declare -A makeInfo
declare -A metaInfo
# Variables - for portability, avoiding bash associative arrays
unset make_info meta_info
#
# Populate makeInfo array
# Populate make_* variables
#
# - api : from rules/General/general
# - patch : cached value from previous make
......@@ -177,10 +176,9 @@ declare -A metaInfo
#
# - Working on detached head.
# -> branch has value "HEAD" instead of something more readable.
#
getMakeInfo()
{
if [ "${#makeInfo[*]}" -eq 4 ]
if [ -n "$make_info" ]
then
##echo "use cached value for make info" 1>&2
return 0
......@@ -188,7 +186,7 @@ getMakeInfo()
##echo "get make info" 1>&2
local api patch build branch
makeInfo=()
unset make_api make_patch make_branch make_build
# (api) from WM_DIR/rules/General/general
# - extract WM_VERSION = OPENFOAM=<digits>
......@@ -211,15 +209,15 @@ getMakeInfo()
branch="$(git --git-dir=$WM_PROJECT_DIR/.git rev-parse --abbrev-ref HEAD 2>/dev/null)"
fi
makeInfo[api]="$api"
makeInfo[patch]="${patch:-0}" # default is 0
makeInfo[branch]="$branch"
makeInfo[build]="$build"
make_api="$api"
make_patch="${patch:-0}" # Default is 0 (unpatched)
make_branch="$branch"
make_build="$build"
make_info=true
}
#
# Populate metaInfo array
# Populate meta_* variables
#
# - api : from META-INFO/api-info
# - patch : from META-INFO/api-info
......@@ -229,10 +227,9 @@ getMakeInfo()
# Failure modes:
# - Directory, file or entry not found.
# -> corresponding entries are empty strings
#
getMetaInfo()
{
if [ "${#metaInfo[*]}" -eq 4 ]
if [ -n "$meta_info" ]
then
##echo "use cached value for meta info" 1>&2
return 0
......@@ -240,7 +237,7 @@ getMetaInfo()
##echo "get meta info" 1>&2
local api patch build branch
metaInfo=()
unset meta_api meta_patch meta_branch meta_build
if [ -d "$metaInfoDir" ]
then
......@@ -253,14 +250,14 @@ getMetaInfo()
build="$(sed -ne 's@^build *= *\([^ ]*\).*@\1@p' $metaInfoDir/build-info 2>/dev/null)"
fi
metaInfo[api]="$api"
metaInfo[patch]="${patch:-0}" # default is 0
metaInfo[branch]="$branch"
metaInfo[build]="$build"
meta_api="$api"
meta_patch="${patch:-0}" # Default is 0 (unpatched)
meta_branch="$branch"
meta_build="$build"
meta_info=true
}
#
# Get api from rules/General/general
#
# Failure modes:
......@@ -268,18 +265,17 @@ getMetaInfo()
# -> Fatal for building, but could be OK for a stripped down version
#
# Fallback. Get from api-info
#
getApi()
{
getMakeInfo
# Local copy
local api="${makeInfo[api]}"
local api="${make_api}"
if [ -z "$api" ]
then
getMetaInfo
api="${metaInfo[api]}"
api="${meta_api}"
fi
if [ -n "$api" ]
......@@ -295,53 +291,69 @@ getApi()
#
# Failure modes:
# - No patch information (can't find file etc).
#
getPatchLevel()
{
getMetaInfo
# Local copy
local value="${metaInfo[patch]}"
local patch="${meta_patch}"
if [ -n "$value" ]
if [ -n "$patch" ]
then
echo "$value"
echo "$patch"
else
return 1
fi
}
#
# Report make info
#
reportMakeInfo()
{
getMakeInfo
getMetaInfo
local patch="${metaInfo[patch]}" # <- From meta-info only
makeInfo[patch]="${patch:=0}" # Extra safety
echo "make"
for key in api patch branch build
do
echo " $key = ${makeInfo[$key]}"
done
echo " api = ${make_api}"
echo " patch = ${meta_patch:-0}" # <- From meta-info only
echo " branch = ${make_branch}"
echo " build = ${make_build}"
}
#
# Report meta info
#
reportMetaInfo()
{
getMetaInfo
local patch="${metaInfo[patch]}" # <- From meta-info only
metaInfo[patch]="${patch:=0}" # Extra safety
echo "meta"
for key in api patch branch build
do
echo " $key = ${metaInfo[$key]}"
done
echo " api = ${meta_api}"
echo " patch = ${meta_patch:-0}" # <- From meta-info only
echo " branch = ${meta_branch}"
echo " build = ${meta_build}"
}
# Report diff between make and meta info (single key).
# Set diff_header prior to the first call.
# $1 == key
# $2 == make value
# $3 == meta value
unset diff_header
_reportDiff()
{
if [ -n "$diff_header" ]
then
echo "$diff_header"
unset diff_header
fi
echo "$1:"
echo " make $2"
echo " meta $3"
}
......@@ -350,50 +362,68 @@ reportMetaInfo()
# $1 == verbose, print as diff. Silent otherwise
checkDiff()
{
local verbose="$1"
local key diff
local diff verbose
if [ "$1" = "verbose" ]
then
diff_header="Differences"
verbose=true
fi
getMakeInfo
getMetaInfo
for key in api patch branch build
do
if [ "${makeInfo[$key]}" != "${metaInfo[$key]}" ]
# api
if [ "${make_api}" != "${meta_api}" ]
then
diff=true
if [ -n "$verbose" ]
then
case "$key" in
(branch | build)
# Only trigger when make info (branch, build) are non-empty
if [ -n "${makeInfo[$key]}" ]
then
diff="$diff $key"
fi
;;
(*)
diff="$diff $key"
;;
esac
_reportDiff "api" "${make_api}" "${meta_api}"
fi
done
fi
if [ "$verbose" = verbose ] && [ -n "$diff" ]
# patch
if [ "${make_patch}" != "${meta_patch}" ]
then
echo "Differences"
for key in $diff
do
echo "$key:"
echo " make ${makeInfo[$key]}"
echo " meta ${metaInfo[$key]}"
done
diff=true
if [ -n "$verbose" ]
then
_reportDiff "patch" "${make_patch}" "${meta_patch}"
fi
fi
# branch - only test when make info is non-empty
if [ -n "${make_branch}" ] && [ "${make_branch}" != "${meta_branch}" ]
then
diff=true
if [ -n "$verbose" ]
then
_reportDiff "branch" "${make_branch}" "${meta_branch}"
fi
fi
# build - only test when make info is non-empty
if [ -n "${make_build}" ] && [ "${make_build}" != "${meta_build}" ]
then
diff=true
if [ -n "$verbose" ]
then
_reportDiff "build" "${make_build}" "${meta_build}"
fi
fi
# No diffs, but never permit entirely empty values for build.
test -z "$diff" || test -z "${makeInfo[build]}${metaInfo[build]}"
test -z "$diff" || test -z "${make_build}${meta_build}"
}
#
# Update metaInfo (on disk) based on the makeInfo
# Update meta info (on disk) based on the make info
#
performUpdate()
{
......@@ -401,16 +431,16 @@ performUpdate()
getMetaInfo
# Local copies of the make info
local api="${makeInfo[api]}"
local branch="${makeInfo[branch]}"
local build="${makeInfo[build]}"
local patch="${makeInfo[patch]}"
local api="${make_api}"
local branch="${make_branch}"
local build="${make_build}"
local patch="${make_patch}"
# If any of the make-info are empty (bad),
# use the meta-info to avoid spurious changes
[ -n "$api" ] || api="${metaInfo[api]}"
[ -n "$branch" ] || branch="${metaInfo[branch]}"
[ -n "$build" ] || build="${metaInfo[build]}"
[ -n "$api" ] || api="${meta_api}"
[ -n "$branch" ] || branch="${meta_branch}"
[ -n "$build" ] || build="${meta_build}"
# Fallback to WM_PROJECT_VERSION alone
[ -n "$build" ] || build="${WM_PROJECT_VERSION:-unknown}"
......@@ -419,12 +449,11 @@ performUpdate()
# build-info
outputFile="$metaInfoDir/build-info"
if [ "$branch" != "${metaInfo[branch]}" ] || \
[ "$build" != "${metaInfo[build]}" ] || \
[ "$patch" != "${metaInfo[patch]}" ]
if [ "$branch" != "${meta_branch}" ] || \
[ "$build" != "${meta_build}" ] || \
[ "$patch" != "${meta_patch}" ]
then
patch="${metaInfo[patch]}" # <- From meta-info only
: "${patch:=0}" # Extra safety
patch="${meta_patch:-0}" # <- From meta-info only
if [ -n "$optDryRun" ]
then
......@@ -441,10 +470,9 @@ performUpdate()
# api-info
outputFile="$metaInfoDir/api-info"
if [ "$api" != "${metaInfo[api]}" ]
if [ "$api" != "${meta_api}" ]
then
patch="${metaInfo[patch]}" # <- From meta-info only
: "${patch:=0}" # Extra safety
patch="${meta_patch:-0}" # <- From meta-info only
if [ -n "$optDryRun" ]
then
......@@ -461,8 +489,7 @@ performUpdate()
#
# Update metaInfo (on disk) based on the makeInfo
# This is the
# Update meta info (on disk) based on the make info
#
performFiltering()
{
......@@ -477,11 +504,10 @@ performFiltering()
getMetaInfo
# Local copies of the make info
local api="${makeInfo[api]}"
local branch="${makeInfo[branch]}"
local build="${makeInfo[build]}"
local patch="${metaInfo[patch]}" # <- From meta-info only
: "${patch:=0}" # Extra safety
local api="${make_api}"
local branch="${make_branch}"
local build="${make_build}"
local patch="${meta_patch:-0}" # <- From meta-info only
# If any of the make-info are empty (bad),
......@@ -492,19 +518,20 @@ performFiltering()
if [ -z "$api" ]
then
api="${metaInfo[api]}"
api="${meta_api}"
api="${api:-0}" # integer value
fi
# branch/build could be missing for non-git
if [ -z "$branch" ]
then
branch="${metaInfo[branch]}"
branch="${meta_branch}"
branch="${branch:-unknown}"
fi
if [ -z "$build" ]
then
build="${metaInfo[build]}"
build="${meta_build}"
# Fallback to WM_PROJECT_VERSION
build="${build:-${WM_PROJECT_VERSION:-unknown}}"
fi
......@@ -523,7 +550,7 @@ performFiltering()
#------------------------------------------------------------------------------
# Dispatching
# Dispatch
if [ -n "$optCheck" ]
then
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment