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

This commit is contained in:
Mark Olesen
2020-04-16 00:45:11 +02:00
25 changed files with 241 additions and 147 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd. Copyright (C) 2015-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -530,17 +530,13 @@ void Foam::functionObjects::forces::addToFields
return; return;
} }
volVectorField& force = auto& force = lookupObjectRef<volVectorField>(fieldName("force"));
lookupObjectRef<volVectorField>(fieldName("force"));
vectorField& pf = force.boundaryFieldRef()[patchi]; vectorField& pf = force.boundaryFieldRef()[patchi];
pf += fN + fT + fP; pf += fN + fT + fP;
volVectorField& moment = auto& moment = lookupObjectRef<volVectorField>(fieldName("moment"));
lookupObjectRef<volVectorField>(fieldName("moment"));
vectorField& pm = moment.boundaryFieldRef()[patchi]; vectorField& pm = moment.boundaryFieldRef()[patchi];
pm += Md; pm = Md^pf;
} }
@ -558,17 +554,14 @@ void Foam::functionObjects::forces::addToFields
return; return;
} }
volVectorField& force = auto& force = lookupObjectRef<volVectorField>(fieldName("force"));
lookupObjectRef<volVectorField>(fieldName("force")); auto& moment = lookupObjectRef<volVectorField>(fieldName("moment"));
volVectorField& moment =
lookupObjectRef<volVectorField>(fieldName("moment"));
forAll(cellIDs, i) forAll(cellIDs, i)
{ {
label celli = cellIDs[i]; label celli = cellIDs[i];
force[celli] += fN[i] + fT[i] + fP[i]; force[celli] += fN[i] + fT[i] + fP[i];
moment[celli] += Md[i]; moment[celli] = Md[i]^force[celli];
} }
} }

View File

@ -1,8 +0,0 @@
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
# -
# Clang provides 'omp' and a link for 'gomp'.
# With 'gomp' we can use system libs.
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp

View File

@ -0,0 +1 @@
openmp-gomp

View File

@ -0,0 +1,8 @@
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
# -
# Clang provides 'omp' and a link for 'gomp'.
# With 'gomp' we can also use system libs.
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lgomp

View File

@ -0,0 +1,5 @@
# Flags for compiling/linking openmp
# The USE_OMP is for OpenFOAM-specific use (general use is _OPENMP)
COMP_OPENMP = -DUSE_OMP -fopenmp
LINK_OPENMP = -lomp

View File

@ -14,25 +14,29 @@ GLIBS = -lm
GLIB_LIBS = GLIB_LIBS =
COMPILER_FAMILY = $(shell echo "$(WM_COMPILER)" | sed -e 's/[0-9].*//') ARCHITECTURE_RULES = $(WM_DIR)/rules/$(WM_ARCH)
DEFAULT_RULES = $(WM_DIR)/rules/$(WM_ARCH)$(COMPILER_FAMILY) COMPILER_FAMILY = $(shell echo "$(WM_COMPILER)" | sed -e 's/[-+.0-9~].*//')
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER) DEFAULT_RULES = $(ARCHITECTURE_RULES)$(COMPILER_FAMILY)
RULES = $(ARCHITECTURE_RULES)$(WM_COMPILER)
WMAKE_BIN = $(WM_PROJECT_DIR)/platforms/tools/$(WM_ARCH)$(WM_COMPILER) WMAKE_BIN = $(WM_PROJECT_DIR)/platforms/tools/$(WM_ARCH)$(WM_COMPILER)
# Default compilation is 'Opt' - never permit an empty value # Default compilation is 'Opt' - never permit an empty value
ifeq ($(WM_COMPILE_OPTION),) ifeq (,$(WM_COMPILE_OPTION))
WM_COMPILE_OPTION = Opt WM_COMPILE_OPTION = Opt
endif endif
ifeq ($(WM_SCHEDULER),) ifeq (,$(WM_SCHEDULER))
AND = && AND = &&
else else
AND = '&&' AND = '&&'
endif endif
include $(DEFAULT_RULES)/general include $(DEFAULT_RULES)/general
sinclude $(DEFAULT_RULES)/override
ifneq ("$(COMPILER_FAMILY)","$(WM_COMPILER)")
sinclude $(RULES)/general sinclude $(RULES)/general
sinclude $(RULES)/c++ sinclude $(RULES)/c++
endif
include $(GENERAL_RULES)/transform include $(GENERAL_RULES)/transform
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -1,3 +0,0 @@
PFLAGS =
PINC =
PLIBS =

1
wmake/rules/General/mplib Symbolic link
View File

@ -0,0 +1 @@
no-mpi

View File

