CONFIG: detect newer adios library name (fixes #1911)

ENH: provide fallback prefix for cmake detection

STYLE: simplify some shell syntax, avoid uname call in sysFunctions

STYLE: report FOAM_MPI during mpiLib builds
This commit is contained in:
Mark Olesen 2020-11-04 19:16:13 +01:00
parent f7c8e39804
commit 4cf44850a7
4 changed files with 29 additions and 24 deletions

View File

@ -75,6 +75,7 @@ search_adios2()
local warn # warn="==> skip adios2" local warn # warn="==> skip adios2"
local incName="adios2.h" local incName="adios2.h"
local libName="libadios2" local libName="libadios2"
local libName2="libadios2_cxx11_mpi"
local prefix="${1:-system}" local prefix="${1:-system}"
local header library local header library
@ -106,6 +107,7 @@ search_adios2()
# Library # Library
[ -n "$library" ] \ [ -n "$library" ] \
|| library=$(findLibrary -prefix="$prefix" -name="$libName") \ || library=$(findLibrary -prefix="$prefix" -name="$libName") \
|| library=$(findLibrary -prefix="$prefix" -name="$libName2") \
|| { || {
[ -n "$warn" ] && echo "$warn (no library)" [ -n "$warn" ] && echo "$warn (no library)"
return 2 return 2

View File

@ -60,16 +60,15 @@ search_cmake()
# Treat previous queries as "sticky" # Treat previous queries as "sticky"
if [ -n "$CMAKE_EXE" ] if [ -n "$CMAKE_EXE" ]
then then
test "$CMAKE_EXE" != "false" [ "$CMAKE_EXE" != "false" ]
return $? return $?
fi fi
local prefix="$1" local prefix="${1:-/usr}"
local candidate foundExe local candidate="$prefix"/bin/cmake
local foundExe
candidate="$prefix"/bin/cmake if [ -f "$candidate" ] && [ -x "$candidate" ]
if [ -d "$prefix" ] && [ -f "$candidate" ] && [ -x "$candidate" ]
then then
foundExe="$candidate" foundExe="$candidate"
elif candidate="$(command -v cmake 2>/dev/null)" elif candidate="$(command -v cmake 2>/dev/null)"
@ -77,17 +76,17 @@ search_cmake()
# Resolved from PATH # Resolved from PATH
foundExe="$candidate" foundExe="$candidate"
fi fi
# ----------------------------------
if [ -n "$foundExe" ] if [ -z "$foundExe" ]
then then
# OK
export HAVE_CMAKE=true
export CMAKE_EXE="$foundExe"
else
# Failure
export CMAKE_EXE="false" # Avoid repeated calls? export CMAKE_EXE="false" # Avoid repeated calls?
return 2 return 2
fi fi
# OK
export HAVE_CMAKE=true
export CMAKE_EXE="$foundExe"
} }
@ -97,7 +96,7 @@ have_cmake()
# Treat previous queries as "sticky" # Treat previous queries as "sticky"
if [ -n "$CMAKE_EXE" ] if [ -n "$CMAKE_EXE" ]
then then
test "$CMAKE_EXE" != "false" [ "$CMAKE_EXE" != "false" ]
return $? return $?
fi fi

View File

@ -46,18 +46,21 @@ then
DEB_TARGET_MULTIARCH=$(dpkg-architecture -qDEB_TARGET_MULTIARCH 2>/dev/null || true) DEB_TARGET_MULTIARCH=$(dpkg-architecture -qDEB_TARGET_MULTIARCH 2>/dev/null || true)
fi fi
# True if OS is Darwin. # True if OS is <darwin>.
# Test WM_ARCH for "darwin*" (lowercase) - avoid uname system call
isDarwin() isDarwin()
{ {
test Darwin = "$(uname -s 2>/dev/null || true)" [ "${WM_ARCH#darwin}" != "${WM_ARCH}" ]
} }
# True if target OS is Windows # True if target OS is <windows>
# Test WM_OSTYPE for or '*windows' (or '*Windows')
isWindows() isWindows()
{ {
test MSwindows = "$WM_OSTYPE" [ "${WM_OSTYPE%indows}" != "${WM_OSTYPE}" ]
} }
# Static, dynamic library extensions # Static, dynamic library extensions
extLibraries=".a .so" extLibraries=".a .so"
@ -69,26 +72,27 @@ then
extLibraries=".a .dll .dll.a" # including cross-compiling extLibraries=".a .dll .dll.a" # including cross-compiling
fi fi
# True if '$1' begins with '/' # True if '$1' begins with '/'
isAbsdir() isAbsdir()
{ {
test "$1" = "/${1#/}" [ "$1" = "/${1#/}" ]
} }
# True if '$1' begins with '/' and also exists as a directory # True if '$1' begins with '/' and also exists as a directory
hasAbsdir() hasAbsdir()
{ {
test "$1" = "/${1#/}" -a -d "$1" [ "$1" = "/${1#/}" ] && [ -d "$1" ]
} }
# True if '$1' is an empty string, "none" or ends in "-none" # True if '$1' is an empty string, "none" or ends in "-none"
# Eg, # Eg,
# if isNone "$BOOST_ARCH_PATH" ... # if isNone "$BOOST_ARCH_PATH"
isNone() isNone()
{ {
test -z "$1" -o "${1##*-}" = none [ -z "$1" ] || [ "${1##*-}" = none ]
} }
@ -97,7 +101,7 @@ then
# if isSystem "$BOOST_ARCH_PATH" # if isSystem "$BOOST_ARCH_PATH"
isSystem() isSystem()
{ {
test "${1##*-}" = system [ "${1##*-}" = system ]
} }
@ -106,7 +110,7 @@ then
# equalBaseName "/usr/include/scotch-int32" "scotch-int32" # equalBaseName "/usr/include/scotch-int32" "scotch-int32"
equalBaseName() equalBaseName()
{ {
test "${1##*/}" = "${2##*/}" [ "${1##*/}" = "${2##*/}" ]
} }

View File

@ -310,7 +310,7 @@ wmakeLibMpi()
sentinel=$(sameDependency "$libName" "MPLIB=$WM_MPLIB" "MPI=$FOAM_MPI" $@) || \ sentinel=$(sameDependency "$libName" "MPLIB=$WM_MPLIB" "MPI=$FOAM_MPI" $@) || \
wclean "$libName" wclean "$libName"
echo "wmake $targetType $libName (mpi=$WM_MPLIB)" echo "wmake $targetType $libName (mpi=$WM_MPLIB:$FOAM_MPI)"
wmake $targetType "$libName" && \ wmake $targetType "$libName" && \
storeDependency "$sentinel" "MPLIB=$WM_MPLIB" "MPI=$FOAM_MPI" $@ storeDependency "$sentinel" "MPLIB=$WM_MPLIB" "MPI=$FOAM_MPI" $@
) )