ENH: improve handling of ThirdParty packages
- generalize some of the library extensions (.so vs .dylib). Provide as wmake 'sysFunctions' - added note about unsupported/incomplete system support - centralize detection of ThirdParty packages into wmake/ subdirectory by providing a series of scripts in the spirit of GNU autoconfig. For example, have_boost, have_readline, have_scotch, ... Each of the `have_<package>` scripts will generally provide the following type of functions: have_<package> # detection no_<package> # reset echo_<package> # echoing and the following type of variables: HAVE_<package> # unset or 'true' <package>_ARCH_PATH # root for <package> <package>_INC_DIR # include directory for <package> <package>_LIB_DIR # library directory for <package> This simplifies the calling scripts: if have_metis then wmake metisDecomp fi As well as reducing clutter in the corresponding Make/options: EXE_INC = \ -I$(METIS_INC_DIR) \ -I../decompositionMethods/lnInclude LIB_LIBS = \ -L$(METIS_LIB_DIR) -lmetis Any additional modifications (platform-specific or for an external build system) can now be made centrally.
This commit is contained in:
parent
672f0574e2
commit
b4d38ab468
1
Allwmake
1
Allwmake
@ -11,7 +11,6 @@ cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR" 2>/dev/null || {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -11,7 +11,6 @@ cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR/applications" 2>/dev/null || {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
|
||||
|
||||
if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
|
||||
[ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if have_fftw
|
||||
then
|
||||
wmake
|
||||
else
|
||||
|
@ -1,7 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
(wmake $targetType BCs && wmake $targetType && wmake $targetType rhoCentralDyMFoam)
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType DPMTurbulenceModels
|
||||
|
||||
wmake $targetType
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake libso CompressibleTwoPhaseMixtureTurbulenceModels
|
||||
wmake
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType twoPhaseMixtureThermo
|
||||
wmake $targetType surfaceTensionModels
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType multiphaseMixtureThermo
|
||||
wmake $targetType
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType mixtureViscosityModels
|
||||
wmake $targetType relativeVelocityModels
|
||||
wmake $targetType
|
||||
|
@ -1,10 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
targetType=libso
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
targetType=libso # Preferred library type
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType temperaturePhaseChangeTwoPhaseMixtures
|
||||
wmake
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType phaseChangeTwoPhaseMixtures
|
||||
wmake $targetType
|
||||
wmake $targetType interPhaseChangeDyMFoam
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmakeLnInclude interfacialModels
|
||||
wmake $targetType multiphaseSystem
|
||||
wmake $targetType interfacialModels
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType multiphaseMixture
|
||||
wmake $targetType
|
||||
wmake $targetType multiphaseInterDyMFoam
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmakeLnInclude interfacialModels
|
||||
wmakeLnInclude interfacialCompositionModels
|
||||
wmake $targetType phaseSystems
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType multiphaseSystem
|
||||
wmake $targetType multiphaseCompressibleTurbulenceModels
|
||||
wmake $targetType
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType twoPhaseSystem
|
||||
wmake $targetType twoPhaseCompressibleTurbulenceModels
|
||||
wmake $targetType
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmakeLnInclude interfacialModels
|
||||
wmake $targetType twoPhaseSystem
|
||||
wmake $targetType interfacialModels
|
||||
|
@ -1,17 +1,18 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
|
||||
# Parse arguments for compilation (at least for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Only build if libraries already exist
|
||||
if [ -e $FOAM_LIBBIN/libccm.so ]
|
||||
# Only build when the OpenFOAM libccm adaptor already exists
|
||||
if [ -f $FOAM_LIBBIN/libccm$extLibso ]
|
||||
then
|
||||
echo "==> build optional ccm conversion components"
|
||||
wmake $targetType ccmToFoam
|
||||
wmake $targetType foamToCcm
|
||||
else
|
||||
echo "==> skip optional ccm conversion components (no libccm.so)"
|
||||
echo "==> skip optional ccm conversion components (no libccm$extLibso)"
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Parse arguments for compilation (at least for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
wmake -all $targetType blockMesh
|
||||
wmake -all $targetType extrude
|
||||
wmake -all $targetType extrude2DMesh
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType extrude2DMesh
|
||||
wmake $targetType
|
||||
|
||||
|
@ -1,16 +1,14 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
export WM_CONTINUE_ON_ERROR=true # Optional unit
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_cgal
|
||||
|
||||
# Optional unit: continue-on-error
|
||||
# - may not have CGAL installed,
|
||||
# - or the CGAL installation moved and gives CMake problems
|
||||
export WM_CONTINUE_ON_ERROR=true
|
||||
#------------------------------------------------------------------------------
|
||||
# Optional
|
||||
# - CGAL not installed, or installed but gives CMake problems
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
if [ -f "$CGAL_ARCH_PATH/include/CGAL/version.h" ] || \
|
||||
[ "${CGAL_ARCH_PATH##*-}" = system -a -f /usr/include/CGAL/version.h ]
|
||||
if have_cgal
|
||||
then
|
||||
wmake $targetType conformalVoronoiMesh
|
||||
wmake $targetType conformalVoronoi2DMesh
|
||||
|
@ -1,8 +1,8 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||
|
||||
# Parse arguments for compilation (at least for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if [ -d "${FASTDUALOCTREE_SRC_PATH}" ]
|
||||
then
|
||||
|
@ -1,38 +1,27 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_zoltan
|
||||
|
||||
# Parse arguments for compilation (at least for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
unset COMP_FLAGS LINK_FLAGS
|
||||
|
||||
if [ -f "${FOAM_LIBBIN}/libSloanRenumber.so" ]
|
||||
if [ -f $FOAM_LIBBIN/libSloanRenumber$extLibso ]
|
||||
then
|
||||
echo " found libSloanRenumber -- enabling sloan renumbering support."
|
||||
export LINK_FLAGS="${LINK_FLAGS} -lSloanRenumber"
|
||||
export LINK_FLAGS="$LINK_FLAGS -lSloanRenumber"
|
||||
fi
|
||||
|
||||
if [ -f "${FOAM_LIBBIN}/libzoltanRenumber.so" ]
|
||||
if [ -f $FOAM_LIBBIN/libzoltanRenumber$extLibso ]
|
||||
then
|
||||
if [ -z "$ZOLTAN_ARCH_PATH" ]
|
||||
if have_zoltan
|
||||
then
|
||||
# Optional: get ZOLTAN_ARCH_PATH
|
||||
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan)
|
||||
then
|
||||
. $settings
|
||||
fi
|
||||
echo " found libzoltanRenumber -- enabling zoltan renumbering support."
|
||||
export COMP_FLAGS="$COMP_FLAGS -DHAVE_ZOLTAN"
|
||||
export LINK_FLAGS="$LINK_FLAGS -lzoltanRenumber -L$ZOLTAN_LIB_DIR -lzoltan"
|
||||
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
|
||||
|
@ -55,7 +55,7 @@ Description
|
||||
#include "processorMeshes.H"
|
||||
#include "hexRef8.H"
|
||||
|
||||
#ifdef FOAM_USE_ZOLTAN
|
||||
#ifdef HAVE_ZOLTAN
|
||||
#include "zoltanRenumber.H"
|
||||
#endif
|
||||
|
||||
@ -633,7 +633,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Force linker to include zoltan symbols. This section is only needed since
|
||||
// Zoltan is a static library
|
||||
#ifdef FOAM_USE_ZOLTAN
|
||||
#ifdef HAVE_ZOLTAN
|
||||
Info<< "renumberMesh built with zoltan support." << nl << endl;
|
||||
(void)zoltanRenumber::typeName;
|
||||
#endif
|
||||
|
@ -1,19 +1,17 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for compilation (at least for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # (for error catching)
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_readline
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
unset COMP_FLAGS LINK_FLAGS
|
||||
|
||||
#
|
||||
# use readline if available
|
||||
#
|
||||
if [ -f /usr/include/readline/readline.h ]
|
||||
# Use readline if available
|
||||
if have_readline
|
||||
then
|
||||
echo " found <readline/readline.h> -- enabling readline support."
|
||||
export COMP_FLAGS="-DHAS_READLINE"
|
||||
export LINK_FLAGS="-lreadline"
|
||||
echo " readline detected - enabling readline support."
|
||||
export COMP_FLAGS="-DHAVE_LIBREADLINE -I$READLINE_INC_DIR"
|
||||
export LINK_FLAGS="-L$READLINE_LIB_DIR -lreadline"
|
||||
fi
|
||||
|
||||
wmake $targetType
|
||||
|
@ -55,10 +55,11 @@ Description
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#ifdef HAS_READLINE
|
||||
#ifdef HAVE_LIBREADLINE
|
||||
#include <readline/readline.h>
|
||||
#include <readline/history.h>
|
||||
|
||||
static const char* historyFile = ".setSet";
|
||||
#endif
|
||||
|
||||
using namespace Foam;
|
||||
@ -66,11 +67,6 @@ using namespace Foam;
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
#ifdef HAS_READLINE
|
||||
static const char* historyFile = ".setSet";
|
||||
#endif
|
||||
|
||||
|
||||
// Write set to VTK readable files
|
||||
void writeVTK
|
||||
(
|
||||
@ -790,7 +786,7 @@ int main(int argc, char *argv[])
|
||||
printAllSets(mesh, Info);
|
||||
|
||||
// Read history if interactive
|
||||
#ifdef HAS_READLINE
|
||||
#ifdef HAVE_LIBREADLINE
|
||||
if (!batch && !read_history((runTime.path()/historyFile).c_str()))
|
||||
{
|
||||
Info<< "Successfully read history from " << historyFile << endl;
|
||||
@ -872,7 +868,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef HAS_READLINE
|
||||
#ifdef HAVE_LIBREADLINE
|
||||
{
|
||||
char* linePtr = readline("readline>");
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType helpTypes
|
||||
wmake $targetType
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
export WM_CONTINUE_ON_ERROR=true # Optional unit
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments # Parse arguments
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The CMake functions
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -1,8 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
|
||||
|
||||
if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
|
||||
[ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if have_fftw
|
||||
then
|
||||
wmake
|
||||
else
|
||||
|
@ -1,8 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
|
||||
|
||||
if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
|
||||
[ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if have_fftw
|
||||
then
|
||||
wmake
|
||||
else
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType tabulatedWallFunction
|
||||
wmake $targetType
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_cgal
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
unset COMP_FLAGS LINK_FLAGS
|
||||
|
||||
if [ -f "$CGAL_ARCH_PATH/include/CGAL/version.h" ] || \
|
||||
[ "${CGAL_ARCH_PATH##*-}" = system -a -f /usr/include/CGAL/version.h ]
|
||||
if have_cgal
|
||||
then
|
||||
wmake PolyhedronReader
|
||||
export COMP_FLAGS='-IPolyhedronReader'
|
||||
|
@ -1,7 +1,5 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
(wmake libso extractionMethod && wmake)
|
||||
|
@ -142,12 +142,18 @@ fi
|
||||
|
||||
if [ -n "$resolved" ]
|
||||
then
|
||||
case "$optSyntax" in
|
||||
csh)
|
||||
case "$optSyntax-$(uname -s 2>/dev/null)" in
|
||||
make*)
|
||||
printf "%s\n" "-L$resolved"
|
||||
;;
|
||||
csh-Darwin*)
|
||||
echo "setenv DYLD_LIBRARY_PATH $resolved:$DYLD_LIBRARY_PATH"
|
||||
;;
|
||||
csh*)
|
||||
echo "setenv LD_LIBRARY_PATH $resolved:$LD_LIBRARY_PATH"
|
||||
;;
|
||||
make)
|
||||
printf "%s\n" "-L$resolved"
|
||||
sh-Darwin*)
|
||||
echo "DYLD_LIBRARY_PATH=$resolved:$DYLD_LIBRARY_PATH"
|
||||
;;
|
||||
*)
|
||||
echo "LD_LIBRARY_PATH=$resolved:$LD_LIBRARY_PATH"
|
||||
@ -155,7 +161,7 @@ then
|
||||
esac
|
||||
exit 0 # Good
|
||||
else
|
||||
exit 1 # Error
|
||||
exit 1 # Error
|
||||
fi
|
||||
|
||||
|
||||
|
@ -304,7 +304,7 @@ endsw
|
||||
|
||||
|
||||
# Add (non-dummy) MPI implementation
|
||||
# - dummy MPI already added to LD_LIBRARY_PATH and has no external libraries
|
||||
# - dummy MPI already in lib-path and has no external libraries
|
||||
if ( "$FOAM_MPI" != dummy ) then
|
||||
if ( $?FOAM_EXT_LIBBIN ) then # External libraries (allowed to be unset)
|
||||
_foamAddLib ${FOAM_EXT_LIBBIN}/${FOAM_MPI}
|
||||
|
@ -106,6 +106,12 @@ case Linux:
|
||||
case Darwin: # Presumably x86_64
|
||||
if (! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64 # Default to 64-bit
|
||||
setenv WM_ARCH darwin64
|
||||
/bin/cat << INCOMPLETE
|
||||
===============================================================================
|
||||
Operating system '$WM_ARCH' has incomplete support in this OpenFOAM release.
|
||||
For further assistance, please contact www.OpenFOAM.com
|
||||
===============================================================================
|
||||
INCOMPLETE
|
||||
breaksw
|
||||
|
||||
case SunOS:
|
||||
@ -118,12 +124,12 @@ case SunOS:
|
||||
breaksw
|
||||
|
||||
default:
|
||||
/bin/cat << UNSUPPORTED_OS
|
||||
/bin/cat << UNSUPPORTED
|
||||
===============================================================================
|
||||
Your '$WM_ARCH' operating system is unsupported by this OpenFOAM release.
|
||||
Operating system '$WM_ARCH' is unsupported by this OpenFOAM release.
|
||||
For further assistance, please contact www.OpenFOAM.com
|
||||
===============================================================================
|
||||
UNSUPPORTED_OS
|
||||
UNSUPPORTED
|
||||
breaksw
|
||||
|
||||
endsw
|
||||
|
@ -56,7 +56,7 @@ then
|
||||
[ -n "$1" ] && export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
|
||||
}
|
||||
|
||||
# Prefix to LD_LIBRARY_PATH with additional checking
|
||||
# Prepend to LD_LIBRARY_PATH with additional checking
|
||||
# $1 = base directory for 'lib' or 'lib64'
|
||||
# $2 = fallback libname ('lib' or 'lib64')
|
||||
#
|
||||
@ -69,7 +69,7 @@ then
|
||||
# Return 0 on success
|
||||
_foamAddLibAuto()
|
||||
{
|
||||
# Note ksh doesn't have 'local' thus these ugly variable names
|
||||
# Note ksh does not have 'local' thus these ugly variable names
|
||||
foamVar_prefix="$1"
|
||||
foamVar_end="${1##*-}"
|
||||
|
||||
@ -112,6 +112,27 @@ then
|
||||
}
|
||||
|
||||
|
||||
# Special treatment for Darwin
|
||||
# - DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH
|
||||
if [ "$(uname -s 2>/dev/null)" = Darwin ]
|
||||
then
|
||||
unset -f _foamAddLib _foamAddLibAuto 2>/dev/null
|
||||
|
||||
# Prepend DYLD_LIBRARY_PATH
|
||||
_foamAddLib()
|
||||
{
|
||||
[ -n "$1" ] && export DYLD_LIBRARY_PATH=$1:$DYLD_LIBRARY_PATH
|
||||
}
|
||||
|
||||
# Prepend to DYLD_LIBRARY_PATH with additional checking
|
||||
# - use lib-dir script instead of rewriting
|
||||
_foamAddLibAuto()
|
||||
{
|
||||
eval "$($WM_PROJECT_DIR/bin/tools/lib-dir -sh $@)";
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
# Source an etc file, possibly with some verbosity
|
||||
# - use eval to avoid intermediate variables (ksh doesn't have 'local')
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
|
@ -307,7 +307,7 @@ esac
|
||||
|
||||
|
||||
# Add (non-dummy) MPI implementation
|
||||
# - dummy MPI already added to LD_LIBRARY_PATH and has no external libraries
|
||||
# - dummy MPI already in lib-path and has no external libraries
|
||||
if [ "$FOAM_MPI" != dummy ] && type _foamAddLib > /dev/null 2>&1
|
||||
then
|
||||
if [ -n "$FOAM_EXT_LIBBIN" ] # External libraries (allowed to be unset)
|
||||
|
@ -100,6 +100,13 @@ Linux)
|
||||
Darwin) # Presumably x86_64
|
||||
: ${WM_ARCH_OPTION:=64}; export WM_ARCH_OPTION # Default to 64-bit
|
||||
WM_ARCH=darwin64
|
||||
/bin/cat << INCOMPLETE 1>&2
|
||||
===============================================================================
|
||||
Operating system '$WM_ARCH' has incomplete support in this OpenFOAM release.
|
||||
For further assistance, please contact www.OpenFOAM.com
|
||||
===============================================================================
|
||||
INCOMPLETE
|
||||
echo "Darwin support ($WM_ARCH) is incomplete" 1>&2
|
||||
;;
|
||||
|
||||
SunOS)
|
||||
@ -112,12 +119,12 @@ SunOS)
|
||||
;;
|
||||
|
||||
*) # An unsupported operating system
|
||||
/bin/cat << UNSUPPORTED_OS 1>&2
|
||||
/bin/cat << UNSUPPORTED 1>&2
|
||||
===============================================================================
|
||||
Your '$WM_ARCH' operating system is unsupported by this OpenFOAM release.
|
||||
Operating system '$WM_ARCH' is unsupported by this OpenFOAM release.
|
||||
For further assistance, please contact www.OpenFOAM.com
|
||||
===============================================================================
|
||||
UNSUPPORTED_OS
|
||||
UNSUPPORTED
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -11,7 +11,6 @@ cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR/src" 2>/dev/null || {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -1,22 +1,19 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
targetType=libo
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
targetType=libo # Preferred library type
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments $*
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
unset COMP_FLAGS LINK_FLAGS
|
||||
|
||||
#
|
||||
# use <sys/inotify.h> if available (Linux)
|
||||
#
|
||||
# If <sys/inotify.h> is available (Linux)
|
||||
if [ -f /usr/include/sys/inotify.h ]
|
||||
then
|
||||
echo " found <sys/inotify.h> -- enabling inotify for file monitoring."
|
||||
export COMP_FLAGS="-DFOAM_USE_INOTIFY"
|
||||
fi
|
||||
|
||||
# make (non-shared by default) object
|
||||
# Make object (non-shared by default)
|
||||
wmake $targetType
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -1,9 +1,8 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Define how to create an mpi-versioned library of $targetType
|
||||
# compile into qualified directory
|
||||
@ -35,5 +34,4 @@ case "$WM_MPLIB" in
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType turbulenceModels
|
||||
wmake $targetType incompressible
|
||||
wmake $targetType compressible
|
||||
|
@ -1,10 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
targetType=libso
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
targetType=libso # Preferred library type
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType
|
||||
|
||||
ccm/Allwmake
|
||||
|
@ -1,39 +1,18 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Optional component: (eg, may depend on third-party libraries)
|
||||
|
||||
# Parse arguments for compilation (at least for error catching)
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_ccmio
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Optional
|
||||
# - may depend on third-party libraries
|
||||
|
||||
warning="==> skip optional libccm adapter"
|
||||
|
||||
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio)
|
||||
# Link with static libccmio only (fewer issues)
|
||||
if have_ccmio
|
||||
then
|
||||
. $settings
|
||||
else
|
||||
echo "$warning (no config.sh/ccmio settings)"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
# Link with static libccmio only (possibly fewer issues)
|
||||
if [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
|
||||
-a -e $CCMIO_ARCH_PATH/lib/libccmio.a ]
|
||||
then
|
||||
# The libccmio uses int32_t.
|
||||
# The OpenFOAM adapter thus requires additional work for 64-bit labels.
|
||||
# The OpenFOAM adapter was originally only designed for 'double'
|
||||
|
||||
if [ "$WM_LABEL_SIZE" = 64 ]
|
||||
then
|
||||
echo "$warning (not designed for 64-bit labels)"
|
||||
elif [ "$WM_PRECISION_OPTION" = SP ]
|
||||
then
|
||||
echo "$warning (not designed for single precision)"
|
||||
else
|
||||
wmake libso || echo "$warning (build issues detected)"
|
||||
fi
|
||||
wmake libso || echo "$warning (build issues detected)"
|
||||
else
|
||||
echo $warning
|
||||
fi
|
||||
|
@ -6,9 +6,9 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/fileFormats/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/conversion/lnInclude \
|
||||
-I$(CCMIO_ARCH_PATH)/include
|
||||
-I$(CCMIO_INC_DIR)
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lconversion \
|
||||
-L$(CCMIO_ARCH_PATH)/lib -lccmio
|
||||
-L$(CCMIO_LIB_DIR) -lccmio
|
||||
|
6
src/dummyThirdParty/Allwmake
vendored
6
src/dummyThirdParty/Allwmake
vendored
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType scotchDecomp
|
||||
wmake $targetType ptscotchDecomp
|
||||
wmake $targetType metisDecomp
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType field
|
||||
wmake $targetType forces
|
||||
wmake $targetType lagrangian
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
runTimePostProcessing/Allwmake
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The CMake functions
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions # The CMake functions
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
@ -1,86 +1,14 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_mgridgen
|
||||
|
||||
: ${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH} # Extra safety
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
: ${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH} # Extra safety?
|
||||
export FOAM_EXT_LIBBIN
|
||||
|
||||
# Test for mgridgen.
|
||||
# - return 0 and export MGRIDGEN_ARCH_PATH on success
|
||||
hasMgridGen()
|
||||
{
|
||||
local warning="==> skip mgridgen"
|
||||
|
||||
unset MGRIDGEN_ARCH_PATH MGRIDGEN_VERSION
|
||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mgridgen) || {
|
||||
# ignore silently# echo "$warning (no config.sh/mgridgen settings)"
|
||||
return 1
|
||||
}
|
||||
|
||||
. $settings
|
||||
if [ -z "$MGRIDGEN_ARCH_PATH" -o "${MGRIDGEN_ARCH_PATH##*-}" = none ]
|
||||
then
|
||||
# ignore silently# echo "$warning (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Header
|
||||
local header=$MGRIDGEN_ARCH_PATH/include/mgridgen.h
|
||||
[ -f "$header" ] || {
|
||||
# ignore silently# echo "$warning (no header)"
|
||||
return 2 # file not found
|
||||
}
|
||||
|
||||
# Library
|
||||
[ -r $FOAM_EXT_LIBBIN/libMGridGen.so ] || \
|
||||
[ -r $MGRIDGEN_ARCH_PATH/lib/libmgrid.a ] || \
|
||||
[ -r $MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmgrid.a ] || \
|
||||
[ "${MGRIDGEN_ARCH_PATH##*-}" = system ] || {
|
||||
# ignore silently# echo "$warning (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Ensure consistent sizes with OpenFOAM and mgridgen header
|
||||
# Extract typedef for idxtype, realtype
|
||||
local label=$(sed -ne \
|
||||
's/^.*typedef *\([^ ]*\) *idxtype.*/\1/ip' \
|
||||
"$header")
|
||||
local scalar=$(sed -ne \
|
||||
's/^.*typedef *\([^ ]*\) *realtype.*/\1/ip' \
|
||||
"$header")
|
||||
|
||||
: ${label:=unknown}
|
||||
: ${scalar:=unknown}
|
||||
|
||||
case "$WM_LABEL_SIZE:$label" in
|
||||
(32:int32_t | 32:int | 64:int64_t | 64:long)
|
||||
export MGRIDGEN_ARCH_PATH
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "$warning (label='$WM_LABEL_SIZE', mgridgen.h has '$label')"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
case "$WM_PRECISION_OPTION:$scalar" in
|
||||
(SP:float | DP:double)
|
||||
export MGRIDGEN_ARCH_PATH
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "$warning (scalar='$WM_PRECISION_OPTION', mgridgen.h has '$scalar')"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# OK
|
||||
echo "mgridgen (label=$label, scalar=$scalar) - $MGRIDGEN_ARCH_PATH"
|
||||
|
||||
}
|
||||
|
||||
if hasMgridGen
|
||||
if have_mgridgen
|
||||
then
|
||||
wmake $targetType MGridGenGamgAgglomeration
|
||||
fi
|
||||
|
@ -1,9 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(MGRIDGEN_ARCH_PATH)/include
|
||||
-I$(MGRIDGEN_INC_DIR)
|
||||
|
||||
LIB_LIBS = \
|
||||
-L$(FOAM_EXT_LIBBIN) \
|
||||
-L$(MGRIDGEN_ARCH_PATH)/lib \
|
||||
-L$(MGRIDGEN_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||
-lmgrid
|
||||
-L$(MGRIDGEN_LIB_DIR) -lmgrid
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType distributionModels
|
||||
wmake $targetType basic
|
||||
wmake $targetType solidParticle
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType potential
|
||||
wmake $targetType molecularMeasurements
|
||||
wmake $targetType molecule
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType snappyHexMesh
|
||||
wmake $targetType blockMesh
|
||||
wmake $targetType extrudeModel
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
decompose/Allwmake $targetType $*
|
||||
reconstruct/Allwmake $targetType $*
|
||||
wmake $targetType distributed
|
||||
|
@ -1,221 +1,15 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_kahip
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_metis
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_scotch
|
||||
|
||||
: ${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH} # Extra safety
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
: ${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH} # Extra safety?
|
||||
export FOAM_EXT_LIBBIN
|
||||
|
||||
# Check for the existence of any of the files
|
||||
# On success, echoes the file found and returns 0, otherwise returns 2
|
||||
findFirstFile()
|
||||
{
|
||||
local file
|
||||
for file
|
||||
do
|
||||
if [ -f "$file" -a -r "$file" ]
|
||||
then
|
||||
echo "$file"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 2
|
||||
}
|
||||
|
||||
|
||||
# Test for kahip.
|
||||
# - return 0 and export KAHIP_ARCH_PATH on success
|
||||
hasKahip()
|
||||
{
|
||||
local warning="==> skip kahip"
|
||||
local header label settings
|
||||
|
||||
unset KAHIP_ARCH_PATH KAHIP_VERSION
|
||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/kahip) || {
|
||||
echo "$warning (no config.sh/kahip settings)"
|
||||
return 1
|
||||
}
|
||||
|
||||
. $settings
|
||||
if [ -z "$KAHIP_ARCH_PATH" -o "${KAHIP_ARCH_PATH##*-}" = none ]
|
||||
then
|
||||
echo "$warning (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Header
|
||||
header=$(findFirstFile \
|
||||
$KAHIP_ARCH_PATH/include/kaHIP_interface.h \
|
||||
/usr/include/kaHIP_interface.h \
|
||||
) || {
|
||||
echo "$warning (no header)"
|
||||
return 2 # file not found
|
||||
}
|
||||
|
||||
# Library
|
||||
[ "${KAHIP_ARCH_PATH##*-}" = system ] || \
|
||||
findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/libkahip.so \
|
||||
$KAHIP_ARCH_PATH/lib/libkahip.a \
|
||||
$KAHIP_ARCH_PATH/lib/libkahip.so \
|
||||
$KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libkahip.a \
|
||||
$KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libkahip.so \
|
||||
> /dev/null || {
|
||||
echo "$warning (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# kahip itself is 32-bit int, but our interface itself handles some
|
||||
# 64-bit conversion (mesh size).
|
||||
|
||||
export KAHIP_ARCH_PATH
|
||||
echo "kahip (label=32) - $KAHIP_ARCH_PATH"
|
||||
}
|
||||
|
||||
|
||||
# Test for metis.
|
||||
# - return 0 and export METIS_ARCH_PATH on success
|
||||
hasMetis()
|
||||
{
|
||||
local warning="==> skip metis"
|
||||
local header label settings
|
||||
|
||||
unset METIS_ARCH_PATH METIS_VERSION
|
||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) || {
|
||||
echo "$warning (no config.sh/metis settings)"
|
||||
return 1
|
||||
}
|
||||
|
||||
. $settings
|
||||
if [ -z "$METIS_ARCH_PATH" -o "${METIS_ARCH_PATH##*-}" = none ]
|
||||
then
|
||||
echo "$warning (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Header
|
||||
header=$(findFirstFile \
|
||||
$METIS_ARCH_PATH/include/metis.h \
|
||||
/usr/include/metis.h \
|
||||
) || {
|
||||
echo "$warning (no header)"
|
||||
return 2 # file not found
|
||||
}
|
||||
|
||||
# Library
|
||||
[ "${METIS_ARCH_PATH##*-}" = system ] || \
|
||||
findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/libmetis.so \
|
||||
$METIS_ARCH_PATH/lib/libmetis.a \
|
||||
$METIS_ARCH_PATH/lib/libmetis.so \
|
||||
$METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.a \
|
||||
$METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.so \
|
||||
> /dev/null || {
|
||||
echo "$warning (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Ensure consistent sizes between OpenFOAM and metis header
|
||||
# Extract IDXTYPEWIDTH from metis.h: regex as per ThirdParty Allwmake
|
||||
label=$(sed -ne 's/^.*#define *IDXTYPEWIDTH *\([1-9][0-9]\).*/\1/p' $header)
|
||||
: ${label:=unknown}
|
||||
|
||||
if [ "$WM_LABEL_SIZE" = "$label" ]
|
||||
then
|
||||
echo "Metis (label=$label) - $METIS_ARCH_PATH"
|
||||
export METIS_ARCH_PATH
|
||||
else
|
||||
echo "$warning (label=$WM_LABEL_SIZE, metis.h has '$label')"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Test for scotch.
|
||||
# - return 0 and export SCOTCH_ARCH_PATH, SCOTCH_VERSION on success
|
||||
hasScotch()
|
||||
{
|
||||
local warning="==> skip scotch"
|
||||
local header label settings
|
||||
|
||||
unset SCOTCH_ARCH_PATH SCOTCH_VERSION
|
||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) || {
|
||||
echo "$warning (no config.sh/scotch settings)"
|
||||
return 1
|
||||
}
|
||||
|
||||
. $settings
|
||||
if [ -z "$SCOTCH_ARCH_PATH" -o "${SCOTCH_ARCH_PATH##*-}" = none ]
|
||||
then
|
||||
echo "$warning (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Header
|
||||
header=$(findFirstFile \
|
||||
$SCOTCH_ARCH_PATH/include/scotch.h \
|
||||
/usr/include/scotch/scotch.h \
|
||||
/usr/include/scotch.h
|
||||
) || {
|
||||
echo "$warning (no header)"
|
||||
return 2 # file not found
|
||||
}
|
||||
|
||||
# Library
|
||||
[ "${SCOTCH_ARCH_PATH##*-}" = system ] || \
|
||||
findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/libscotch.so \
|
||||
$SCOTCH_ARCH_PATH/lib/libscotch.a \
|
||||
$SCOTCH_ARCH_PATH/lib/libscotch.so \
|
||||
$SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.a \
|
||||
$SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.so \
|
||||
> /dev/null || {
|
||||
echo "$warning (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Ensure consistent sizes between OpenFOAM and scotch header
|
||||
# extract 'typedef int64_t SCOTCH_Num' or equivalent
|
||||
label=$(sed -ne \
|
||||
's/^.*typedef *\([^ ]*\) *SCOTCH_Num.*/\1/ip' \
|
||||
"$header")
|
||||
|
||||
: ${label:=unknown}
|
||||
|
||||
# No SCOTCH_VERSION set? Try to obtain from header
|
||||
# extract #define SCOTCH_VERSION, SCOTCH_RELEASE, SCOTCH_PATCHLEVEL
|
||||
[ -n "$SCOTCH_VERSION" ] || \
|
||||
SCOTCH_VERSION=$(
|
||||
eval $(
|
||||
sed -ne \
|
||||
's/^ *#define *SCOTCH_\(VERSION\|RELEASE\|PATCHLEVEL\) *\([0-9][0-9]*\).*$/\1=\2/p' \
|
||||
"$header"
|
||||
)
|
||||
|
||||
set -- $VERSION $RELEASE $PATCHLEVEL
|
||||
IFS="."
|
||||
[ "$#" -gt 0 ] && echo "scotch-$*"
|
||||
)
|
||||
|
||||
# Failsafe value
|
||||
: ${SCOTCH_VERSION:=scotch}
|
||||
|
||||
case "$WM_LABEL_SIZE:$label" in
|
||||
(32:int32_t | 32:int | 64:int64_t | 64:long)
|
||||
echo "Scotch (label=$label) - $SCOTCH_ARCH_PATH"
|
||||
export SCOTCH_ARCH_PATH SCOTCH_VERSION
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "$warning (label='$WM_LABEL_SIZE', scotch.h has '$label')"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Define how to create an mpi-versioned library of $targetType
|
||||
# compile into qualified directory
|
||||
@ -244,7 +38,7 @@ wmakeMpiLib()
|
||||
|
||||
wmakeLnInclude -u decompositionMethods
|
||||
|
||||
if hasScotch
|
||||
if have_scotch
|
||||
then
|
||||
wmake $targetType scotchDecomp
|
||||
if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ]
|
||||
@ -253,12 +47,12 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
if hasMetis
|
||||
if have_metis
|
||||
then
|
||||
wmake $targetType metisDecomp
|
||||
fi
|
||||
|
||||
if hasKahip
|
||||
if have_kahip
|
||||
then
|
||||
wmake $targetType kahipDecomp
|
||||
fi
|
||||
|
@ -1,15 +1,10 @@
|
||||
EXE_INC = \
|
||||
-I$(KAHIP_ARCH_PATH)/include \
|
||||
-I$(KAHIP_INC_DIR) \
|
||||
-I../decompositionMethods/lnInclude
|
||||
|
||||
/*
|
||||
* The $(KAHIP_ARCH_PATH)/lib$WM_COMPILER_LIB_ARCH path is provided
|
||||
* to support central, non-thirdparty installations.
|
||||
*
|
||||
* KaHIP is often compiled with openmp, but may be missing the
|
||||
* link dependency for openmp.
|
||||
* KaHIP is usually compiled with openmp, but may be missing the
|
||||
* openmp link dependency.
|
||||
*/
|
||||
LIB_LIBS = \
|
||||
-L$(KAHIP_ARCH_PATH)/lib \
|
||||
-L$(KAHIP_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||
-L$(FOAM_EXT_LIBBIN) $(LINK_OPENMP) -lkahip
|
||||
-L$(KAHIP_LIB_DIR) $(LINK_OPENMP) -lkahip
|
||||
|
@ -1,14 +1,6 @@
|
||||
EXE_INC = \
|
||||
/* -DFULLDEBUG -g -O0 */ \
|
||||
-I$(METIS_ARCH_PATH)/include \
|
||||
-I$(METIS_INC_DIR) \
|
||||
-I../decompositionMethods/lnInclude
|
||||
|
||||
/*
|
||||
* The $(METIS_ARCH_PATH)/lib$WM_COMPILER_LIB_ARCH path is provided
|
||||
* 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
|
||||
-L$(METIS_LIB_DIR) -lmetis
|
||||
|
@ -3,21 +3,16 @@ sinclude $(RULES)/mplib$(WM_MPLIB)
|
||||
|
||||
EXE_INC = \
|
||||
$(PFLAGS) $(PINC) \
|
||||
-I../decompositionMethods/lnInclude \
|
||||
-I$(SCOTCH_ARCH_PATH)/include/$(FOAM_MPI) \
|
||||
-I$(SCOTCH_ARCH_PATH)/include \
|
||||
-I/usr/include/scotch \
|
||||
-I../decompositionMethods/lnInclude
|
||||
-I$(SCOTCH_INC_DIR)
|
||||
|
||||
/*
|
||||
* The '-lscotch' is a slight hack:
|
||||
* ptscotch 6 requires scotch linked in, but does not declare the dependency
|
||||
*
|
||||
* The $(SCOTCH_ARCH_PATH)/lib$WM_COMPILER_LIB_ARCH path is provided
|
||||
* to support central, non-thirdparty installations
|
||||
*/
|
||||
LIB_LIBS = \
|
||||
-L$(SCOTCH_ARCH_PATH)/lib \
|
||||
-L$(SCOTCH_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||
-L$(SCOTCH_LIB_DIR) \
|
||||
-L$(FOAM_EXT_LIBBIN) \
|
||||
-L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) \
|
||||
-lptscotch \
|
||||
|
@ -7,18 +7,8 @@ sinclude $(RULES)/mplib$(WM_MPLIB)
|
||||
|
||||
EXE_INC = \
|
||||
$(PFLAGS) $(PINC) \
|
||||
-I$(SCOTCH_ARCH_PATH)/include \
|
||||
-I/usr/include/scotch \
|
||||
-I$(SCOTCH_INC_DIR) \
|
||||
-I../decompositionMethods/lnInclude
|
||||
|
||||
/*
|
||||
* The $(SCOTCH_ARCH_PATH)/lib$WM_COMPILER_LIB_ARCH path is provided
|
||||
* 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 \
|
||||
-lscotcherrexit \
|
||||
-lrt
|
||||
-L$(SCOTCH_LIB_DIR) -lscotch -lscotcherrexit -lrt
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType reconstruct
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
@ -1,14 +1,13 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
targetType=libso
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
targetType=libso # Preferred library type
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_fftw
|
||||
|
||||
if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
|
||||
[ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if have_fftw
|
||||
then
|
||||
# If it fails, we want to know.
|
||||
wmake $targetType
|
||||
else
|
||||
echo "==> skip randomProcesses library (no FFTW)"
|
||||
|
@ -1,12 +1,10 @@
|
||||
EXE_INC = \
|
||||
-I$(FFTW_ARCH_PATH)/include \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
-I$(LIB_SRC)/surfMesh/lnInclude
|
||||
-I$(LIB_SRC)/surfMesh/lnInclude \
|
||||
-I$(FFTW_INC_DIR)
|
||||
|
||||
LIB_LIBS = \
|
||||
-L$(FFTW_ARCH_PATH)/lib \
|
||||
-L$(FFTW_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||
-lfftw3 \
|
||||
-L$(FFTW_LIB_DIR) -lfftw3 \
|
||||
-lfiniteVolume \
|
||||
-lsampling
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType regionModel
|
||||
wmake $targetType pyrolysisModels
|
||||
wmake $targetType surfaceFilmModels
|
||||
|
@ -1,29 +1,25 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
targetType=libso
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
targetType=libso # Preferred library type
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_boost
|
||||
. $WM_PROJECT_DIR/wmake/scripts/have_zoltan
|
||||
|
||||
# Optional: get ZOLTAN_ARCH_PATH
|
||||
if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan)
|
||||
then
|
||||
. $settings
|
||||
fi
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType renumberMethods
|
||||
|
||||
warning="==> skip SloanRenumber"
|
||||
if [ -f "$BOOST_ARCH_PATH/include/boost/version.hpp" ] || \
|
||||
[ "${BOOST_ARCH_PATH##*-}" = system -a -f /usr/include/boost/version.hpp ]
|
||||
if have_boost
|
||||
then
|
||||
wmake $targetType SloanRenumber || echo "$warning (build issues detected)"
|
||||
else
|
||||
echo "$warning (no boost)"
|
||||
fi
|
||||
|
||||
|
||||
warning="==> skip zoltanRenumber"
|
||||
if [ -d "$ZOLTAN_ARCH_PATH" ]
|
||||
if have_zoltan
|
||||
then
|
||||
wmake $targetType zoltanRenumber || echo "$warning (build issues detected)"
|
||||
else
|
||||
|
@ -1,14 +1,12 @@
|
||||
EXE_INC = \
|
||||
${c++LESSWARN} \
|
||||
-I$(BOOST_ARCH_PATH)/include \
|
||||
-I$(BOOST_INC_DIR) \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
|
||||
-I$(LIB_SRC)/renumber/renumberMethods/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-L$(BOOST_ARCH_PATH)/lib \
|
||||
-L$(BOOST_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||
-lboost_system \
|
||||
-L$(BOOST_LIB_DIR) -lboost_system \
|
||||
-lmeshTools \
|
||||
-ldecompositionMethods \
|
||||
-lrenumberMethods
|
||||
|
@ -2,15 +2,12 @@ sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
|
||||
sinclude $(RULES)/mplib$(WM_MPLIB)
|
||||
|
||||
EXE_INC = \
|
||||
/* -DFULLDEBUG -g -O0 */ \
|
||||
$(PFLAGS) $(PINC) \
|
||||
${c++LESSWARN} \
|
||||
-I$(LIB_SRC)/renumber/renumberMethods/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(ZOLTAN_ARCH_PATH)/include
|
||||
-I$(ZOLTAN_INC_DIR)
|
||||
|
||||
LIB_LIBS = \
|
||||
-L$(ZOLTAN_ARCH_PATH)/lib \
|
||||
-L$(ZOLTAN_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
|
||||
-lzoltan \
|
||||
-L$(ZOLTAN_LIB_DIR) -lzoltan \
|
||||
-lmeshTools
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType specie
|
||||
wmake $targetType solidSpecie
|
||||
wmake $targetType thermophysicalProperties
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
wmake $targetType twoPhaseMixture
|
||||
wmake $targetType interfaceProperties
|
||||
wmake $targetType twoPhaseProperties
|
||||
|
127
wmake/scripts/have_boost
Normal file
127
wmake/scripts/have_boost
Normal file
@ -0,0 +1,127 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# have_boost
|
||||
#
|
||||
# Description
|
||||
# Detection/setup of Boost
|
||||
#
|
||||
# Requires
|
||||
# BOOST_ARCH_PATH
|
||||
#
|
||||
# Functions provided
|
||||
# have_boost, no_boost, echo_boost
|
||||
#
|
||||
# Variables set on success
|
||||
# HAVE_BOOST
|
||||
# BOOST_ARCH_PATH
|
||||
# BOOST_INC_DIR
|
||||
# BOOST_LIB_DIR
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Reset variables
|
||||
no_boost()
|
||||
{
|
||||
unset HAVE_BOOST BOOST_INC_DIR BOOST_LIB_DIR
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# Report
|
||||
echo_boost()
|
||||
{
|
||||
echo "boost=${HAVE_BOOST:-false}"
|
||||
echo "root=$BOOST_ARCH_PATH"
|
||||
echo "include=$BOOST_INC_DIR"
|
||||
echo "library=$BOOST_LIB_DIR"
|
||||
}
|
||||
|
||||
|
||||
# On success, return 0 and export variables
|
||||
# -> HAVE_BOOST, BOOST_INC_DIR, BOOST_LIB_DIR
|
||||
have_boost()
|
||||
{
|
||||
local header library static label settings warn
|
||||
# warn="==> skip boost"
|
||||
|
||||
# Basic setup/checks
|
||||
if isNone "$BOOST_ARCH_PATH"
|
||||
then
|
||||
[ -n "$warn" ] && echo "$warn (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Header/library names
|
||||
header="boost/version.hpp"
|
||||
library="libboost_system$extLibso"
|
||||
|
||||
|
||||
if hasAbsdir "$BOOST_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile $BOOST_ARCH_PATH/include/$header)
|
||||
|
||||
# FOAM_EXT_LIBBIN is allowed to be unset
|
||||
library=$(findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/$library \
|
||||
$BOOST_ARCH_PATH/lib/$library \
|
||||
$BOOST_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
elif isSystem "$BOOST_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile /usr/include/$header)
|
||||
|
||||
library=$(findFirstFile \
|
||||
/usr/lib/$library \
|
||||
/usr/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
else
|
||||
unset header library
|
||||
fi
|
||||
|
||||
|
||||
# Header found?
|
||||
[ -n "$header" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (no header)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Library found?
|
||||
[ -n "$library" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
header="${header%/*}" # Strip one-level (include/boost/...)
|
||||
|
||||
export HAVE_BOOST=true
|
||||
export BOOST_ARCH_PATH
|
||||
export BOOST_INC_DIR="${header%/*}" # Basename
|
||||
export BOOST_LIB_DIR="${library%/*}" # Basename
|
||||
}
|
||||
|
||||
|
||||
# Force reset of old variables
|
||||
no_boost
|
||||
|
||||
# Testing
|
||||
if [ "$1" = "-test" ]
|
||||
then
|
||||
have_boost
|
||||
echo_boost
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
145
wmake/scripts/have_ccmio
Normal file
145
wmake/scripts/have_ccmio
Normal file
@ -0,0 +1,145 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# have_ccmio
|
||||
#
|
||||
# Description
|
||||
# Detection/setup of ccmio
|
||||
#
|
||||
# Requires
|
||||
# config.sh/ccmio
|
||||
#
|
||||
# Functions provided
|
||||
# have_ccmio, no_ccmio, echo_ccmio
|
||||
#
|
||||
# Variables set on success
|
||||
# HAVE_CCMIO
|
||||
# CCMIO_ARCH_PATH
|
||||
# CCMIO_INC_DIR
|
||||
# CCMIO_LIB_DIR
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Reset variables
|
||||
no_ccmio()
|
||||
{
|
||||
unset HAVE_CCMIO CCMIO_INC_DIR CCMIO_LIB_DIR
|
||||
return 0
|
||||
}
|
||||
|
||||
# Report
|
||||
echo_ccmio()
|
||||
{
|
||||
echo "ccmio=${HAVE_CCMIO:-false}"
|
||||
echo "root=$CCMIO_ARCH_PATH"
|
||||
echo "include=$CCMIO_INC_DIR"
|
||||
echo "library=$CCMIO_LIB_DIR"
|
||||
}
|
||||
|
||||
|
||||
# On success, return 0 and export variables
|
||||
# -> HAVE_CCMIO, CCMIO_INC_DIR, CCMIO_LIB_DIR
|
||||
have_ccmio()
|
||||
{
|
||||
local header library static label settings warn good
|
||||
warn="==> skip ccmio"
|
||||
|
||||
# Basic setup/checks
|
||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/ccmio) || {
|
||||
[ -n "$warn" ] && echo "$warn (no config.sh/ccmio settings)"
|
||||
return 1
|
||||
}
|
||||
. $settings
|
||||
if isNone "$CCMIO_ARCH_PATH"
|
||||
then
|
||||
[ -n "$warn" ] && echo "$warn (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Header/library names.
|
||||
# Link with static libccmio only (fewer issues)
|
||||
#
|
||||
header="libccmio/ccmio.h"
|
||||
static="libccmio$extLiba"
|
||||
|
||||
|
||||
if hasAbsdir "$CCMIO_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile $CCMIO_ARCH_PATH/include/$header)
|
||||
|
||||
# FOAM_EXT_LIBBIN is allowed to be unset
|
||||
library=$(findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/$library \
|
||||
$CCMIO_ARCH_PATH/lib/$static \
|
||||
$CCMIO_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
|
||||
)
|
||||
else
|
||||
unset header library
|
||||
fi
|
||||
|
||||
|
||||
# Header found?
|
||||
[ -n "$header" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (no header)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Library found?
|
||||
[ -n "$library" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
header="${header%/*}" # Strip one-level (include/libccmio/...)
|
||||
|
||||
# The libccmio uses int32_t.
|
||||
# The OpenFOAM adapter thus requires additional work for 64-bit labels.
|
||||
# The OpenFOAM adapter was originally only designed for 'double'
|
||||
|
||||
if [ "$WM_LABEL_SIZE" = 32 ]
|
||||
then
|
||||
if [ "$WM_PRECISION_OPTION" = DP ]
|
||||
then
|
||||
good=true
|
||||
else
|
||||
[ -n "$warn" ] && echo "$warn (double precision only)"
|
||||
no_ccmio
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
[ -n "$warn" ] && echo "$warn (32-bit labels only)"
|
||||
no_ccmio
|
||||
return 1
|
||||
fi
|
||||
|
||||
export HAVE_CCMIO=true
|
||||
export CCMIO_ARCH_PATH
|
||||
export CCMIO_INC_DIR="${header%/*}" # Basename
|
||||
export CCMIO_LIB_DIR="${library%/*}" # Basename
|
||||
}
|
||||
|
||||
|
||||
# Force reset of old variables
|
||||
no_ccmio
|
||||
|
||||
# Testing
|
||||
if [ "$1" = "-test" ]
|
||||
then
|
||||
have_ccmio
|
||||
echo_ccmio
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
127
wmake/scripts/have_cgal
Normal file
127
wmake/scripts/have_cgal
Normal file
@ -0,0 +1,127 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# have_cgal
|
||||
#
|
||||
# Description
|
||||
# Detection/setup of CGAL
|
||||
#
|
||||
# Requires
|
||||
# CGAL_ARCH_PATH
|
||||
#
|
||||
# Functions provided
|
||||
# have_cgal, no_cgal, echo_cgal
|
||||
#
|
||||
# Variables set on success
|
||||
# HAVE_CGAL
|
||||
# CGAL_ARCH_PATH
|
||||
# CGAL_INC_DIR
|
||||
# CGAL_LIB_DIR
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Reset variables
|
||||
no_cgal()
|
||||
{
|
||||
unset HAVE_CGAL CGAL_INC_DIR CGAL_LIB_DIR
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# Reset variables
|
||||
echo_cgal()
|
||||
{
|
||||
echo "cgal=${HAVE_CGAL:-false}"
|
||||
echo "root=$CGAL_ARCH_PATH"
|
||||
echo "include=$CGAL_INC_DIR"
|
||||
echo "library=$CGAL_LIB_DIR"
|
||||
}
|
||||
|
||||
|
||||
# On success, return 0 and export variables
|
||||
# -> HAVE_CGAL, CGAL_INC_DIR, CGAL_LIB_DIR
|
||||
have_cgal()
|
||||
{
|
||||
local header library static label settings warn
|
||||
# warn="==> skip cgal"
|
||||
|
||||
# Basic setup/checks
|
||||
if isNone "$CGAL_ARCH_PATH"
|
||||
then
|
||||
[ -n "$warn" ] && echo "$warn (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Header/library names
|
||||
header="CGAL/version.h"
|
||||
library="libCGAL$extLibso"
|
||||
|
||||
|
||||
if hasAbsdir "$CGAL_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile $CGAL_ARCH_PATH/include/$header)
|
||||
|
||||
# FOAM_EXT_LIBBIN is allowed to be unset
|
||||
library=$(findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/$library \
|
||||
$CGAL_ARCH_PATH/lib/$library \
|
||||
$CGAL_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
elif isSystem "$CGAL_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile /usr/include/$header)
|
||||
|
||||
library=$(findFirstFile \
|
||||
/usr/lib/$library \
|
||||
/usr/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
else
|
||||
unset header library
|
||||
fi
|
||||
|
||||
|
||||
# Header found?
|
||||
[ -n "$header" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (no header)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Library found?
|
||||
[ -n "$library" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
header="${header%/*}" # Strip one-level (include/CGAL/...)
|
||||
|
||||
export HAVE_CGAL=true
|
||||
export CGAL_ARCH_PATH
|
||||
export CGAL_INC_DIR="${header%/*}" # Basename
|
||||
export CGAL_LIB_DIR="${library%/*}" # Basename
|
||||
}
|
||||
|
||||
|
||||
# Force reset of old variables
|
||||
no_cgal
|
||||
|
||||
# Testing
|
||||
if [ "$1" = "-test" ]
|
||||
then
|
||||
have_cgal
|
||||
echo_cgal
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
125
wmake/scripts/have_fftw
Normal file
125
wmake/scripts/have_fftw
Normal file
@ -0,0 +1,125 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# have_fftw
|
||||
#
|
||||
# Description
|
||||
# Detection/setup of FFTW
|
||||
#
|
||||
# Requires
|
||||
# FFTW_ARCH_PATH
|
||||
#
|
||||
# Functions provided
|
||||
# have_fftw, no_fftw, echo_fftw
|
||||
#
|
||||
# Variables set on success
|
||||
# HAVE_FFTW
|
||||
# FFTW_ARCH_PATH
|
||||
# FFTW_INC_DIR
|
||||
# FFTW_LIB_DIR
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Reset variables
|
||||
no_fftw()
|
||||
{
|
||||
unset HAVE_FFTW FFTW_INC_DIR FFTW_LIB_DIR
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# Report
|
||||
echo_fftw()
|
||||
{
|
||||
echo "fftw=${HAVE_FFTW:-false}"
|
||||
echo "root=$FFTW_ARCH_PATH"
|
||||
echo "include=$FFTW_INC_DIR"
|
||||
echo "library=$FFTW_LIB_DIR"
|
||||
}
|
||||
|
||||
|
||||
# On success, return 0 and export variables
|
||||
# -> HAVE_FFTW, FFTW_INC_DIR, FFTW_LIB_DIR
|
||||
have_fftw()
|
||||
{
|
||||
local header library static label settings warn
|
||||
# warn="==> skip fftw"
|
||||
|
||||
# Basic setup/checks
|
||||
if isNone "$FFTW_ARCH_PATH"
|
||||
then
|
||||
[ -n "$warn" ] && echo "$warn (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Header/library names
|
||||
header="fftw3.h"
|
||||
library="libfftw3$extLibso"
|
||||
|
||||
|
||||
if hasAbsdir "$FFTW_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile $FFTW_ARCH_PATH/include/$header)
|
||||
|
||||
# FOAM_EXT_LIBBIN is allowed to be unset
|
||||
library=$(findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/$library \
|
||||
$FFTW_ARCH_PATH/lib/$library \
|
||||
$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
elif isSystem "$FFTW_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile /usr/include/$header)
|
||||
|
||||
library=$(findFirstFile \
|
||||
/usr/lib/$library \
|
||||
/usr/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
else
|
||||
unset header library
|
||||
fi
|
||||
|
||||
|
||||
# Header found?
|
||||
[ -n "$header" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (no header)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Library found?
|
||||
[ -n "$library" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
export HAVE_FFTW=true
|
||||
export FFTW_ARCH_PATH
|
||||
export FFTW_INC_DIR="${header%/*}" # Basename
|
||||
export FFTW_LIB_DIR="${library%/*}" # Basename
|
||||
}
|
||||
|
||||
|
||||
# Force reset of old variables
|
||||
no_fftw
|
||||
|
||||
# Testing
|
||||
if [ "$1" = "-test" ]
|
||||
then
|
||||
have_fftw
|
||||
echo_fftw
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
138
wmake/scripts/have_kahip
Normal file
138
wmake/scripts/have_kahip
Normal file
@ -0,0 +1,138 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# have_kahip
|
||||
#
|
||||
# Description
|
||||
# Detection/setup of KAHIP
|
||||
#
|
||||
# Requires
|
||||
# config.sh/kahip
|
||||
#
|
||||
# Functions provided
|
||||
# have_kahip, no_kahip, echo_kahip
|
||||
#
|
||||
# Variables set on success
|
||||
# HAVE_KAHIP
|
||||
# KAHIP_ARCH_PATH
|
||||
# KAHIP_INC_DIR
|
||||
# KAHIP_LIB_DIR
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Reset variables
|
||||
no_kahip()
|
||||
{
|
||||
unset HAVE_KAHIP KAHIP_ARCH_PATH KAHIP_INC_DIR KAHIP_LIB_DIR
|
||||
unset KAHIP_VERSION
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# Report
|
||||
echo_kahip()
|
||||
{
|
||||
echo "kahip=${HAVE_KAHIP:-false}"
|
||||
echo "root=$KAHIP_ARCH_PATH"
|
||||
echo "include=$KAHIP_INC_DIR"
|
||||
echo "library=$KAHIP_LIB_DIR"
|
||||
}
|
||||
|
||||
|
||||
# On success, return 0 and export variables
|
||||
# -> HAVE_KAHIP, KAHIP_ARCH_PATH, KAHIP_INC_DIR, KAHIP_LIB_DIR
|
||||
have_kahip()
|
||||
{
|
||||
local header library static label settings warn
|
||||
warn="==> skip kahip"
|
||||
|
||||
# Basic setup/checks
|
||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/kahip) || {
|
||||
[ -n "$warn" ] && echo "$warn (no config.sh/kahip settings)"
|
||||
return 1
|
||||
}
|
||||
. $settings
|
||||
if isNone "$KAHIP_ARCH_PATH"
|
||||
then
|
||||
[ -n "$warn" ] && echo "$warn (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Header/library names
|
||||
header="kaHIP_interface.h"
|
||||
library="libkahip$extLibso"
|
||||
static="libkahip$extLiba"
|
||||
|
||||
if hasAbsdir "$KAHIP_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile $KAHIP_ARCH_PATH/include/$header)
|
||||
|
||||
# FOAM_EXT_LIBBIN is allowed to be unset
|
||||
library=$(findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/$library \
|
||||
$METIS_ARCH_PATH/lib/$static \
|
||||
$METIS_ARCH_PATH/lib/$library \
|
||||
$METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
|
||||
$METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
elif isSystem "$KAHIP_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile /usr/include/$header)
|
||||
|
||||
library=$(findFirstFile \
|
||||
/usr/lib/$library \
|
||||
/usr/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
else
|
||||
unset header library
|
||||
fi
|
||||
|
||||
|
||||
# Header found?
|
||||
[ -n "$header" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (no header)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Library found?
|
||||
[ -n "$library" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
|
||||
# kahip itself is 32-bit int, but our interface itself handles some
|
||||
# 64-bit conversion (mesh size).
|
||||
|
||||
echo "kahip (label=32) - $KAHIP_ARCH_PATH"
|
||||
export HAVE_KAHIP=true
|
||||
export KAHIP_ARCH_PATH
|
||||
export KAHIP_INC_DIR="${header%/*}" # Basename
|
||||
export KAHIP_LIB_DIR="${library%/*}" # Basename
|
||||
}
|
||||
|
||||
|
||||
# Force reset of old variables
|
||||
no_kahip
|
||||
|
||||
# Testing
|
||||
if [ "$1" = "-test" ]
|
||||
then
|
||||
have_kahip
|
||||
echo_kahip
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
151
wmake/scripts/have_metis
Normal file
151
wmake/scripts/have_metis
Normal file
@ -0,0 +1,151 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# have_metis
|
||||
#
|
||||
# Description
|
||||
# Detection/setup of metis
|
||||
#
|
||||
# Requires
|
||||
# config.sh/metis
|
||||
#
|
||||
# Functions provided
|
||||
# have_metis, no_metis, echo_metis
|
||||
#
|
||||
# Variables set on success
|
||||
# HAVE_METIS
|
||||
# METIS_ARCH_PATH
|
||||
# METIS_INC_DIR
|
||||
# METIS_LIB_DIR
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Reset variables
|
||||
no_metis()
|
||||
{
|
||||
unset HAVE_METIS METIS_ARCH_PATH METIS_INC_DIR METIS_LIB_DIR
|
||||
unset METIS_VERSION
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# Report
|
||||
echo_metis()
|
||||
{
|
||||
echo "metis=${HAVE_METIS:-false}"
|
||||
echo "root=$METIS_ARCH_PATH"
|
||||
echo "include=$METIS_INC_DIR"
|
||||
echo "library=$METIS_LIB_DIR"
|
||||
}
|
||||
|
||||
|
||||
# On success, return 0 and export variables
|
||||
# -> HAVE_METIS, METIS_ARCH_PATH, METIS_INC_DIR, METIS_LIB_DIR
|
||||
have_metis()
|
||||
{
|
||||
local header library static label settings warn
|
||||
warn="==> skip metis"
|
||||
|
||||
# Basic setup/checks
|
||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) || {
|
||||
[ -n "$warn" ] && echo "$warn (no config.sh/metis settings)"
|
||||
return 1
|
||||
}
|
||||
. $settings
|
||||
if isNone "$METIS_ARCH_PATH"
|
||||
then
|
||||
[ -n "$warn" ] && echo "$warn (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Header/library names
|
||||
header="metis.h"
|
||||
library="libmetis$extLibso"
|
||||
static="libmetis$extLiba"
|
||||
|
||||
|
||||
if hasAbsdir "$METIS_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile $METIS_ARCH_PATH/include/$header)
|
||||
|
||||
# FOAM_EXT_LIBBIN is allowed to be unset
|
||||
library=$(findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/$library \
|
||||
$METIS_ARCH_PATH/lib/$static \
|
||||
$METIS_ARCH_PATH/lib/$library \
|
||||
$METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
|
||||
$METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
elif isSystem "$METIS_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile /usr/include/$header)
|
||||
|
||||
library=$(findFirstFile \
|
||||
/usr/lib/$library \
|
||||
/usr/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
else
|
||||
unset header library
|
||||
fi
|
||||
|
||||
|
||||
# Header found?
|
||||
[ -n "$header" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (no header)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Library found?
|
||||
[ -n "$library" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
|
||||
# Ensure consistent sizes between OpenFOAM and metis header
|
||||
# Extract IDXTYPEWIDTH from metis.h: regex as per ThirdParty Allwmake
|
||||
label=$(sed -ne 's/^.*#define *IDXTYPEWIDTH *\([1-9][0-9]\).*/\1/p' $header)
|
||||
: ${label:=unknown}
|
||||
|
||||
if [ "$WM_LABEL_SIZE" = "$label" ]
|
||||
then
|
||||
echo "Metis (label=$label) - $METIS_ARCH_PATH"
|
||||
export HAVE_METIS=true
|
||||
export METIS_ARCH_PATH
|
||||
export METIS_INC_DIR="${header%/*}" # Basename
|
||||
export METIS_LIB_DIR="${library%/*}" # Basename
|
||||
else
|
||||
if [ -n "$warn" ]
|
||||
then
|
||||
echo "$warn (label=$WM_LABEL_SIZE, metis.h has '$label')"
|
||||
fi
|
||||
no_metis
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Force reset of old variables
|
||||
no_metis
|
||||
|
||||
# Testing
|
||||
if [ "$1" = "-test" ]
|
||||
then
|
||||
have_metis
|
||||
echo_metis
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
177
wmake/scripts/have_mgridgen
Normal file
177
wmake/scripts/have_mgridgen
Normal file
@ -0,0 +1,177 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# have_mgridgen
|
||||
#
|
||||
# Description
|
||||
# Detection/setup of mgridgen
|
||||
#
|
||||
# Requires
|
||||
# config.sh/mgridgen
|
||||
#
|
||||
# Functions provided
|
||||
# have_mgridgen, no_mgridgen, echo_mgridgen
|
||||
#
|
||||
# Variables set on success
|
||||
# HAVE_MGRIDGEN
|
||||
# MGRIDGEN_ARCH_PATH
|
||||
# MGRIDGEN_INC_DIR
|
||||
# MGRIDGEN_LIB_DIR
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Reset variables
|
||||
no_mgridgen()
|
||||
{
|
||||
unset HAVE_MGRIDGEN MGRIDGEN_ARCH_PATH MGRIDGEN_INC_DIR MGRIDGEN_LIB_DIR
|
||||
unset MGRIDGEN_VERSION
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# Report
|
||||
echo_mgridgen()
|
||||
{
|
||||
echo "mgridgen=${HAVE_MGRIDGEN:-false}"
|
||||
echo "root=$MGRIDGEN_ARCH_PATH"
|
||||
echo "include=$MGRIDGEN_INC_DIR"
|
||||
echo "library=$MGRIDGEN_LIB_DIR"
|
||||
}
|
||||
|
||||
|
||||
# On success, return 0 and export variables
|
||||
# -> HAVE_MGRIDGEN, MGRIDGEN_ARCH_PATH, MGRIDGEN_INC_DIR, MGRIDGEN_LIB_DIR
|
||||
have_mgridgen()
|
||||
{
|
||||
local header library static label scalar settings warn good
|
||||
warn="==> skip mgridgen"
|
||||
|
||||
# Basic setup/checks
|
||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/mgridgen) || {
|
||||
#silent# [ -n "$warn" ] && echo "$warn (no config.sh/mgridgen settings)"
|
||||
return 1
|
||||
}
|
||||
. $settings
|
||||
if isNone "$MGRIDGEN_ARCH_PATH"
|
||||
then
|
||||
#silent# [ -n "$warn" ] && echo "$warn (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Header/library names
|
||||
header="mgridgen.h"
|
||||
library="libMGridGen$extLibso"
|
||||
static="libmgrid$extLiba"
|
||||
|
||||
|
||||
if hasAbsdir "$MGRIDGEN_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile $MGRIDGEN_ARCH_PATH/include/$header)
|
||||
|
||||
# FOAM_EXT_LIBBIN is allowed to be unset
|
||||
library=$(findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/$library \
|
||||
$MGRIDGEN_ARCH_PATH/lib/$static \
|
||||
$MGRIDGEN_ARCH_PATH/lib/$library \
|
||||
$MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
|
||||
$MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
elif isSystem "$MGRIDGEN_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile /usr/include/$header)
|
||||
|
||||
library=$(findFirstFile \
|
||||
/usr/lib/$library \
|
||||
/usr/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
else
|
||||
unset header library
|
||||
fi
|
||||
|
||||
|
||||
# Header found?
|
||||
[ -n "$header" ] || {
|
||||
#silent# [ -n "$warn" ] && echo "$warn (no header)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Library found?
|
||||
[ -n "$library" ] || {
|
||||
#silent# [ -n "$warn" ] && echo "$warn (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
|
||||
# Ensure consistent sizes with OpenFOAM and mgridgen header
|
||||
# Extract typedef for idxtype, realtype
|
||||
label=$(sed -ne \
|
||||
's/^.*typedef *\([^ ]*\) *idxtype.*/\1/ip' \
|
||||
"$header")
|
||||
scalar=$(sed -ne \
|
||||
's/^.*typedef *\([^ ]*\) *realtype.*/\1/ip' \
|
||||
"$header")
|
||||
|
||||
: ${label:=unknown}
|
||||
: ${scalar:=unknown}
|
||||
|
||||
|
||||
case "$WM_LABEL_SIZE:$label" in
|
||||
(32:int32_t | 32:int | 64:int64_t | 64:long)
|
||||
good=true
|
||||
;;
|
||||
|
||||
*)
|
||||
if [ -n "$warn" ]
|
||||
then
|
||||
echo "$warn (label='$WM_LABEL_SIZE', mgridgen.h has '$label')"
|
||||
fi
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
case "$WM_PRECISION_OPTION:$scalar" in
|
||||
(SP:float | DP:double)
|
||||
good=true
|
||||
;;
|
||||
|
||||
*)
|
||||
if [ -n "$warn" ]
|
||||
then
|
||||
echo "$warn (scalar='$WM_PRECISION_OPTION', mgridgen.h has '$scalar')"
|
||||
fi
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# OK
|
||||
echo "mgridgen (label=$label, scalar=$scalar) - $MGRIDGEN_ARCH_PATH"
|
||||
export HAVE_MGRIDGEN=true
|
||||
export MGRIDGEN_ARCH_PATH MGRIDGEN_VERSION
|
||||
export MGRIDGEN_INC_DIR="${header%/*}" # Basename
|
||||
export MGRIDGEN_LIB_DIR="${library%/*}" # Basename
|
||||
}
|
||||
|
||||
|
||||
# Force reset of old variables
|
||||
no_mgridgen
|
||||
|
||||
# Testing
|
||||
if [ "$1" = "-test" ]
|
||||
then
|
||||
have_mgridgen
|
||||
echo_mgridgen
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
101
wmake/scripts/have_readline
Normal file
101
wmake/scripts/have_readline
Normal file
@ -0,0 +1,101 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# have_readline
|
||||
#
|
||||
# Description
|
||||
# Detection/setup of readline
|
||||
#
|
||||
# Requires
|
||||
# None
|
||||
#
|
||||
# Functions provided
|
||||
# have_readline, no_readline, echo_readline
|
||||
#
|
||||
# Variables set on success
|
||||
# HAVE_LIBREADLINE - as per GNU autoconf
|
||||
# READLINE_INC_DIR
|
||||
# READLINE_LIB_DIR
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Reset variables
|
||||
no_readline()
|
||||
{
|
||||
unset HAVE_LIBREADLINE READLINE_INC_DIR READLINE_LIB_DIR
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# Report
|
||||
echo_readline()
|
||||
{
|
||||
echo "readline=${HAVE_LIBREADLINE:-false}"
|
||||
echo "include=$READLINE_INC_DIR"
|
||||
echo "library=$READLINE_LIB_DIR"
|
||||
}
|
||||
|
||||
|
||||
# On success, return 0 and export variables
|
||||
# -> HAVE_LIBREADLINE, READLINE_INC_DIR, READLINE_LIB_DIR
|
||||
have_readline()
|
||||
{
|
||||
local header library static settings warn
|
||||
# warn="==> skip readline"
|
||||
|
||||
|
||||
# Header/library names
|
||||
header="readline/readline.h"
|
||||
library="libreadline$extLibso"
|
||||
|
||||
# System only?
|
||||
header=$(findFirstFile /usr/include/$header)
|
||||
|
||||
library=$(findFirstFile \
|
||||
/usr/lib/$library \
|
||||
/usr/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
|
||||
# Header found?
|
||||
[ -n "$header" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (no header)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Library found?
|
||||
[ -n "$library" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
header="${header%/*}" # Strip one-level (include/readline/...)
|
||||
|
||||
export HAVE_LIBREADLINE=true
|
||||
export READLINE_INC_DIR="${header%/*}" # Basename
|
||||
export READLINE_LIB_DIR="${library%/*}" # Basename
|
||||
}
|
||||
|
||||
|
||||
# Force reset of old variables
|
||||
no_readline
|
||||
|
||||
# Testing
|
||||
if [ "$1" = "-test" ]
|
||||
then
|
||||
have_readline
|
||||
echo_readline
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
174
wmake/scripts/have_scotch
Normal file
174
wmake/scripts/have_scotch
Normal file
@ -0,0 +1,174 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# have_scotch
|
||||
#
|
||||
# Description
|
||||
# Detection/setup of scotch
|
||||
#
|
||||
# Requires
|
||||
# config.sh/scotch
|
||||
#
|
||||
# Functions provided
|
||||
# have_scotch, no_scotch, echo_scotch
|
||||
#
|
||||
# Variables set on success
|
||||
# HAVE_SCOTCH
|
||||
# SCOTCH_ARCH_PATH
|
||||
# SCOTCH_INC_DIR
|
||||
# SCOTCH_LIB_DIR
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Reset variables
|
||||
no_scotch()
|
||||
{
|
||||
unset HAVE_SCOTCH SCOTCH_ARCH_PATH SCOTCH_INC_DIR SCOTCH_LIB_DIR
|
||||
unset SCOTCH_VERSION
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# Report
|
||||
echo_scotch()
|
||||
{
|
||||
echo "scotch=${HAVE_SCOTCH:-false}"
|
||||
echo "root=$SCOTCH_ARCH_PATH"
|
||||
echo "include=$SCOTCH_INC_DIR"
|
||||
echo "library=$SCOTCH_LIB_DIR"
|
||||
}
|
||||
|
||||
|
||||
# On success, return 0 and export variables
|
||||
# -> HAVE_SCOTCH, SCOTCH_ARCH_PATH, SCOTCH_INC_DIR, SCOTCH_LIB_DIR
|
||||
have_scotch()
|
||||
{
|
||||
local header library static label settings warn
|
||||
warn="==> skip scotch"
|
||||
|
||||
# Basic setup/checks
|
||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) || {
|
||||
[ -n "$warn" ] && echo "$warn (no config.sh/scotch settings)"
|
||||
return 1
|
||||
}
|
||||
. $settings
|
||||
if isNone "$SCOTCH_ARCH_PATH"
|
||||
then
|
||||
[ -n "$warn" ] && echo "$warn (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Header/library names
|
||||
header="scotch.h"
|
||||
library="libscotch$extLibso"
|
||||
static="libscotch$extLiba"
|
||||
|
||||
|
||||
if hasAbsdir "$SCOTCH_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile $SCOTCH_ARCH_PATH/include/$header)
|
||||
|
||||
# FOAM_EXT_LIBBIN is allowed to be unset
|
||||
library=$(findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/$library \
|
||||
$SCOTCH_ARCH_PATH/lib/$static \
|
||||
$SCOTCH_ARCH_PATH/lib/$library \
|
||||
$SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
|
||||
$SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
elif isSystem "$SCOTCH_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile /usr/include/$header /usr/include/scotch/$header)
|
||||
|
||||
library=$(findFirstFile \
|
||||
/usr/lib/$library \
|
||||
/usr/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
else
|
||||
unset header library
|
||||
fi
|
||||
|
||||
|
||||
# Header found?
|
||||
[ -n "$header" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (no header)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Library found?
|
||||
[ -n "$library" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
|
||||
# Ensure consistent sizes between OpenFOAM and scotch header
|
||||
# extract 'typedef int64_t SCOTCH_Num' or equivalent
|
||||
label=$(sed -ne \
|
||||
's/^.*typedef *\([^ ]*\) *SCOTCH_Num.*/\1/ip' \
|
||||
"$header")
|
||||
: ${label:=unknown} # Failsafe value
|
||||
|
||||
|
||||
# No SCOTCH_VERSION set? Try to obtain from header
|
||||
# extract #define SCOTCH_VERSION, SCOTCH_RELEASE, SCOTCH_PATCHLEVEL
|
||||
[ -n "$SCOTCH_VERSION" ] || \
|
||||
SCOTCH_VERSION=$(
|
||||
eval $(
|
||||
sed -ne \
|
||||
's/^ *#define *SCOTCH_\(VERSION\|RELEASE\|PATCHLEVEL\) *\([0-9][0-9]*\).*$/\1=\2/p' \
|
||||
"$header"
|
||||
)
|
||||
|
||||
set -- $VERSION $RELEASE $PATCHLEVEL
|
||||
IFS="."
|
||||
[ "$#" -gt 0 ] && echo "scotch-$*"
|
||||
)
|
||||
: ${SCOTCH_VERSION:=scotch} # Failsafe value
|
||||
|
||||
|
||||
case "$WM_LABEL_SIZE:$label" in
|
||||
(32:int32_t | 32:int | 64:int64_t | 64:long)
|
||||
echo "Scotch (label=$label) - $SCOTCH_ARCH_PATH"
|
||||
export HAVE_SCOTCH=true
|
||||
export SCOTCH_ARCH_PATH SCOTCH_VERSION
|
||||
export SCOTCH_INC_DIR="${header%/*}" # Basename
|
||||
export SCOTCH_LIB_DIR="${library%/*}" # Basename
|
||||
;;
|
||||
|
||||
*)
|
||||
if [ -n "$warn" ]
|
||||
then
|
||||
echo "$warn (label='$WM_LABEL_SIZE', scotch.h has '$label')"
|
||||
fi
|
||||
no_scotch
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
# Force reset of old variables
|
||||
no_scotch
|
||||
|
||||
# Testing
|
||||
if [ "$1" = "-test" ]
|
||||
then
|
||||
have_scotch
|
||||
echo_scotch
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
133
wmake/scripts/have_zoltan
Normal file
133
wmake/scripts/have_zoltan
Normal file
@ -0,0 +1,133 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# have_zoltan
|
||||
#
|
||||
# Description
|
||||
# Detection/setup of zoltan
|
||||
#
|
||||
# Requires
|
||||
# config.sh/zoltan
|
||||
#
|
||||
# Functions provided
|
||||
# have_zoltan, no_zoltan, echo_zoltan
|
||||
#
|
||||
# Variables set on success
|
||||
# HAVE_ZOLTAN
|
||||
# ZOLTAN_ARCH_PATH
|
||||
# ZOLTAN_INC_DIR
|
||||
# ZOLTAN_LIB_DIR
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
. $WM_PROJECT_DIR/wmake/scripts/sysFunctions # General system functions
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# Reset variables
|
||||
no_zoltan()
|
||||
{
|
||||
unset HAVE_ZOLTAN ZOLTAN_INC_DIR ZOLTAN_LIB_DIR
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
# Report
|
||||
echo_zoltan()
|
||||
{
|
||||
echo "zoltan=${HAVE_ZOLTAN:-false}"
|
||||
echo "root=$ZOLTAN_ARCH_PATH"
|
||||
echo "include=$ZOLTAN_INC_DIR"
|
||||
echo "library=$ZOLTAN_LIB_DIR"
|
||||
}
|
||||
|
||||
|
||||
# On success, return 0 and export variables
|
||||
# -> HAVE_ZOLTAN, ZOLTAN_INC_DIR, ZOLTAN_LIB_DIR
|
||||
have_zoltan()
|
||||
{
|
||||
local header library static label settings warn
|
||||
# warn="==> skip zoltan"
|
||||
|
||||
# Basic setup/checks
|
||||
settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan) || {
|
||||
[ -n "$warn" ] && echo "$warn (no config.sh/zoltan settings)"
|
||||
return 1
|
||||
}
|
||||
. $settings
|
||||
if isNone "$ZOLTAN_ARCH_PATH"
|
||||
then
|
||||
[ -n "$warn" ] && echo "$warn (not available)"
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Header/library names
|
||||
header="zoltan.h"
|
||||
library="libzoltan$extLibso"
|
||||
static="libzoltan$extLiba"
|
||||
|
||||
|
||||
if hasAbsdir "$ZOLTAN_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile $ZOLTAN_ARCH_PATH/include/$header)
|
||||
|
||||
# FOAM_EXT_LIBBIN is allowed to be unset
|
||||
library=$(findFirstFile \
|
||||
$FOAM_EXT_LIBBIN/$library \
|
||||
$ZOLTAN_ARCH_PATH/lib/$static \
|
||||
$ZOLTAN_ARCH_PATH/lib/$library \
|
||||
$ZOLTAN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$static \
|
||||
$ZOLTAN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
elif isSystem "$ZOLTAN_ARCH_PATH"
|
||||
then
|
||||
header=$(findFirstFile /usr/include/$header)
|
||||
|
||||
library=$(findFirstFile \
|
||||
/usr/lib/$library \
|
||||
/usr/lib$WM_COMPILER_LIB_ARCH/$library \
|
||||
)
|
||||
else
|
||||
unset header library
|
||||
fi
|
||||
|
||||
|
||||
# Header found?
|
||||
[ -n "$header" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (no header)"
|
||||
return 2
|
||||
}
|
||||
|
||||
# Library found?
|
||||
[ -n "$library" ] || {
|
||||
[ -n "$warn" ] && echo "$warn (missing library)"
|
||||
return 2
|
||||
}
|
||||
|
||||
export HAVE_ZOLTAN=true
|
||||
export ZOLTAN_ARCH_PATH
|
||||
export ZOLTAN_INC_DIR="${header%/*}" # Basename
|
||||
export ZOLTAN_LIB_DIR="${library%/*}" # Basename
|
||||
}
|
||||
|
||||
|
||||
# Force reset of old variables
|
||||
no_zoltan
|
||||
|
||||
# Testing
|
||||
if [ "$1" = "-test" ]
|
||||
then
|
||||
have_zoltan
|
||||
echo_zoltan
|
||||
fi
|
||||
|
||||
#------------------------------------------------------------------------------
|
110
wmake/scripts/sysFunctions
Normal file
110
wmake/scripts/sysFunctions
Normal file
@ -0,0 +1,110 @@
|
||||
#----------------------------------*-sh-*--------------------------------------
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Script
|
||||
# sysFunctions
|
||||
#
|
||||
# Description
|
||||
# General system helper functions
|
||||
#
|
||||
# Functions provided
|
||||
# isDarwin
|
||||
# isNone
|
||||
# isSystem
|
||||
# isAbsdir, hasAbsdir
|
||||
# findFirstFile
|
||||
#
|
||||
# Variables provided
|
||||
# extLiba
|
||||
# extLibso
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$WMAKE_SCRIPTS_SYSFUNCTIONS" ]
|
||||
then
|
||||
# Load once, but do not rely on this variable elsewhere
|
||||
WMAKE_SCRIPTS_SYSFUNCTIONS=loaded
|
||||
|
||||
# Static library extension. Default=.a
|
||||
extLiba=".a"
|
||||
|
||||
# Shared library extension. Default=.so
|
||||
case "$(uname -s 2>/dev/null)" in
|
||||
Darwin)
|
||||
extLibso=".dylib"
|
||||
;;
|
||||
*)
|
||||
extLibso=".so"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# True if OS is Darwin.
|
||||
# Uses libso extension to cache the value
|
||||
# (instead of calling 'uname -s' each time)
|
||||
isDarwin()
|
||||
{
|
||||
test "$extLibso" = ".dylib"
|
||||
}
|
||||
|
||||
|
||||
# True if '$1' begins with '/'
|
||||
isAbsdir()
|
||||
{
|
||||
test "$1" = "/${1#/}"
|
||||
}
|
||||
|
||||
|
||||
# True if '$1' begins with '/' and also exists as a directory
|
||||
hasAbsdir()
|
||||
{
|
||||
test "$1" = "/${1#/}" -a -d "$1"
|
||||
}
|
||||
|
||||
|
||||
# True if '$1' is an empty string or matches "*-none".
|
||||
# Eg,
|
||||
# if isNone "$KAHIP_ARCH_PATH" ...
|
||||
isNone()
|
||||
{
|
||||
test -z "$1" -o "${1##*-}" = none
|
||||
}
|
||||
|
||||
|
||||
# True if '$1' matches "*-system"
|
||||
# Eg,
|
||||
# if isSystem "$BOOST_ARCH_PATH"
|
||||
isSystem()
|
||||
{
|
||||
test "${1##*-}" = system
|
||||
}
|
||||
|
||||
|
||||
# Check for the existence of any of the files
|
||||
# On success, echoes the file found and returns 0, otherwise returns 2
|
||||
findFirstFile()
|
||||
{
|
||||
local file
|
||||
for file
|
||||
do
|
||||
if [ -f "$file" -a -r "$file" ]
|
||||
then
|
||||
echo "$file"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 2
|
||||
}
|
||||
|
||||
fi
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
Loading…
Reference in New Issue
Block a user