@ -0,0 +1,7 @@
# Empty flags for not compiling/linking MPI
PFLAGS =
PINC =
PLIBS =
#------------------------------------------------------------------------------

View File

@ -0,0 +1,6 @@
# Empty flags for not compiling/linking OPENMP
COMP_OPENMP =
LINK_OPENMP =
#------------------------------------------------------------------------------

View File

@ -3,7 +3,16 @@ CPP = cpp -traditional-cpp $(GFLAGS)
PROJECT_LIBS = -l$(WM_PROJECT) -ldl PROJECT_LIBS = -l$(WM_PROJECT) -ldl
include $(GENERAL_RULES)/standard include $(GENERAL_RULES)/standard
include $(GENERAL_RULES)/Clang/openmp ## include $(GENERAL_RULES)/Clang/openmp
# Darwin-specific
# ----
COMP_OPENMP = -DUSE_OMP -Xpreprocessor -fopenmp
LINK_OPENMP = -lomp
# ----
# Or disable
# include $(GENERAL_RULES)/no-openmp
# ----
include $(DEFAULT_RULES)/c include $(DEFAULT_RULES)/c
include $(DEFAULT_RULES)/c++ include $(DEFAULT_RULES)/c++

View File

@ -8,14 +8,14 @@
# Copyright (C) 2017-2020 OpenCFD Ltd. # Copyright (C) 2017-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM, licensed under GNU General Public License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
# <http://www.gnu.org/licenses/>.
# #
# Script # Script
# cmakeFunctions # cmakeFunctions
# #
# Description # Description
# Helper functions for CMake # Helper functions for CMake
#
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions . ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions

View File

