Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (3)
Showing
with 275 additions and 52 deletions
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# query-versions
#
# Description
# Query (ThirdParty) versions based on their etc/config.sh values
# Executes their respective -query.
#
# TODO
# cmake, vtk, paraview
#
#------------------------------------------------------------------------------
# Hard-coded value (eg, with autoconfig)
projectDir="@PROJECT_DIR@"
if [ -z "$projectDir" ] || [ "${projectDir#@}" != "$projectDir" ]
then
# Auto-detect from location
toolsDir="${0%/*}" # The bin/tools dir
projectDir="${toolsDir%/bin/tools}" # Project dir
case "$projectDir" in
(/bin | /usr/bin | /usr/local/bin)
# This shouldn't happen.
# If copied to a system dir, should also be using hard-coded values!
echo "Warning: suspicious looking project dir: $projectDir" 1>&2
;;
("$toolsDir")
# Eg, called as ./openfoam etc - need to try harder
projectDir="$(\cd $(dirname $0)/../.. && \pwd -L)" || unset projectDir
;;
esac
fi
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
Usage: ${0##*/} [OPTION]
options:
-h, -help Print the usage
Query (ThirdParty) versions based on their etc/config.sh values.
Uses OpenFOAM wmake/scripts/have_* scripts.
USAGE
exit 1
}
#------------------------------------------------------------------------------
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
# Print help
(-h | -help*)
usage
;;
(*)
echo "Ignore unknown option/argument: $@" 1>&2
break
;;
esac
shift
done
#------------------------------------------------------------------------------
scriptsDir="$projectDir/wmake/scripts"
[ -d "$scriptsDir" ] || {
echo "No such directory: $scriptsDir" 1>&2
exit 2
}
# Allow operation without an active OpenFOAM environment
export WM_PROJECT_DIR="$projectDir"
#------------------------------------------------------------------------------
# Examine the "wmake/scripts/have_..." scripts for query_...() functions,
# assume they also have a -query option
for script in grep -l -e '^query_' "$scriptsDir"/have_*
do
if [ -f "$script" ]
then
bash "$script" -query
fi
done
#------------------------------------------------------------------------------
......@@ -26,6 +26,8 @@ fi
runParallel $decompDict snappyHexMesh -overwrite
runParallel $decompDict topoSet
#- For non-parallel running: - set the initial fields
# restore0Dir
......
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
// For easier post-processing, and data-conversion tests
{
name inner;
type cellZoneSet;
action new;
source boxToCell;
min (-1 -0.5 0);
max ( 6 0.5 2);
}
);
// ************************************************************************* //
include $(GENERAL_RULES)/Clang/c++
c++ARCH = -m64 -ftrapping-math
c++ARCH = -m64 -pthread -ftrapping-math
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
include $(GENERAL_RULES)/Clang/c++
c++ARCH = -m64
c++ARCH = -m64 -pthread
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
......@@ -2,7 +2,7 @@ include $(GENERAL_RULES)/Gcc/c++
CC = CC -std=c++11
c++ARCH = -m64
c++ARCH = -m64 -pthread
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
include $(GENERAL_RULES)/Gcc/c++
c++ARCH = -m64
c++ARCH = -m64 -pthread
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
include $(GENERAL_RULES)/Icc/c++
c++ARCH = -fp-trap=common -fp-model precise
c++ARCH = -pthread -fp-trap=common -fp-model precise
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
include $(GENERAL_RULES)/Gcc/c++
c++ARCH = -m64
c++ARCH = -m64 -pthread
# With gnu++11 (not c++11) to ensure __STRICT_ANSI__ is not defined
CC = x86_64-w64-mingw32-g++ -std=gnu++11
......
......@@ -3,7 +3,7 @@ include $(GENERAL_RULES)/Clang/c++
CC = armclang++ -std=c++11
c++ARCH = -mcpu=native
c++ARCH = -mcpu=native -pthread
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
include $(GENERAL_RULES)/Clang/c++
c++ARCH =
c++ARCH = -pthread
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
include $(GENERAL_RULES)/Gcc/c++
c++ARCH =
c++ARCH = -pthread
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
include $(GENERAL_RULES)/Gcc/c++
c++ARCH = -mcpu=cortex-a9
c++ARCH = -mcpu=cortex-a9 -pthread
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
include $(GENERAL_RULES)/Clang/c++
c++ARCH = -m32
c++ARCH = -m32 -pthread
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
include $(GENERAL_RULES)/Gcc/c++
c++ARCH = -m32
c++ARCH = -m32 -pthread
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
include $(GENERAL_RULES)/Icc/c++
c++ARCH = -fp-trap=common -fp-model precise
c++ARCH = -pthread -fp-trap=common -fp-model precise
include $(DEFAULT_RULES)/c++$(WM_COMPILE_OPTION)
......
......@@ -5,11 +5,10 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2019 OpenCFD Ltd.
# Copyright (C) 2018-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
# have_adios2
......@@ -21,7 +20,7 @@
# ADIOS2_ARCH_PATH
#
# Functions provided
# have_adios2, no_adios2, echo_adios2, hint_adios2
# have_adios2, no_adios2, echo_adios2, hint_adios2, query_adios2
#
# Variables set on success
# HAVE_ADIOS2
......@@ -68,19 +67,37 @@ INFORMATION
}
# Query settings
query_adios2()
{
local config="config.sh/adios2"
local settings
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
then
. "$settings"
_process_query adios2 "$ADIOS2_ARCH_PATH"
else
echo "(no $config settings)" 1>&2
echo "adios2=unknown"
fi
}
# On success, return 0 and export variables
# -> HAVE_ADIOS2, ADIOS2_INC_DIR, ADIOS2_LIB_DIR
have_adios2()
{
local config="config.sh/adios2"
local prefix header library incName libName settings warn
# warn="==> skip adios2"
# Setup
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/adios2)
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then
. "$settings"
else
[ -n "$warn" ] && echo "$warn (no config.sh/adios2 settings)"
[ -n "$warn" ] && echo "$warn (no $config settings)"
return 2
fi
......@@ -135,11 +152,15 @@ have_adios2()
# Force reset of old variables
no_adios2
# Testing
if [ "$1" = "-test" ]
then
# Test/query
case "$1" in
-test)
have_adios2
echo_adios2
fi
;;
-query)
query_adios2
;;
esac
#------------------------------------------------------------------------------
......@@ -5,23 +5,22 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2019 OpenCFD Ltd.
# Copyright (C) 2018-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
# have_boost
#
# Description
# Detection/setup of Boost
# Detection/setup of BOOST
#
# Requires
# BOOST_ARCH_PATH
#
# Functions provided
# have_boost, no_boost, echo_boost
# have_boost, no_boost, echo_boost, query_boost
#
# Variables set on success
# HAVE_BOOST
......@@ -52,6 +51,23 @@ echo_boost()
}
# Query settings (from CGAL setup)
query_boost()
{
local config="config.sh/CGAL"
local settings
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
then
. "$settings"
_process_query boost "$BOOST_ARCH_PATH"
else
echo "(no $config settings)" 1>&2
echo "boost=unknown"
fi
}
# On success, return 0 and export variables
# -> HAVE_BOOST, BOOST_INC_DIR, BOOST_LIB_DIR
have_boost()
......@@ -114,11 +130,15 @@ have_boost()
# Force reset of old variables
no_boost
# Testing
if [ "$1" = "-test" ]
then
# Test/query
case "$1" in
-test)
have_boost
echo_boost
fi
;;
-query)
query_boost
;;
esac
#------------------------------------------------------------------------------
......@@ -5,23 +5,22 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2019 OpenCFD Ltd.
# Copyright (C) 2018-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
# have_ccmio
#
# Description
# Detection/setup of ccmio
# Detection/setup of CCMIO
#
# Requires
# config.sh/ccmio
#
# Functions provided
# have_ccmio, no_ccmio, echo_ccmio
# have_ccmio, no_ccmio, echo_ccmio, query_ccmio
#
# Variables set on success
# HAVE_CCMIO
......@@ -51,19 +50,36 @@ echo_ccmio()
}
# Query settings
query_ccmio()
{
local config="config.sh/ccmio"
local settings
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
then
. "$settings"
_process_query ccmio "$CCMIO_ARCH_PATH"
else
echo "(no $config settings)" 1>&2
echo "ccmio=unknown"
fi
}
# On success, return 0 and export variables
# -> HAVE_CCMIO, CCMIO_INC_DIR, CCMIO_LIB_DIR
have_ccmio()
{
local config="config.sh/ccmio"
local prefix header library incName libName settings warn
warn="==> skip ccmio"
# Setup
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile "$config")"
then
. "$settings"
else
[ -n "$warn" ] && echo "$warn (no config.sh/ccmio settings)"
[ -n "$warn" ] && echo "$warn (no $config settings)"
return 2
fi
......@@ -140,11 +156,15 @@ have_ccmio()
# Force reset of old variables
no_ccmio
# Testing
if [ "$1" = "-test" ]
then
# Test/query
case "$1" in
-test)
have_ccmio
echo_ccmio
fi
;;
-query)
query_ccmio
;;
esac
#------------------------------------------------------------------------------
......@@ -5,11 +5,10 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2018-2019 OpenCFD Ltd.
# Copyright (C) 2018-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
# have_cgal
......@@ -21,7 +20,7 @@
# CGAL_ARCH_PATH
#
# Functions provided
# have_cgal, no_cgal, echo_cgal
# have_cgal, no_cgal, echo_cgal, query_cgal
#
# Variables set on success
# HAVE_CGAL
......@@ -52,6 +51,23 @@ echo_cgal()
}
# Query settings (from CGAL setup)
query_cgal()
{
local config="config.sh/CGAL"
local settings
if settings="$("$WM_PROJECT_DIR"/bin/foamEtcFile -mode=o "$config")"
then
. "$settings"
_process_query cgal "$CGAL_ARCH_PATH"
else
echo "(no $config settings)" 1>&2
echo "cgal=unknown"
fi
}
# On success, return 0 and export variables
# -> HAVE_CGAL, CGAL_INC_DIR, CGAL_LIB_DIR
have_cgal()
......@@ -114,11 +130,15 @@ have_cgal()
# Force reset of old variables
no_cgal
# Testing
if [ "$1" = "-test" ]
then
# Test/query
case "$1" in
-test)
have_cgal
echo_cgal
fi
;;
-query)
query_cgal
;;
esac
#------------------------------------------------------------------------------