mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
Copyright (C) 2015-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -530,17 +530,13 @@ void Foam::functionObjects::forces::addToFields
|
||||
return;
|
||||
}
|
||||
|
||||
volVectorField& force =
|
||||
lookupObjectRef<volVectorField>(fieldName("force"));
|
||||
|
||||
auto& force = lookupObjectRef<volVectorField>(fieldName("force"));
|
||||
vectorField& pf = force.boundaryFieldRef()[patchi];
|
||||
pf += fN + fT + fP;
|
||||
|
||||
volVectorField& moment =
|
||||
lookupObjectRef<volVectorField>(fieldName("moment"));
|
||||
|
||||
auto& moment = lookupObjectRef<volVectorField>(fieldName("moment"));
|
||||
vectorField& pm = moment.boundaryFieldRef()[patchi];
|
||||
pm += Md;
|
||||
pm = Md^pf;
|
||||
}
|
||||
|
||||
|
||||
@ -558,17 +554,14 @@ void Foam::functionObjects::forces::addToFields
|
||||
return;
|
||||
}
|
||||
|
||||
volVectorField& force =
|
||||
lookupObjectRef<volVectorField>(fieldName("force"));
|
||||
|
||||
volVectorField& moment =
|
||||
lookupObjectRef<volVectorField>(fieldName("moment"));
|
||||
auto& force = lookupObjectRef<volVectorField>(fieldName("force"));
|
||||
auto& moment = lookupObjectRef<volVectorField>(fieldName("moment"));
|
||||
|
||||
forAll(cellIDs, i)
|
||||
{
|
||||
label celli = cellIDs[i];
|
||||
force[celli] += fN[i] + fT[i] + fP[i];
|
||||
moment[celli] += Md[i];
|
||||
moment[celli] = Md[i]^force[celli];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
1
wmake/rules/General/Clang/openmp
Symbolic link
1
wmake/rules/General/Clang/openmp
Symbolic link
@ -0,0 +1 @@
|
||||
openmp-gomp
|
||||
8
wmake/rules/General/Clang/openmp-gomp
Normal file
8
wmake/rules/General/Clang/openmp-gomp
Normal 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
|
||||
5
wmake/rules/General/Clang/openmp-omp
Normal file
5
wmake/rules/General/Clang/openmp-omp
Normal 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
|
||||
@ -14,25 +14,29 @@ GLIBS = -lm
|
||||
GLIB_LIBS =
|
||||
|
||||
|
||||
COMPILER_FAMILY = $(shell echo "$(WM_COMPILER)" | sed -e 's/[0-9].*//')
|
||||
DEFAULT_RULES = $(WM_DIR)/rules/$(WM_ARCH)$(COMPILER_FAMILY)
|
||||
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
|
||||
ARCHITECTURE_RULES = $(WM_DIR)/rules/$(WM_ARCH)
|
||||
COMPILER_FAMILY = $(shell echo "$(WM_COMPILER)" | sed -e 's/[-+.0-9~].*//')
|
||||
DEFAULT_RULES = $(ARCHITECTURE_RULES)$(COMPILER_FAMILY)
|
||||
RULES = $(ARCHITECTURE_RULES)$(WM_COMPILER)
|
||||
WMAKE_BIN = $(WM_PROJECT_DIR)/platforms/tools/$(WM_ARCH)$(WM_COMPILER)
|
||||
|
||||
# Default compilation is 'Opt' - never permit an empty value
|
||||
ifeq ($(WM_COMPILE_OPTION),)
|
||||
ifeq (,$(WM_COMPILE_OPTION))
|
||||
WM_COMPILE_OPTION = Opt
|
||||
endif
|
||||
|
||||
ifeq ($(WM_SCHEDULER),)
|
||||
ifeq (,$(WM_SCHEDULER))
|
||||
AND = &&
|
||||
else
|
||||
AND = '&&'
|
||||
endif
|
||||
|
||||
include $(DEFAULT_RULES)/general
|
||||
sinclude $(DEFAULT_RULES)/override
|
||||
ifneq ("$(COMPILER_FAMILY)","$(WM_COMPILER)")
|
||||
sinclude $(RULES)/general
|
||||
sinclude $(RULES)/c++
|
||||
endif
|
||||
include $(GENERAL_RULES)/transform
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
PFLAGS =
|
||||
PINC =
|
||||
PLIBS =
|
||||
1
wmake/rules/General/mplib
Symbolic link
1
wmake/rules/General/mplib
Symbolic link
@ -0,0 +1 @@
|
||||
no-mpi
|
||||
7
wmake/rules/General/no-mpi
Normal file
7
wmake/rules/General/no-mpi
Normal file
@ -0,0 +1,7 @@
|
||||
# Empty flags for not compiling/linking MPI
|
||||
|
||||
PFLAGS =
|
||||
PINC =
|
||||
PLIBS =
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
6
wmake/rules/General/no-openmp
Normal file
6
wmake/rules/General/no-openmp
Normal file
@ -0,0 +1,6 @@
|
||||
# Empty flags for not compiling/linking OPENMP
|
||||
|
||||
COMP_OPENMP =
|
||||
LINK_OPENMP =
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -3,7 +3,16 @@ CPP = cpp -traditional-cpp $(GFLAGS)
|
||||
PROJECT_LIBS = -l$(WM_PROJECT) -ldl
|
||||
|
||||
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++
|
||||
|
||||
@ -8,14 +8,14 @@
|
||||
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||
#
|
||||
# Script
|
||||
# cmakeFunctions
|
||||
#
|
||||
# Description
|
||||
# Helper functions for CMake
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions
|
||||
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
no_adios2()
|
||||
{
|
||||
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()
|
||||
{
|
||||
local warn # warn="==> skip adios2"
|
||||
local config="config.sh/adios2"
|
||||
local prefix header library incName libName settings warn
|
||||
# warn="==> skip adios2"
|
||||
local settings
|
||||
|
||||
# Setup
|
||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||
then
|
||||
. "$settings"
|
||||
@ -102,9 +100,10 @@ have_adios2()
|
||||
fi
|
||||
|
||||
# Expected location, include/library names
|
||||
prefix="$ADIOS2_ARCH_PATH"
|
||||
incName="adios2.h"
|
||||
libName="libadios2"
|
||||
local prefix="$ADIOS2_ARCH_PATH"
|
||||
local incName="adios2.h"
|
||||
local libName="libadios2"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
#
|
||||
# Requires
|
||||
# BOOST_ARCH_PATH
|
||||
# or config.sh/CGAL (when BOOST_ARCH_PATH is empty)
|
||||
#
|
||||
# Functions provided
|
||||
# have_boost, no_boost, echo_boost, query_boost
|
||||
@ -37,7 +38,6 @@
|
||||
no_boost()
|
||||
{
|
||||
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()
|
||||
{
|
||||
local prefix header library incName libName settings warn
|
||||
# warn="==> skip boost"
|
||||
local warn # 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
|
||||
prefix="$BOOST_ARCH_PATH"
|
||||
incName="boost/version.hpp"
|
||||
libName="libboost_system"
|
||||
local prefix="$BOOST_ARCH_PATH"
|
||||
local incName="boost/version.hpp"
|
||||
local libName="libboost_system"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
|
||||
@ -37,9 +37,9 @@
|
||||
no_ccmio()
|
||||
{
|
||||
unset HAVE_CCMIO CCMIO_INC_DIR CCMIO_LIB_DIR
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# Report
|
||||
echo_ccmio()
|
||||
{
|
||||
@ -71,9 +71,9 @@ query_ccmio()
|
||||
# -> HAVE_CCMIO, CCMIO_INC_DIR, CCMIO_LIB_DIR
|
||||
have_ccmio()
|
||||
{
|
||||
local warn="==> skip ccmio"
|
||||
local config="config.sh/ccmio"
|
||||
local prefix header library incName libName settings warn
|
||||
warn="==> skip ccmio"
|
||||
local settings
|
||||
|
||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||
then
|
||||
@ -85,9 +85,10 @@ have_ccmio()
|
||||
|
||||
# Expected location, include/library names
|
||||
# Link with static libccmio only (fewer issues)
|
||||
prefix="$CCMIO_ARCH_PATH"
|
||||
incName="libccmio/ccmio.h"
|
||||
libName="libccmio.a"
|
||||
local prefix="$CCMIO_ARCH_PATH"
|
||||
local incName="libccmio/ccmio.h"
|
||||
local libName="libccmio.a"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
#
|
||||
# Requires
|
||||
# CGAL_ARCH_PATH
|
||||
# or config.sh/CGAL (when CGAL_ARCH_PATH is empty)
|
||||
#
|
||||
# Functions provided
|
||||
# have_cgal, no_cgal, echo_cgal, query_cgal
|
||||
@ -37,7 +38,6 @@
|
||||
no_cgal()
|
||||
{
|
||||
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()
|
||||
{
|
||||
local prefix header library incName libName settings warn
|
||||
# warn="==> skip cgal"
|
||||
local warn # 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
|
||||
prefix="$CGAL_ARCH_PATH"
|
||||
incName="CGAL/version.h"
|
||||
libName="libCGAL"
|
||||
local prefix="$CGAL_ARCH_PATH"
|
||||
local incName="CGAL/version.h"
|
||||
local libName="libCGAL"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
#
|
||||
# Requires
|
||||
# FFTW_ARCH_PATH
|
||||
# or config.sh/FFTW (when FFTW_ARCH_PATH is empty)
|
||||
#
|
||||
# Functions provided
|
||||
# have_fftw, no_fftw, echo_fftw, query_fftw
|
||||
@ -37,7 +38,6 @@
|
||||
no_fftw()
|
||||
{
|
||||
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()
|
||||
{
|
||||
local prefix header library incName libName settings warn
|
||||
# warn="==> skip fftw"
|
||||
local warn # 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
|
||||
prefix="$FFTW_ARCH_PATH"
|
||||
incName="fftw3.h"
|
||||
libName="libfftw3"
|
||||
local prefix="$FFTW_ARCH_PATH"
|
||||
local incName="fftw3.h"
|
||||
local libName="libfftw3"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
#
|
||||
# Requires
|
||||
# HYPRE_ARCH_PATH
|
||||
# or config.sh/hypre
|
||||
#
|
||||
# Functions provided
|
||||
# have_hypre, no_hypre, echo_hypre, query_hypre
|
||||
@ -37,7 +38,6 @@
|
||||
no_hypre()
|
||||
{
|
||||
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()
|
||||
{
|
||||
local warn="==> skip hypre"
|
||||
local config="config.sh/hypre"
|
||||
local prefix header library incName libName settings warn
|
||||
warn="==> skip hypre"
|
||||
local settings
|
||||
|
||||
# Setup - prefer current environment value? (TDB)
|
||||
if [ ! -d "$HYPRE_ARCH_PATH" ]
|
||||
@ -89,9 +89,10 @@ have_hypre()
|
||||
fi
|
||||
|
||||
# Expected location, include/library names
|
||||
prefix="$HYPRE_ARCH_PATH"
|
||||
incName="HYPRE.h"
|
||||
libName="libHYPRE"
|
||||
local prefix="$HYPRE_ARCH_PATH"
|
||||
local incName="HYPRE.h"
|
||||
local libName="libHYPRE"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
|
||||
@ -38,7 +38,6 @@ no_kahip()
|
||||
{
|
||||
unset HAVE_KAHIP KAHIP_ARCH_PATH KAHIP_INC_DIR KAHIP_LIB_DIR
|
||||
unset KAHIP_VERSION
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@ -73,9 +72,9 @@ query_kahip()
|
||||
# -> HAVE_KAHIP, KAHIP_ARCH_PATH, KAHIP_INC_DIR, KAHIP_LIB_DIR
|
||||
have_kahip()
|
||||
{
|
||||
local warn="==> skip kahip"
|
||||
local config="config.sh/kahip"
|
||||
local prefix header library incName libName settings warn
|
||||
warn="==> skip kahip"
|
||||
local settings
|
||||
|
||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||
then
|
||||
@ -86,9 +85,10 @@ have_kahip()
|
||||
fi
|
||||
|
||||
# Expected location, include/library names
|
||||
prefix="$KAHIP_ARCH_PATH"
|
||||
incName="kaHIP_interface.h"
|
||||
libName="libkahip"
|
||||
local prefix="$KAHIP_ARCH_PATH"
|
||||
local incName="kaHIP_interface.h"
|
||||
local libName="libkahip"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
|
||||
@ -38,7 +38,6 @@ no_metis()
|
||||
{
|
||||
unset HAVE_METIS METIS_ARCH_PATH METIS_INC_DIR METIS_LIB_DIR
|
||||
unset METIS_VERSION
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@ -73,9 +72,9 @@ query_metis()
|
||||
# -> HAVE_METIS, METIS_ARCH_PATH, METIS_INC_DIR, METIS_LIB_DIR
|
||||
have_metis()
|
||||
{
|
||||
local warn="==> skip metis"
|
||||
local config="config.sh/metis"
|
||||
local prefix header library incName libName settings warn
|
||||
warn="==> skip metis"
|
||||
local settings
|
||||
|
||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||
then
|
||||
@ -86,9 +85,10 @@ have_metis()
|
||||
fi
|
||||
|
||||
# Expected location, include/library names
|
||||
prefix="$METIS_ARCH_PATH"
|
||||
incName="metis.h"
|
||||
libName="libmetis"
|
||||
local prefix="$METIS_ARCH_PATH"
|
||||
local incName="metis.h"
|
||||
local libName="libmetis"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
|
||||
@ -38,7 +38,6 @@ no_mgridgen()
|
||||
{
|
||||
unset HAVE_MGRIDGEN MGRIDGEN_ARCH_PATH MGRIDGEN_INC_DIR MGRIDGEN_LIB_DIR
|
||||
unset MGRIDGEN_VERSION
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@ -73,9 +72,9 @@ query_mgridgen()
|
||||
# -> HAVE_MGRIDGEN, MGRIDGEN_ARCH_PATH, MGRIDGEN_INC_DIR, MGRIDGEN_LIB_DIR
|
||||
have_mgridgen()
|
||||
{
|
||||
local warn="==> skip mgridgen"
|
||||
local config="config.sh/mgridgen"
|
||||
local prefix header library incName libName libName2 settings warn
|
||||
warn="==> skip mgridgen"
|
||||
local settings
|
||||
|
||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||
then
|
||||
@ -86,10 +85,11 @@ have_mgridgen()
|
||||
fi
|
||||
|
||||
# Expected location, include/library names
|
||||
prefix="$MGRIDGEN_ARCH_PATH"
|
||||
incName="mgridgen.h"
|
||||
libName="libMGridGen"
|
||||
libName2="libmgrid"
|
||||
local prefix="$MGRIDGEN_ARCH_PATH"
|
||||
local incName="mgridgen.h"
|
||||
local libName="libMGridGen"
|
||||
local libName2="libmgrid"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
@ -126,7 +126,7 @@ have_mgridgen()
|
||||
|
||||
# ----------------------------------
|
||||
|
||||
local good label scalar
|
||||
local label scalar
|
||||
|
||||
# Ensure consistent sizes with OpenFOAM and mgridgen header
|
||||
# Extract typedef for idxtype, realtype
|
||||
@ -142,7 +142,6 @@ have_mgridgen()
|
||||
|
||||
case "$WM_LABEL_SIZE:$label" in
|
||||
(32:int32_t | 32:int | 64:int64_t | 64:long)
|
||||
good=true
|
||||
;;
|
||||
|
||||
(*)
|
||||
@ -156,7 +155,6 @@ have_mgridgen()
|
||||
esac
|
||||
case "$WM_PRECISION_OPTION:$scalar" in
|
||||
(SP:float | SPDP:float | DP:double)
|
||||
good=true
|
||||
;;
|
||||
|
||||
(*)
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
#
|
||||
# Requires
|
||||
# PETSC_ARCH_PATH
|
||||
# or config.sh/petsc
|
||||
#
|
||||
# Functions provided
|
||||
# have_petsc, no_petsc, echo_petsc, hint_petsc, query_petsc
|
||||
@ -37,7 +38,6 @@
|
||||
no_petsc()
|
||||
{
|
||||
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()
|
||||
{
|
||||
local warn="==> skip petsc"
|
||||
local config="config.sh/petsc"
|
||||
local prefix header library incName libName pkgName settings warn
|
||||
warn="==> skip petsc"
|
||||
local settings
|
||||
|
||||
# Setup - prefer current environment value? (TDB)
|
||||
if [ ! -d "$PETSC_ARCH_PATH" ]
|
||||
@ -105,10 +105,11 @@ have_petsc()
|
||||
fi
|
||||
|
||||
# Expected location, include/library names
|
||||
prefix="$PETSC_ARCH_PATH"
|
||||
incName="petsc.h"
|
||||
libName="libpetsc"
|
||||
pkgName="PETSc"
|
||||
local prefix="$PETSC_ARCH_PATH"
|
||||
local incName="petsc.h"
|
||||
local libName="libpetsc"
|
||||
local pkgName="PETSc"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
|
||||
@ -36,7 +36,6 @@
|
||||
no_readline()
|
||||
{
|
||||
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_readline()
|
||||
{
|
||||
local prefix header library incName libName settings warn
|
||||
# warn="==> skip readline"
|
||||
local warn # warn="==> skip readline"
|
||||
local settings
|
||||
|
||||
# Expected location, include/library names
|
||||
prefix=system
|
||||
incName="readline/readline.h"
|
||||
libName="libreadline"
|
||||
local prefix=system
|
||||
local incName="readline/readline.h"
|
||||
local libName="libreadline"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
|
||||
@ -39,7 +39,6 @@ no_scotch()
|
||||
unset HAVE_SCOTCH SCOTCH_ARCH_PATH SCOTCH_INC_DIR SCOTCH_LIB_DIR
|
||||
unset SCOTCH_VERSION
|
||||
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()
|
||||
{
|
||||
local warn="==> skip scotch"
|
||||
local config="config.sh/scotch"
|
||||
local prefix header library incName libName settings warn
|
||||
warn="==> skip scotch"
|
||||
local settings
|
||||
|
||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||
then
|
||||
@ -92,9 +91,11 @@ have_scotch()
|
||||
fi
|
||||
|
||||
# Expected location, include/library names
|
||||
prefix="$SCOTCH_ARCH_PATH"
|
||||
incName="scotch.h"
|
||||
libName="libscotch"
|
||||
local prefix="$SCOTCH_ARCH_PATH"
|
||||
local incName="scotch.h"
|
||||
local libName="libscotch"
|
||||
local localDir="scotch-int$WM_LABEL_SIZE"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
@ -103,13 +104,18 @@ have_scotch()
|
||||
return 1
|
||||
elif hasAbsdir "$prefix"
|
||||
then
|
||||
header=$(findFirstFile "$prefix/include/$incName")
|
||||
header=$(findFirstFile \
|
||||
"$prefix/include/$localDir/$incName" \
|
||||
"$prefix/include/$incName" \
|
||||
)
|
||||
library=$(findExtLib "$libName")
|
||||
elif isSystem "$prefix"
|
||||
then
|
||||
header=$(findFirstFile \
|
||||
"/usr/local/include/$localDir/$incName" \
|
||||
"/usr/local/include/scotch/$incName" \
|
||||
"/usr/local/include/$incName" \
|
||||
"/usr/include/$localDir/$incName" \
|
||||
"/usr/include/scotch/$incName" \
|
||||
"/usr/include/$incName" \
|
||||
)
|
||||
@ -118,6 +124,7 @@ have_scotch()
|
||||
unset prefix
|
||||
fi
|
||||
# ----------------------------------
|
||||
equalBaseName "${header%/*}" "$localDir" || unset localDir
|
||||
|
||||
# Header
|
||||
[ -n "$header" ] || {
|
||||
@ -127,7 +134,7 @@ have_scotch()
|
||||
|
||||
# Library
|
||||
[ -n "$library" ] \
|
||||
|| library=$(findLibrary -prefix="$prefix" -name="$libName") \
|
||||
|| library=$(findLibrary -prefix="$prefix" -name="$libName" -local="$localDir") \
|
||||
|| {
|
||||
[ -n "$warn" ] && echo "$warn (no library)"
|
||||
return 2
|
||||
@ -135,7 +142,7 @@ have_scotch()
|
||||
|
||||
# ----------------------------------
|
||||
|
||||
local good label
|
||||
local label
|
||||
|
||||
# Ensure consistent sizes between OpenFOAM and scotch header
|
||||
# extract 'typedef int64_t SCOTCH_Num' or equivalent
|
||||
@ -163,7 +170,6 @@ have_scotch()
|
||||
|
||||
case "$WM_LABEL_SIZE:$label" in
|
||||
(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()
|
||||
{
|
||||
local prefix header library incName libName settings warn
|
||||
warn="==> skip ptscotch"
|
||||
local warn="==> skip ptscotch"
|
||||
|
||||
if [ "$HAVE_SCOTCH" != true ]
|
||||
then
|
||||
@ -205,9 +210,11 @@ have_ptscotch()
|
||||
[ -n "$PTSCOTCH_ARCH_PATH" ] || PTSCOTCH_ARCH_PATH="$SCOTCH_ARCH_PATH"
|
||||
|
||||
# Expected location, include/library names
|
||||
prefix="$PTSCOTCH_ARCH_PATH"
|
||||
incName="ptscotch.h"
|
||||
libName="libptscotch"
|
||||
local prefix="$PTSCOTCH_ARCH_PATH"
|
||||
local incName="ptscotch.h"
|
||||
local libName="libptscotch"
|
||||
local localDir="scotch-int$WM_LABEL_SIZE"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
@ -218,25 +225,27 @@ have_ptscotch()
|
||||
then
|
||||
header=$(findFirstFile \
|
||||
"$prefix/include/$FOAM_MPI/$incName" \
|
||||
"$prefix/include/$localDir/$incName" \
|
||||
"$prefix/include/$incName"
|
||||
)
|
||||
library="$(findExtLib $FOAM_MPI/$libName $libName)"
|
||||
elif isSystem "$prefix"
|
||||
then
|
||||
prefix=/usr
|
||||
header=$(findFirstFile \
|
||||
"/usr/local/include/ptscotch/$incName" \
|
||||
"/usr/local/include/scotch/$incName" \
|
||||
"/usr/local/include/$incName" \
|
||||
"/usr/include/$localDir/$incName" \
|
||||
"/usr/include/ptscotch/$incName" \
|
||||
"/usr/include/scotch/$incName" \
|
||||
"/usr/include/$incName" \
|
||||
)
|
||||
case "$header" in (/usr/local/*) prefix=/usr/local ;; esac
|
||||
prefix=$(sysPrefix "$header")
|
||||
else
|
||||
unset prefix
|
||||
fi
|
||||
# ----------------------------------
|
||||
equalBaseName "${header%/*}" "$localDir" || unset localDir
|
||||
|
||||
# Header
|
||||
[ -n "$header" ] || {
|
||||
@ -246,7 +255,7 @@ have_ptscotch()
|
||||
|
||||
# Library
|
||||
[ -n "$library" ] \
|
||||
|| library=$(findLibrary -prefix="$prefix" -name="$libName") \
|
||||
|| library=$(findLibrary -prefix="$prefix" -name="$libName" -local="$localDir") \
|
||||
|| {
|
||||
[ -n "$warn" ] && echo "$warn (no library)"
|
||||
return 2
|
||||
|
||||
@ -37,7 +37,6 @@
|
||||
no_zoltan()
|
||||
{
|
||||
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()
|
||||
{
|
||||
local warn # warn="==> skip zoltan"
|
||||
local config="config.sh/zoltan"
|
||||
local prefix header library incName libName settings warn
|
||||
# warn="==> skip zoltan"
|
||||
local settings
|
||||
|
||||
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
|
||||
then
|
||||
@ -85,9 +84,10 @@ have_zoltan()
|
||||
fi
|
||||
|
||||
# Expected location, include/library names
|
||||
prefix="$ZOLTAN_ARCH_PATH"
|
||||
incName="zoltan.h"
|
||||
libName="libzoltan"
|
||||
local prefix="$ZOLTAN_ARCH_PATH"
|
||||
local incName="zoltan.h"
|
||||
local libName="libzoltan"
|
||||
local header library
|
||||
|
||||
# ----------------------------------
|
||||
if isNone "$prefix"
|
||||
|
||||
@ -46,7 +46,6 @@ no_paraview()
|
||||
{
|
||||
unset HAVE_PVPLUGIN_SUPPORT FOAM_PV_PLUGIN_LIBBIN
|
||||
unset PARAVIEW_API PARAVIEW_INC_DIR
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@ -92,7 +91,7 @@ cmakePvInstall()
|
||||
wmakeLibPv()
|
||||
{
|
||||
local depend="ParaView_DIR=$ParaView_DIR"
|
||||
local sentinel
|
||||
local sentinel libName
|
||||
|
||||
for libName
|
||||
do
|
||||
@ -147,8 +146,8 @@ get_pvplugin_api()
|
||||
#
|
||||
have_pvplugin_support()
|
||||
{
|
||||
local header warn pv_api installDir binDir includeDir targetDir
|
||||
warn="==> skip paraview-plugin"
|
||||
local warn="==> skip paraview-plugin"
|
||||
local settings pv_api installDir binDir includeDir targetDir
|
||||
|
||||
# Trivial check
|
||||
command -v cmake >/dev/null || {
|
||||
@ -171,7 +170,7 @@ have_pvplugin_support()
|
||||
fi
|
||||
|
||||
# Include/library names
|
||||
header="pqServerManagerModel.h"
|
||||
local header="pqServerManagerModel.h"
|
||||
|
||||
if [ -n "$ParaView_DIR" ]
|
||||
then
|
||||
|
||||
@ -39,7 +39,7 @@ then
|
||||
# Load once, but do not rely on this variable elsewhere
|
||||
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" ]
|
||||
then
|
||||
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
|
||||
# $1 = software
|
||||
# $2 = setting
|
||||
@ -189,15 +198,15 @@ then
|
||||
# This function has two modes of operation.
|
||||
#
|
||||
# 1) Automated search.
|
||||
# Specify -prefix=dirName -name=libName and search for
|
||||
# (lib, lib64, lib/x86_64..) etc.
|
||||
# Specify -prefix=dirName -name=libName, optionally -local=subdirName
|
||||
# and search for (lib, lib64, lib/x86_64..) etc.
|
||||
#
|
||||
# 2) Directed search.
|
||||
# specify the fully qualified names to search on the parameter list
|
||||
#
|
||||
findLibrary()
|
||||
{
|
||||
local prefixDir searchDir searchName
|
||||
local prefixDir localDir searchDir searchName
|
||||
local file ext
|
||||
|
||||
searchDir=true
|
||||
@ -210,6 +219,12 @@ then
|
||||
shift
|
||||
;;
|
||||
|
||||
-local=*)
|
||||
# Prefix with directory separator
|
||||
localDir="/${1#*=}"
|
||||
shift
|
||||
;;
|
||||
|
||||
-name=*)
|
||||
searchName="${1#*=}"
|
||||
shift
|
||||
@ -223,18 +238,30 @@ then
|
||||
|
||||
if [ -n "$searchName" ]
|
||||
then
|
||||
# Automated search
|
||||
# Eg, lib/ lib64/, lib/x86_64-linux-gnu
|
||||
# Automated search (eg, lib/ lib64/, lib/x86_64-linux-gnu)
|
||||
# but also handle possible local versions (eg, lib/scotch-int32)
|
||||
|
||||
: "${prefixDir:=/usr}" # A reasonable default
|
||||
[ -d "$prefixDir" ] || return 2
|
||||
|
||||
for searchDir in \
|
||||
lib \
|
||||
"${WM_COMPILER_LIB_ARCH:+lib}$WM_COMPILER_LIB_ARCH" \
|
||||
"${DEB_TARGET_MULTIARCH:+lib/}${DEB_TARGET_MULTIARCH}" \
|
||||
# Local and regular search paths
|
||||
set -- \
|
||||
"lib${localDir}" \
|
||||
"${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
|
||||
[ -n "$searchDir" ] || continue
|
||||
for ext in '' $extLibraries
|
||||
do
|
||||
file="$prefixDir/$searchDir/$searchName$ext"
|
||||
|
||||
Reference in New Issue
Block a user