mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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>");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user