mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +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:
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user