@ -37,7 +37,6 @@
no_adios2() no_adios2()
{ {
unset HAVE_ADIOS2 ADIOS2_INC_DIR ADIOS2_LIB_DIR unset HAVE_ADIOS2 ADIOS2_INC_DIR ADIOS2_LIB_DIR
return 0
} }
@ -88,11 +87,10 @@ query_adios2()
# -> HAVE_ADIOS2, ADIOS2_INC_DIR, ADIOS2_LIB_DIR # -> HAVE_ADIOS2, ADIOS2_INC_DIR, ADIOS2_LIB_DIR
have_adios2() have_adios2()
{ {
local warn # warn="==> skip adios2"
local config="config.sh/adios2" local config="config.sh/adios2"
local prefix header library incName libName settings warn local settings
# warn="==> skip adios2"
# Setup
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")" if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then then
. "$settings" . "$settings"
@ -102,9 +100,10 @@ have_adios2()
fi fi
# Expected location, include/library names # Expected location, include/library names
prefix="$ADIOS2_ARCH_PATH" local prefix="$ADIOS2_ARCH_PATH"
incName="adios2.h" local incName="adios2.h"
libName="libadios2" local libName="libadios2"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"

View File

@ -18,6 +18,7 @@
# #
# Requires # Requires
# BOOST_ARCH_PATH # BOOST_ARCH_PATH
# or config.sh/CGAL (when BOOST_ARCH_PATH is empty)
# #
# Functions provided # Functions provided
# have_boost, no_boost, echo_boost, query_boost # have_boost, no_boost, echo_boost, query_boost
@ -37,7 +38,6 @@
no_boost() no_boost()
{ {
unset HAVE_BOOST BOOST_INC_DIR BOOST_LIB_DIR unset HAVE_BOOST BOOST_INC_DIR BOOST_LIB_DIR
return 0
} }
@ -72,15 +72,27 @@ query_boost()
# -> HAVE_BOOST, BOOST_INC_DIR, BOOST_LIB_DIR # -> HAVE_BOOST, BOOST_INC_DIR, BOOST_LIB_DIR
have_boost() have_boost()
{ {
local prefix header library incName libName settings warn local warn # warn="==> skip boost"
# warn="==> skip boost" local config="config.sh/CGAL"
local settings
# Setup - from the current environment # Setup - current environment if set
if [ -z "$BOOST_ARCH_PATH" ]
then
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then
. "$settings"
else
[ -n "$warn" ] && echo "$warn (no $config settings)"
return 2
fi
fi
# Expected location, include/library names # Expected location, include/library names
prefix="$BOOST_ARCH_PATH" local prefix="$BOOST_ARCH_PATH"
incName="boost/version.hpp" local incName="boost/version.hpp"
libName="libboost_system" local libName="libboost_system"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"

View File

@ -37,9 +37,9 @@
no_ccmio() no_ccmio()
{ {
unset HAVE_CCMIO CCMIO_INC_DIR CCMIO_LIB_DIR unset HAVE_CCMIO CCMIO_INC_DIR CCMIO_LIB_DIR
return 0
} }
# Report # Report
echo_ccmio() echo_ccmio()
{ {
@ -71,9 +71,9 @@ query_ccmio()
# -> HAVE_CCMIO, CCMIO_INC_DIR, CCMIO_LIB_DIR # -> HAVE_CCMIO, CCMIO_INC_DIR, CCMIO_LIB_DIR
have_ccmio() have_ccmio()
{ {
local warn="==> skip ccmio"
local config="config.sh/ccmio" local config="config.sh/ccmio"
local prefix header library incName libName settings warn local settings
warn="==> skip ccmio"
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")" if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then then
@ -85,9 +85,10 @@ have_ccmio()
# Expected location, include/library names # Expected location, include/library names
# Link with static libccmio only (fewer issues) # Link with static libccmio only (fewer issues)
prefix="$CCMIO_ARCH_PATH" local prefix="$CCMIO_ARCH_PATH"
incName="libccmio/ccmio.h" local incName="libccmio/ccmio.h"
libName="libccmio.a" local libName="libccmio.a"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"

View File

@ -18,6 +18,7 @@
# #
# Requires # Requires
# CGAL_ARCH_PATH # CGAL_ARCH_PATH
# or config.sh/CGAL (when CGAL_ARCH_PATH is empty)
# #
# Functions provided # Functions provided
# have_cgal, no_cgal, echo_cgal, query_cgal # have_cgal, no_cgal, echo_cgal, query_cgal
@ -37,7 +38,6 @@
no_cgal() no_cgal()
{ {
unset HAVE_CGAL CGAL_INC_DIR CGAL_LIB_DIR unset HAVE_CGAL CGAL_INC_DIR CGAL_LIB_DIR
return 0
} }
@ -72,15 +72,27 @@ query_cgal()
# -> HAVE_CGAL, CGAL_INC_DIR, CGAL_LIB_DIR # -> HAVE_CGAL, CGAL_INC_DIR, CGAL_LIB_DIR
have_cgal() have_cgal()
{ {
local prefix header library incName libName settings warn local warn # warn="==> skip cgal"
# warn="==> skip cgal" local config="config.sh/CGAL"
local settings
# Setup - from the current environment # Setup - current environment if set
if [ -z "$CGAL_ARCH_PATH" ]
then
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then
. "$settings"
else
[ -n "$warn" ] && echo "$warn (no $config settings)"
return 2
fi
fi
# Expected location, include/library names # Expected location, include/library names
prefix="$CGAL_ARCH_PATH" local prefix="$CGAL_ARCH_PATH"
incName="CGAL/version.h" local incName="CGAL/version.h"
libName="libCGAL" local libName="libCGAL"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"

View File

@ -18,6 +18,7 @@
# #
# Requires # Requires
# FFTW_ARCH_PATH # FFTW_ARCH_PATH
# or config.sh/FFTW (when FFTW_ARCH_PATH is empty)
# #
# Functions provided # Functions provided
# have_fftw, no_fftw, echo_fftw, query_fftw # have_fftw, no_fftw, echo_fftw, query_fftw
@ -37,7 +38,6 @@
no_fftw() no_fftw()
{ {
unset HAVE_FFTW FFTW_INC_DIR FFTW_LIB_DIR unset HAVE_FFTW FFTW_INC_DIR FFTW_LIB_DIR
return 0
} }
@ -72,15 +72,27 @@ query_fftw()
# -> HAVE_FFTW, FFTW_INC_DIR, FFTW_LIB_DIR # -> HAVE_FFTW, FFTW_INC_DIR, FFTW_LIB_DIR
have_fftw() have_fftw()
{ {
local prefix header library incName libName settings warn local warn # warn="==> skip fftw"
# warn="==> skip fftw" local config="config.sh/FFTW"
local settings
# Setup - from the current environment # Setup - current environment if set
if [ -z "$FFTW_ARCH_PATH" ]
then
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then
. "$settings"
else
[ -n "$warn" ] && echo "$warn (no $config settings)"
return 2
fi
fi
# Expected location, include/library names # Expected location, include/library names
prefix="$FFTW_ARCH_PATH" local prefix="$FFTW_ARCH_PATH"
incName="fftw3.h" local incName="fftw3.h"
libName="libfftw3" local libName="libfftw3"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"

View File

@ -18,6 +18,7 @@
# #
# Requires # Requires
# HYPRE_ARCH_PATH # HYPRE_ARCH_PATH
# or config.sh/hypre
# #
# Functions provided # Functions provided
# have_hypre, no_hypre, echo_hypre, query_hypre # have_hypre, no_hypre, echo_hypre, query_hypre
@ -37,7 +38,6 @@
no_hypre() no_hypre()
{ {
unset HAVE_HYPRE HYPRE_INC_DIR HYPRE_LIB_DIR unset HAVE_HYPRE HYPRE_INC_DIR HYPRE_LIB_DIR
return 0
} }
@ -72,9 +72,9 @@ query_hypre()
# -> HAVE_HYPRE, HYPRE_INC_DIR, HYPRE_LIB_DIR # -> HAVE_HYPRE, HYPRE_INC_DIR, HYPRE_LIB_DIR
have_hypre() have_hypre()
{ {
local warn="==> skip hypre"
local config="config.sh/hypre" local config="config.sh/hypre"
local prefix header library incName libName settings warn local settings
warn="==> skip hypre"
# Setup - prefer current environment value? (TDB) # Setup - prefer current environment value? (TDB)
if [ ! -d "$HYPRE_ARCH_PATH" ] if [ ! -d "$HYPRE_ARCH_PATH" ]
@ -89,9 +89,10 @@ have_hypre()
fi fi
# Expected location, include/library names # Expected location, include/library names
prefix="$HYPRE_ARCH_PATH" local prefix="$HYPRE_ARCH_PATH"
incName="HYPRE.h" local incName="HYPRE.h"
libName="libHYPRE" local libName="libHYPRE"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"

View File

@ -38,7 +38,6 @@ no_kahip()
{ {
unset HAVE_KAHIP KAHIP_ARCH_PATH KAHIP_INC_DIR KAHIP_LIB_DIR unset HAVE_KAHIP KAHIP_ARCH_PATH KAHIP_INC_DIR KAHIP_LIB_DIR
unset KAHIP_VERSION unset KAHIP_VERSION
return 0
} }
@ -73,9 +72,9 @@ query_kahip()
# -> HAVE_KAHIP, KAHIP_ARCH_PATH, KAHIP_INC_DIR, KAHIP_LIB_DIR # -> HAVE_KAHIP, KAHIP_ARCH_PATH, KAHIP_INC_DIR, KAHIP_LIB_DIR
have_kahip() have_kahip()
{ {
local warn="==> skip kahip"
local config="config.sh/kahip" local config="config.sh/kahip"
local prefix header library incName libName settings warn local settings
warn="==> skip kahip"
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")" if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then then
@ -86,9 +85,10 @@ have_kahip()
fi fi
# Expected location, include/library names # Expected location, include/library names
prefix="$KAHIP_ARCH_PATH" local prefix="$KAHIP_ARCH_PATH"
incName="kaHIP_interface.h" local incName="kaHIP_interface.h"
libName="libkahip" local libName="libkahip"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"

View File

@ -38,7 +38,6 @@ no_metis()
{ {
unset HAVE_METIS METIS_ARCH_PATH METIS_INC_DIR METIS_LIB_DIR unset HAVE_METIS METIS_ARCH_PATH METIS_INC_DIR METIS_LIB_DIR
unset METIS_VERSION unset METIS_VERSION
return 0
} }
@ -73,9 +72,9 @@ query_metis()
# -> HAVE_METIS, METIS_ARCH_PATH, METIS_INC_DIR, METIS_LIB_DIR # -> HAVE_METIS, METIS_ARCH_PATH, METIS_INC_DIR, METIS_LIB_DIR
have_metis() have_metis()
{ {
local warn="==> skip metis"
local config="config.sh/metis" local config="config.sh/metis"
local prefix header library incName libName settings warn local settings
warn="==> skip metis"
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")" if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then then
@ -86,9 +85,10 @@ have_metis()
fi fi
# Expected location, include/library names # Expected location, include/library names
prefix="$METIS_ARCH_PATH" local prefix="$METIS_ARCH_PATH"
incName="metis.h" local incName="metis.h"
libName="libmetis" local libName="libmetis"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"

View File

@ -38,7 +38,6 @@ no_mgridgen()
{ {
unset HAVE_MGRIDGEN MGRIDGEN_ARCH_PATH MGRIDGEN_INC_DIR MGRIDGEN_LIB_DIR unset HAVE_MGRIDGEN MGRIDGEN_ARCH_PATH MGRIDGEN_INC_DIR MGRIDGEN_LIB_DIR
unset MGRIDGEN_VERSION unset MGRIDGEN_VERSION
return 0
} }
@ -73,9 +72,9 @@ query_mgridgen()
# -> HAVE_MGRIDGEN, MGRIDGEN_ARCH_PATH, MGRIDGEN_INC_DIR, MGRIDGEN_LIB_DIR # -> HAVE_MGRIDGEN, MGRIDGEN_ARCH_PATH, MGRIDGEN_INC_DIR, MGRIDGEN_LIB_DIR
have_mgridgen() have_mgridgen()
{ {
local warn="==> skip mgridgen"
local config="config.sh/mgridgen" local config="config.sh/mgridgen"
local prefix header library incName libName libName2 settings warn local settings
warn="==> skip mgridgen"
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")" if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then then
@ -86,10 +85,11 @@ have_mgridgen()
fi fi
# Expected location, include/library names # Expected location, include/library names
prefix="$MGRIDGEN_ARCH_PATH" local prefix="$MGRIDGEN_ARCH_PATH"
incName="mgridgen.h" local incName="mgridgen.h"
libName="libMGridGen" local libName="libMGridGen"
libName2="libmgrid" local libName2="libmgrid"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"
@ -126,7 +126,7 @@ have_mgridgen()
# ---------------------------------- # ----------------------------------
local good label scalar local label scalar
# Ensure consistent sizes with OpenFOAM and mgridgen header # Ensure consistent sizes with OpenFOAM and mgridgen header
# Extract typedef for idxtype, realtype # Extract typedef for idxtype, realtype
@ -142,7 +142,6 @@ have_mgridgen()
case "$WM_LABEL_SIZE:$label" in case "$WM_LABEL_SIZE:$label" in
(32:int32_t | 32:int | 64:int64_t | 64:long) (32:int32_t | 32:int | 64:int64_t | 64:long)
good=true
;; ;;
(*) (*)
@ -156,7 +155,6 @@ have_mgridgen()
esac esac
case "$WM_PRECISION_OPTION:$scalar" in case "$WM_PRECISION_OPTION:$scalar" in
(SP:float | SPDP:float | DP:double) (SP:float | SPDP:float | DP:double)
good=true
;; ;;
(*) (*)

View File

@ -18,6 +18,7 @@
# #
# Requires # Requires
# PETSC_ARCH_PATH # PETSC_ARCH_PATH
# or config.sh/petsc
# #
# Functions provided # Functions provided
# have_petsc, no_petsc, echo_petsc, hint_petsc, query_petsc # have_petsc, no_petsc, echo_petsc, hint_petsc, query_petsc
@ -37,7 +38,6 @@
no_petsc() no_petsc()
{ {
unset HAVE_PETSC PETSC_INC_DIR PETSC_LIB_DIR unset HAVE_PETSC PETSC_INC_DIR PETSC_LIB_DIR
return 0
} }
@ -88,9 +88,9 @@ query_petsc()
# -> HAVE_PETSC, PETSC_INC_DIR, PETSC_LIB_DIR # -> HAVE_PETSC, PETSC_INC_DIR, PETSC_LIB_DIR
have_petsc() have_petsc()
{ {
local warn="==> skip petsc"
local config="config.sh/petsc" local config="config.sh/petsc"
local prefix header library incName libName pkgName settings warn local settings
warn="==> skip petsc"
# Setup - prefer current environment value? (TDB) # Setup - prefer current environment value? (TDB)
if [ ! -d "$PETSC_ARCH_PATH" ] if [ ! -d "$PETSC_ARCH_PATH" ]
@ -105,10 +105,11 @@ have_petsc()
fi fi
# Expected location, include/library names # Expected location, include/library names
prefix="$PETSC_ARCH_PATH" local prefix="$PETSC_ARCH_PATH"
incName="petsc.h" local incName="petsc.h"
libName="libpetsc" local libName="libpetsc"
pkgName="PETSc" local pkgName="PETSc"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"

View File

@ -36,7 +36,6 @@
no_readline() no_readline()
{ {
unset HAVE_LIBREADLINE READLINE_INC_DIR READLINE_LIB_DIR unset HAVE_LIBREADLINE READLINE_INC_DIR READLINE_LIB_DIR
return 0
} }
@ -53,13 +52,14 @@ echo_readline()
# -> HAVE_LIBREADLINE, READLINE_INC_DIR, READLINE_LIB_DIR # -> HAVE_LIBREADLINE, READLINE_INC_DIR, READLINE_LIB_DIR
have_readline() have_readline()
{ {
local prefix header library incName libName settings warn local warn # warn="==> skip readline"
# warn="==> skip readline" local settings
# Expected location, include/library names # Expected location, include/library names
prefix=system local prefix=system
incName="readline/readline.h" local incName="readline/readline.h"
libName="libreadline" local libName="libreadline"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"

View File

@ -39,7 +39,6 @@ no_scotch()
unset HAVE_SCOTCH SCOTCH_ARCH_PATH SCOTCH_INC_DIR SCOTCH_LIB_DIR unset HAVE_SCOTCH SCOTCH_ARCH_PATH SCOTCH_INC_DIR SCOTCH_LIB_DIR
unset SCOTCH_VERSION unset SCOTCH_VERSION
unset HAVE_PTSCOTCH PTSCOTCH_ARCH_PATH PTSCOTCH_INC_DIR PTSCOTCH_LIB_DIR unset HAVE_PTSCOTCH PTSCOTCH_ARCH_PATH PTSCOTCH_INC_DIR PTSCOTCH_LIB_DIR
return 0
} }
@ -79,9 +78,9 @@ query_scotch()
# -> HAVE_SCOTCH, SCOTCH_ARCH_PATH, SCOTCH_INC_DIR, SCOTCH_LIB_DIR # -> HAVE_SCOTCH, SCOTCH_ARCH_PATH, SCOTCH_INC_DIR, SCOTCH_LIB_DIR
have_scotch() have_scotch()
{ {
local warn="==> skip scotch"
local config="config.sh/scotch" local config="config.sh/scotch"
local prefix header library incName libName settings warn local settings
warn="==> skip scotch"
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")" if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then then
@ -92,9 +91,11 @@ have_scotch()
fi fi
# Expected location, include/library names # Expected location, include/library names
prefix="$SCOTCH_ARCH_PATH" local prefix="$SCOTCH_ARCH_PATH"
incName="scotch.h" local incName="scotch.h"
libName="libscotch" local libName="libscotch"
local localDir="scotch-int$WM_LABEL_SIZE"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"
@ -103,13 +104,18 @@ have_scotch()
return 1 return 1
elif hasAbsdir "$prefix" elif hasAbsdir "$prefix"
then then
header=$(findFirstFile "$prefix/include/$incName") header=$(findFirstFile \
"$prefix/include/$localDir/$incName" \
"$prefix/include/$incName" \
)
library=$(findExtLib "$libName") library=$(findExtLib "$libName")
elif isSystem "$prefix" elif isSystem "$prefix"
then then
header=$(findFirstFile \ header=$(findFirstFile \
"/usr/local/include/$localDir/$incName" \
"/usr/local/include/scotch/$incName" \ "/usr/local/include/scotch/$incName" \
"/usr/local/include/$incName" \ "/usr/local/include/$incName" \
"/usr/include/$localDir/$incName" \
"/usr/include/scotch/$incName" \ "/usr/include/scotch/$incName" \
"/usr/include/$incName" \ "/usr/include/$incName" \
) )
@ -118,6 +124,7 @@ have_scotch()
unset prefix unset prefix
fi fi
# ---------------------------------- # ----------------------------------
equalBaseName "${header%/*}" "$localDir" || unset localDir
# Header # Header
[ -n "$header" ] || { [ -n "$header" ] || {
@ -127,7 +134,7 @@ have_scotch()
# Library # Library
[ -n "$library" ] \ [ -n "$library" ] \
|| library=$(findLibrary -prefix="$prefix" -name="$libName") \ || library=$(findLibrary -prefix="$prefix" -name="$libName" -local="$localDir") \
|| { || {
[ -n "$warn" ] && echo "$warn (no library)" [ -n "$warn" ] && echo "$warn (no library)"
return 2 return 2
@ -135,7 +142,7 @@ have_scotch()
# ---------------------------------- # ----------------------------------
local good label local label
# Ensure consistent sizes between OpenFOAM and scotch header # Ensure consistent sizes between OpenFOAM and scotch header
# extract 'typedef int64_t SCOTCH_Num' or equivalent # extract 'typedef int64_t SCOTCH_Num' or equivalent
@ -163,7 +170,6 @@ have_scotch()
case "$WM_LABEL_SIZE:$label" in case "$WM_LABEL_SIZE:$label" in
(32:int32_t | 32:int | 64:int64_t | 64:long) (32:int32_t | 32:int | 64:int64_t | 64:long)
good=true
;; ;;
(*) (*)
@ -192,8 +198,7 @@ have_scotch()
# -> HAVE_PTSCOTCH, PTSCOTCH_ARCH_PATH, PTSCOTCH_INC_DIR, PTSCOTCH_LIB_DIR # -> HAVE_PTSCOTCH, PTSCOTCH_ARCH_PATH, PTSCOTCH_INC_DIR, PTSCOTCH_LIB_DIR
have_ptscotch() have_ptscotch()
{ {
local prefix header library incName libName settings warn local warn="==> skip ptscotch"
warn="==> skip ptscotch"
if [ "$HAVE_SCOTCH" != true ] if [ "$HAVE_SCOTCH" != true ]
then then
@ -205,9 +210,11 @@ have_ptscotch()
[ -n "$PTSCOTCH_ARCH_PATH" ] || PTSCOTCH_ARCH_PATH="$SCOTCH_ARCH_PATH" [ -n "$PTSCOTCH_ARCH_PATH" ] || PTSCOTCH_ARCH_PATH="$SCOTCH_ARCH_PATH"
# Expected location, include/library names # Expected location, include/library names
prefix="$PTSCOTCH_ARCH_PATH" local prefix="$PTSCOTCH_ARCH_PATH"
incName="ptscotch.h" local incName="ptscotch.h"
libName="libptscotch" local libName="libptscotch"
local localDir="scotch-int$WM_LABEL_SIZE"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"
@ -218,25 +225,27 @@ have_ptscotch()
then then
header=$(findFirstFile \ header=$(findFirstFile \
"$prefix/include/$FOAM_MPI/$incName" \ "$prefix/include/$FOAM_MPI/$incName" \
"$prefix/include/$localDir/$incName" \
"$prefix/include/$incName" "$prefix/include/$incName"
) )
library="$(findExtLib $FOAM_MPI/$libName $libName)" library="$(findExtLib $FOAM_MPI/$libName $libName)"
elif isSystem "$prefix" elif isSystem "$prefix"
then then
prefix=/usr
header=$(findFirstFile \ header=$(findFirstFile \
"/usr/local/include/ptscotch/$incName" \ "/usr/local/include/ptscotch/$incName" \
"/usr/local/include/scotch/$incName" \ "/usr/local/include/scotch/$incName" \
"/usr/local/include/$incName" \ "/usr/local/include/$incName" \
"/usr/include/$localDir/$incName" \
"/usr/include/ptscotch/$incName" \ "/usr/include/ptscotch/$incName" \
"/usr/include/scotch/$incName" \ "/usr/include/scotch/$incName" \
"/usr/include/$incName" \ "/usr/include/$incName" \
) )
case "$header" in (/usr/local/*) prefix=/usr/local ;; esac prefix=$(sysPrefix "$header")
else else
unset prefix unset prefix
fi fi
# ---------------------------------- # ----------------------------------
equalBaseName "${header%/*}" "$localDir" || unset localDir
# Header # Header
[ -n "$header" ] || { [ -n "$header" ] || {
@ -246,7 +255,7 @@ have_ptscotch()
# Library # Library
[ -n "$library" ] \ [ -n "$library" ] \
|| library=$(findLibrary -prefix="$prefix" -name="$libName") \ || library=$(findLibrary -prefix="$prefix" -name="$libName" -local="$localDir") \
|| { || {
[ -n "$warn" ] && echo "$warn (no library)" [ -n "$warn" ] && echo "$warn (no library)"
return 2 return 2

View File

@ -37,7 +37,6 @@
no_zoltan() no_zoltan()
{ {
unset HAVE_ZOLTAN ZOLTAN_INC_DIR ZOLTAN_LIB_DIR unset HAVE_ZOLTAN ZOLTAN_INC_DIR ZOLTAN_LIB_DIR
return 0
} }
@ -72,9 +71,9 @@ query_zoltan()
# -> HAVE_ZOLTAN, ZOLTAN_INC_DIR, ZOLTAN_LIB_DIR # -> HAVE_ZOLTAN, ZOLTAN_INC_DIR, ZOLTAN_LIB_DIR
have_zoltan() have_zoltan()
{ {
local warn # warn="==> skip zoltan"
local config="config.sh/zoltan" local config="config.sh/zoltan"
local prefix header library incName libName settings warn local settings
# warn="==> skip zoltan"
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")" if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then then
@ -85,9 +84,10 @@ have_zoltan()
fi fi
# Expected location, include/library names # Expected location, include/library names
prefix="$ZOLTAN_ARCH_PATH" local prefix="$ZOLTAN_ARCH_PATH"
incName="zoltan.h" local incName="zoltan.h"
libName="libzoltan" local libName="libzoltan"
local header library
# ---------------------------------- # ----------------------------------
if isNone "$prefix" if isNone "$prefix"

View File

@ -46,7 +46,6 @@ no_paraview()
{ {
unset HAVE_PVPLUGIN_SUPPORT FOAM_PV_PLUGIN_LIBBIN unset HAVE_PVPLUGIN_SUPPORT FOAM_PV_PLUGIN_LIBBIN
unset PARAVIEW_API PARAVIEW_INC_DIR unset PARAVIEW_API PARAVIEW_INC_DIR
return 0
} }
@ -92,7 +91,7 @@ cmakePvInstall()
wmakeLibPv() wmakeLibPv()
{ {
local depend="ParaView_DIR=$ParaView_DIR" local depend="ParaView_DIR=$ParaView_DIR"
local sentinel local sentinel libName
for libName for libName
do do
@ -147,8 +146,8 @@ get_pvplugin_api()
# #
have_pvplugin_support() have_pvplugin_support()
{ {
local header warn pv_api installDir binDir includeDir targetDir local warn="==> skip paraview-plugin"
warn="==> skip paraview-plugin" local settings pv_api installDir binDir includeDir targetDir
# Trivial check # Trivial check
command -v cmake >/dev/null || { command -v cmake >/dev/null || {
@ -171,7 +170,7 @@ have_pvplugin_support()
fi fi
# Include/library names # Include/library names
header="pqServerManagerModel.h" local header="pqServerManagerModel.h"
if [ -n "$ParaView_DIR" ] if [ -n "$ParaView_DIR" ]
then then

View File

@ -39,7 +39,7 @@ then
# Load once, but do not rely on this variable elsewhere # Load once, but do not rely on this variable elsewhere
WMAKE_SCRIPTS_SYSFUNCTIONS=loaded WMAKE_SCRIPTS_SYSFUNCTIONS=loaded
# Handle Debian multi-arch, ignore missing/bad dpkg-architecture. # Debian multi-arch, ignore missing/bad dpkg-architecture.
if [ -z "$DEB_TARGET_MULTIARCH" ] if [ -z "$DEB_TARGET_MULTIARCH" ]
then then
DEB_TARGET_MULTIARCH=$(dpkg-architecture -qDEB_TARGET_MULTIARCH 2>/dev/null || true) DEB_TARGET_MULTIARCH=$(dpkg-architecture -qDEB_TARGET_MULTIARCH 2>/dev/null || true)
@ -100,6 +100,15 @@ then
} }
# True if '$1' and '$2' have the same directory basename
# Eg,
# equalBaseName "/usr/include/scotch-int32" "scotch-int32"
equalBaseName()
{
test "${1##*/}" = "${2##*/}"
}
# Simple output for -query # Simple output for -query
# $1 = software # $1 = software
# $2 = setting # $2 = setting
@ -189,15 +198,15 @@ then
# This function has two modes of operation. # This function has two modes of operation.
# #
# 1) Automated search. # 1) Automated search.
# Specify -prefix=dirName -name=libName and search for # Specify -prefix=dirName -name=libName, optionally -local=subdirName
# (lib, lib64, lib/x86_64..) etc. # and search for (lib, lib64, lib/x86_64..) etc.
# #
# 2) Directed search. # 2) Directed search.
# specify the fully qualified names to search on the parameter list # specify the fully qualified names to search on the parameter list
# #
findLibrary() findLibrary()
{ {
local prefixDir searchDir searchName local prefixDir localDir searchDir searchName
local file ext local file ext
searchDir=true searchDir=true
@ -210,6 +219,12 @@ then
shift shift
;; ;;
-local=*)
# Prefix with directory separator
localDir="/${1#*=}"
shift
;;
-name=*) -name=*)
searchName="${1#*=}" searchName="${1#*=}"
shift shift
@ -223,18 +238,30 @@ then
if [ -n "$searchName" ] if [ -n "$searchName" ]
then then
# Automated search # Automated search (eg, lib/ lib64/, lib/x86_64-linux-gnu)
# Eg, lib/ lib64/, lib/x86_64-linux-gnu # but also handle possible local versions (eg, lib/scotch-int32)
: "${prefixDir:=/usr}" # A reasonable default : "${prefixDir:=/usr}" # A reasonable default
[ -d "$prefixDir" ] || return 2 [ -d "$prefixDir" ] || return 2
for searchDir in \ # Local and regular search paths
lib \ set -- \
"${WM_COMPILER_LIB_ARCH:+lib}$WM_COMPILER_LIB_ARCH" \ "lib${localDir}" \
"${DEB_TARGET_MULTIARCH:+lib/}${DEB_TARGET_MULTIARCH}" \ "${WM_COMPILER_LIB_ARCH:+lib${WM_COMPILER_LIB_ARCH}${localDir}}" \
"${DEB_TARGET_MULTIARCH:+lib/${DEB_TARGET_MULTIARCH}${localDir}}" \
"lib" \
"${WM_COMPILER_LIB_ARCH:+lib${WM_COMPILER_LIB_ARCH}}" \
"${DEB_TARGET_MULTIARCH:+lib/${DEB_TARGET_MULTIARCH}}" \
; ;
# Ignore empty local search path ("/")
[ "${#localDir}" -gt 1 ] || shift 3
## echo "search: $# $@" 1>&2
for searchDir in "$@"
do do
[ -n "$searchDir" ] || continue
for ext in '' $extLibraries for ext in '' $extLibraries
do do
file="$prefixDir/$searchDir/$searchName$ext" file="$prefixDir/$searchDir/$searchName$ext"