diff --git a/Allclean b/Allclean
index a185740..b87214f 100755
--- a/Allclean
+++ b/Allclean
@@ -7,11 +7,10 @@
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011 OpenFOAM Foundation
-# Copyright (C) 2016-2019 OpenCFD Ltd.
+# Copyright (C) 2016-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
-# This file is part of OpenFOAM, licensed under GNU General Public License
-# .
+# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# Allclean
@@ -35,10 +34,10 @@ usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat< [ ... ]]
+Usage: ${0##*/} [OPTION] [platform [ ... platformN]]
options:
- -all remove all platforms directories.
- -current clean the current platform ($WM_OPTIONS).
+ -all remove all platforms directories
+ -current clean the current platform ($WM_OPTIONS)
-help print the usage
Cleanup intermediate build directories.
@@ -50,10 +49,11 @@ USAGE
}
# Print help message
-if [ "$1" = "-h" -o "$1" = "-help" ]
-then
+case "$1" in
+(-h | -help*)
usage
-fi
+ ;;
+esac
#------------------------------------------------------------------------------
@@ -124,7 +124,7 @@ fi
removePlatform()
{
local platform="$1"
- if [ -n "$platform" -a -d "platforms/$platform" ]
+ if [ -n "$platform" ] && [ -d "platforms/$platform" ]
then
echo
echo "Cleaning platform '$platform'"
diff --git a/Allwmake b/Allwmake
index 06b82fe..4a07b97 100755
--- a/Allwmake
+++ b/Allwmake
@@ -7,14 +7,13 @@
# \\/ M anipulation |
#------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation
-# Copyright (C) 2016-2019 OpenCFD Ltd.
+# Copyright (C) 2016-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
-# This file is part of OpenFOAM, licensed under GNU General Public License
-# .
+# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
-# Allwmake
+# ThirdParty Allwmake
#
# Description
# Build script for ThirdParty applications/libraries
@@ -29,11 +28,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo " Check your OpenFOAM environment and installation"
exit 1
}
-[ -n "$FOAM_EXT_LIBBIN" ] || {
- echo "Error (${0##*/}) : \$FOAM_EXT_LIBBIN not set for ThirdParty"
- echo " Check your OpenFOAM environment and installation"
- exit 1
-}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
exportCompiler true # Compiler info + flags for CMake/configure
@@ -54,7 +48,7 @@ echo Build MPI libraries if required
echo " $MPI_ARCH_PATH"
case "$WM_MPLIB" in
(OPENMPI | MPICH)
- ./make$WM_MPLIB -test "$MPI_ARCH_PATH" || ./make$WM_MPLIB
+ ./make"$WM_MPLIB" -test "$MPI_ARCH_PATH" || ./make"$WM_MPLIB"
;;
esac
@@ -103,7 +97,7 @@ echo
echo ========================================
if [ -n "$CGAL_ARCH_PATH" ]
then
- echo "CGAL/boost"
+ echo "cgal/boost"
./makeCGAL -test "$CGAL_ARCH_PATH" "$BOOST_ARCH_PATH" || \
./makeCGAL || warnBuildIssues CGAL
else
diff --git a/etc/testThirdPartyFunctions b/etc/testThirdPartyFunctions
index 4e9cb5f..d0c8265 100755
--- a/etc/testThirdPartyFunctions
+++ b/etc/testThirdPartyFunctions
@@ -3,12 +3,13 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
-# \\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
+# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
+# Copyright (C) 2019 OpenCFD Ltd.
+#------------------------------------------------------------------------------
# License
-# This file is part of OpenFOAM, licensed under GNU General Public License
-# .
+# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# testThirdPartyFunctions
diff --git a/etc/tools/ParaViewFunctions b/etc/tools/ParaViewFunctions
index f7ce194..f5bfae3 100644
--- a/etc/tools/ParaViewFunctions
+++ b/etc/tools/ParaViewFunctions
@@ -267,7 +267,7 @@ addMesaSupport()
return
fi
- if [ -d "$MESA_INCLUDE" -a -f "$MESA_LIBRARY" ]
+ if [ -d "$MESA_INCLUDE" ] && [ -f "$MESA_LIBRARY" ]
then
addCMakeVariable "VTK_OPENGL_HAS_OSMESA=ON"
addCMakeVariable "OSMESA_INCLUDE_DIR=$MESA_INCLUDE"
@@ -479,7 +479,7 @@ INFO
# Non-system installation of QT?
case "$qtLib" in (/usr/lib | /usr/lib64) unset qtLib ;; esac
- if [ "${qmake%/*}" != /usr/bin -a -d "$qtLib" ]
+ if [ "${qmake%/*}" != /usr/bin ] && [ -d "$qtLib" ]
then
/bin/cat<.
+# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# File
# etc/tools/QtFunction
@@ -35,7 +35,7 @@ createQtConf()
{
local confFile="$QT_ARCH_PATH/bin/qt.conf"
- if [ -n "$QT_ARCH_PATH" -a -d "$QT_ARCH_PATH/bin" ]
+ if [ -n "$QT_ARCH_PATH" ] && [ -d "$QT_ARCH_PATH/bin" ]
then
/bin/cat << QT_CONF > $confFile
[Paths]
diff --git a/etc/tools/ThirdPartyFunctions b/etc/tools/ThirdPartyFunctions
index 70634e9..24b0090 100644
--- a/etc/tools/ThirdPartyFunctions
+++ b/etc/tools/ThirdPartyFunctions
@@ -326,6 +326,20 @@ requireWMakeToolchain()
}
+# Require FOAM_EXT_LIBBIN for some compilations
+requireExtLibBin()
+{
+ [ -n "$FOAM_EXT_LIBBIN" ] || {
+ exec 1>&2
+ echo
+ echo "Error: \$FOAM_EXT_LIBBIN not set for '${0##*/}"
+ echo " Check your OpenFOAM environment and installation"
+ echo
+ exit 1
+ }
+}
+
+
# grep for package http or ftp entries in BUILD.md
# Should be of the form "[link xx]: http://..."
showDownloadHint()
@@ -660,7 +674,7 @@ pkgconfigNewPrefix()
[ -d "$dir/$libdir" ] || continue
for i in $dir/$libdir/*.pc
do
- if [ -f "$i" -a ! -L "$i" ]
+ if [ -f "$i" ] && [ ! -L "$i" ]
then
nfiles="x$nfiles"
sed -i~ -e 's@^\(prefix=\).*$@\1'"$dir@" $i
@@ -708,7 +722,7 @@ pkgconfigAdjust()
[ -d "$dir/$libdir" ] || continue
for i in $dir/$libdir/*.pc
do
- if [ -f "$i" -a ! -L "$i" ]
+ if [ -f "$i" ] && [ ! -L "$i" ]
then
nfiles="x$nfiles"
sed -i~ \
diff --git a/makeAdios2 b/makeAdios2
index 7b19844..dd0da7e 100755
--- a/makeAdios2
+++ b/makeAdios2
@@ -26,8 +26,9 @@
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
- dir="${2%/}" # <- FFTW_ARCH_PATH
- if [ -d "$dir/include" -a -r "$dir/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
+ dir="${2%/}" # <- *_ARCH_PATH
+ if [ -d "$dir/include" ] \
+ && [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
then
echo " adios2 include: $dir/include"
echo " adios2 library: $dir/lib$WM_COMPILER_LIB_ARCH"
@@ -59,6 +60,7 @@ usage() {
usage: ${0##*/} [OPTION] [adios-VERSION]
options:
+ -force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-cmake PATH With cmake from the given path
-help
@@ -73,6 +75,8 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler minimal # Minimal compiler info for CMake/configure
+unset optForce
+
# Parse options
while [ "$#" -gt 0 ]
do
@@ -80,6 +84,7 @@ do
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
+ -force) optForce=true ;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
@@ -128,8 +133,9 @@ echo
# Needs future adjustment
# - for mpi-specific library locations
-if [ -f $ADIOS2_ARCH_PATH/include/adios2.h \
- -a -r $ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO ]
+if [ -z "$optForce" ] \
+&& [ -f "$ADIOS2_ARCH_PATH/include/adios2.h" ] \
+&& [ -r "$ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
then
echo " ADIOS2 header in $ADIOS2_ARCH_PATH/include"
echo " ADIOS2 libs in $ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH"
diff --git a/makeCCMIO b/makeCCMIO
index 077b041..6068539 100755
--- a/makeCCMIO
+++ b/makeCCMIO
@@ -21,9 +21,6 @@
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
-# Dynamic library ending (default is .so)
-[ "$(uname -s)" = Darwin ] && EXT_SO=.dylib || EXT_SO=.so
-
# Run from third-party directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
@@ -31,11 +28,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo " Check your OpenFOAM environment and installation"
exit 1
}
-[ -n "$FOAM_EXT_LIBBIN" ] || {
- echo "Error (${0##*/}) : \$FOAM_EXT_LIBBIN not set"
- echo " Check your OpenFOAM environment and installation"
- exit 1
-}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
@@ -97,6 +89,7 @@ do
done
requireWMakeToolchain
+requireExtLibBin
#------------------------------------------------------------------------------
#
diff --git a/makeCmake b/makeCmake
index b35fdc8..a998eaf 100755
--- a/makeCmake
+++ b/makeCmake
@@ -45,6 +45,7 @@ usage() {
usage: ${0##*/} [OPTION] cmake-VERSION
options:
+ -force Force compilation, even if binary already exists
-gcc Force use of gcc/g++
-link Create additional symlink as 'cmake-system'
-help
@@ -59,7 +60,8 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
-unset optLink
+unset optForce optLink
+
# Parse options
while [ "$#" -gt 0 ]
do
@@ -67,10 +69,9 @@ do
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
+ -force) optForce=true ;;
+ -link) optLink=true ;;
- -link)
- optLink=true
- ;;
cmake-[0-9]*)
cmakePACKAGE="${1%%/}"
;;
@@ -97,7 +98,9 @@ fi
CMAKE_SOURCE_DIR=$sourceBASE/$cmakePACKAGE
CMAKE_ARCH_PATH=$installBASE/$cmakePACKAGE
-if [ -d "$CMAKE_ARCH_PATH" -a -r "$CMAKE_ARCH_PATH/bin/cmake" ]
+if [ -z "$optForce" ] \
+&& [ -d "$CMAKE_ARCH_PATH" ] \
+&& [ -r "$CMAKE_ARCH_PATH/bin/cmake" ]
then
echo "Already built: $cmakePACKAGE"
else
@@ -124,7 +127,7 @@ else
}
fi
-if [ "$optLink" = true -a -x "$CMAKE_ARCH_PATH/bin/cmake" ]
+if [ "$optLink" = true ] && [ -x "$CMAKE_ARCH_PATH/bin/cmake" ]
then
(
cd "${CMAKE_ARCH_PATH%/*}" || exit
@@ -135,7 +138,7 @@ then
then
exit 2
fi
- ln -svf $cmakePACKAGE cmake-system
+ ln -svf "$cmakePACKAGE" cmake-system
)
fi
diff --git a/makeFFTW b/makeFFTW
index acd2afe..b1ff70b 100755
--- a/makeFFTW
+++ b/makeFFTW
@@ -27,8 +27,9 @@
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
- dir="${2%/}" # <- FFTW_ARCH_PATH
- if [ -d "$dir/include" -a -r "$dir/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ]
+ dir="${2%/}" # <- *_ARCH_PATH
+ if [ -d "$dir/include" ] \
+ && [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ]
then
echo " fftw include: $dir/include"
echo " fftw library: $dir/lib$WM_COMPILER_LIB_ARCH"
@@ -61,6 +62,7 @@ usage() {
usage: ${0##*/} [OPTION] [fftw-VERSION] [-- configure-options]
options:
+ -force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-help
@@ -74,6 +76,8 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
+unset optForce
+
# Parse options
while [ "$#" -gt 0 ]
do
@@ -82,6 +86,7 @@ do
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
+ -force) optForce=true ;;
fftw-[0-9]* | fftw_[0-9]* | fftw-system )
fftwPACKAGE="${1%%/}"
@@ -121,7 +126,8 @@ fi
FFTW_SOURCE_DIR=$sourceBASE/$fftwPACKAGE
FFTW_ARCH_PATH=$installBASE/$fftwPACKAGE
-if [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ]
+if [ -z "$optForce" ] \
+&& [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ]
then
echo "Already has FFTW shared library"
else
diff --git a/makeHYPRE b/makeHYPRE
index 9667b9c..ded8b32 100755
--- a/makeHYPRE
+++ b/makeHYPRE
@@ -43,6 +43,7 @@ usage() {
usage: ${0##*/} [OPTION] [lib|libso] [HYPRE-VERSION] [-- configure-options]
options:
+ -force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-help
@@ -56,6 +57,8 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
+unset optForce
+
# Parse options
while [ "$#" -gt 0 ]
do
@@ -63,6 +66,7 @@ do
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
+ -force) optForce=true ;;
lib|libso)
targetType="$1"
diff --git a/makeKAHIP b/makeKAHIP
index f29f8b6..7ad1550 100755
--- a/makeKAHIP
+++ b/makeKAHIP
@@ -27,7 +27,7 @@
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
- dir="${2%/}" # <- KAHIP_ARCH_PATH
+ dir="${2%/}" # <- *_ARCH_PATH
if [ -d "$dir/include" ]
then
for lib in \
@@ -56,11 +56,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo " Check your OpenFOAM environment and installation"
exit 1
}
-[ -n "$FOAM_EXT_LIBBIN" ] || {
- echo "Error (${0##*/}) : \$FOAM_EXT_LIBBIN not set"
- echo " Check your OpenFOAM environment and installation"
- exit 1
-}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
_foamConfig kahip
@@ -78,6 +73,7 @@ usage()
Usage: ${0##*/} [OPTION] [lib|libso] [kahip-VERSION]
options:
-gcc Force use of gcc/g++
+ -force Force build attempt (mingw)
-cmake PATH With cmake from the given path
-help
@@ -91,6 +87,8 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler minimal # Minimal compiler info for CMake/configure
+unset optForce
+
# Parse options
while [ "$#" -gt 0 ]
do
@@ -98,6 +96,7 @@ do
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
+ -force) optForce=true ;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
@@ -133,7 +132,21 @@ then
exit 0
fi
+# Known build issues for mingw (uses some non-portable headers)
+case "$WM_COMPILER" in
+(Mingw*)
+ if [ "$optForce" = true ]
+ then
+ echo "Warning: kahip - known compilation issues with $WM_COMPILER"
+ else
+ echo "Skipping kahip - known compilation issues with $WM_COMPILER"
+ exit 0
+ fi
+ ;;
+esac
+
requireWMakeToolchain
+requireExtLibBin
#------------------------------------------------------------------------------
#
diff --git a/makeMETIS b/makeMETIS
index b5840ba..2d58c12 100755
--- a/makeMETIS
+++ b/makeMETIS
@@ -27,7 +27,7 @@
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
- dir="${2%/}" # <- METIS_ARCH_PATH
+ dir="${2%/}" # <- *_ARCH_PATH
if [ -d "$dir/include" ]
then
for lib in \
@@ -56,11 +56,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo " Check your OpenFOAM environment and installation"
exit 1
}
-[ -n "$FOAM_EXT_LIBBIN" ] || {
- echo "Error (${0##*/}) : \$FOAM_EXT_LIBBIN not set"
- echo " Check your OpenFOAM environment and installation"
- exit 1
-}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
_foamConfig metis
@@ -125,6 +120,8 @@ then
exit 0
fi
+requireExtLibBin
+
#------------------------------------------------------------------------------
#
# Build METIS
diff --git a/makeMGridGen b/makeMGridGen
index f97730d..44d7576 100755
--- a/makeMGridGen
+++ b/makeMGridGen
@@ -44,6 +44,7 @@ usage() {
usage: ${0##*/} [OPTION] [mgridgen-VERSION]
options:
+ -force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-help
@@ -57,6 +58,8 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
+unset optForce
+
# Parse options
while [ "$#" -gt 0 ]
do
@@ -64,6 +67,7 @@ do
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
+ -force) optForce=true ;;
mgridgen-[0-9]* | MGridGen-[0-9]* | parmgridgen-[0-9]* | ParMGridGen-[0-9]*)
mgridgenPACKAGE="${1%%/}"
@@ -133,8 +137,9 @@ install()
# Needs future adjustment
# - for shared library
# - for mpi-specific library locations
-if [ -f $MGRIDGEN_ARCH_PATH/include/mgridgen.h \
- -a -r $MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmgrid.a ]
+if [ -z "$optForce" ] \
+&& [ -f "$MGRIDGEN_ARCH_PATH/include/mgridgen.h" \
+&& [ -r "$MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmgrid.a" ]
then
echo " MGridGen header in $MGRIDGEN_ARCH_PATH/include"
echo " MGridGen libs in $MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" # static
diff --git a/makeMPICH b/makeMPICH
index f096607..0ad7e9c 100755
--- a/makeMPICH
+++ b/makeMPICH
@@ -6,11 +6,10 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
-# Copyright (C) 2017-2019 OpenCFD Ltd.
+# Copyright (C) 2017-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
-# This file is part of OpenFOAM, licensed under GNU General Public License
-# .
+# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeMPICH
@@ -28,7 +27,7 @@
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
- dir="${2%/}" # <- MPI_ARCH_PATH
+ dir="${2%/}" # <- *_ARCH_PATH
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Have mpich shared library (${dir##*/})"
@@ -73,6 +72,7 @@ usage() {
usage: ${0##*/} [OPTION] [mpich-VERSION] [-- configure-options]
options:
+ -force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-help
@@ -86,6 +86,8 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
+unset optForce
+
# Parse options
while [ "$#" -gt 0 ]
do
@@ -94,6 +96,7 @@ do
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
+ -force) optForce=true ;;
mpich*)
mpiPACKAGE="${1%%/}"
@@ -129,10 +132,12 @@ fi
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
-if [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
+if [ -z "$optForce" ] \
+&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Already has shared library"
-elif [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
+elif [ -z "$optForce" ] \
+ && [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo "Already has static library"
else
diff --git a/makeMVAPICH b/makeMVAPICH
index 9a73709..c641cd6 100755
--- a/makeMVAPICH
+++ b/makeMVAPICH
@@ -6,11 +6,10 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
-# Copyright (C) 2019 OpenCFD Ltd.
+# Copyright (C) 2019-2020 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
-# This file is part of OpenFOAM, licensed under GNU General Public License
-# .
+# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeMVAPICH2
@@ -28,7 +27,7 @@
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
- dir="${2%/}" # <- MPI_ARCH_PATH
+ dir="${2%/}" # <- *_ARCH_PATH
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Have mpich shared library (${dir##*/})"
@@ -73,6 +72,7 @@ usage() {
usage: ${0##*/} [OPTION] [mvapich2-VERSION] [-- configure-options]
options:
+ -force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-help
@@ -90,6 +90,8 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
+unset optForce
+
# Parse options
while [ "$#" -gt 0 ]
do
@@ -98,6 +100,7 @@ do
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
+ -force) optForce=true ;;
mvapich*)
mpiPACKAGE="${1%%/}"
@@ -133,10 +136,12 @@ fi
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
-if [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
+if [ -z "$optForce" ] \
+&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Already has shared library"
-elif [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
+elif [ -z "$optForce" ] \
+ && [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo "Already has static library"
else
diff --git a/makeMesa b/makeMesa
index 7332b93..56d5703 100755
--- a/makeMesa
+++ b/makeMesa
@@ -9,8 +9,7 @@
# Copyright (C) 2016-2019 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
-# This file is part of OpenFOAM, licensed under GNU General Public License
-# .
+# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# makeMesa
diff --git a/makeOPENMPI b/makeOPENMPI
index 7172c9a..7b82119 100755
--- a/makeOPENMPI
+++ b/makeOPENMPI
@@ -27,7 +27,7 @@
if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
- dir="${2%/}" # <- MPI_ARCH_PATH
+ dir="${2%/}" # <- *_ARCH_PATH
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo " Have openmpi shared library (${dir##*/})"
@@ -72,6 +72,7 @@ usage() {
usage: ${0##*/} [OPTION] [openmpi-VERSION] [-- configure-options]
options:
+ -force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-memcheck Configure with --enable-memcheck (requires valgrind.h)
-threaded Configure with --enable-mpi-thread-multiple
@@ -88,7 +89,7 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
-unset optMemchecker optThreaded
+unset optForce optMemchecker optThreaded
# Parse options
while [ "$#" -gt 0 ]
@@ -98,6 +99,7 @@ do
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
+ -force) optForce=true ;;
-memcheck*) optMemchecker=true ;;
-thread*) optThreaded=enable ;;
-no-thread*) optThreaded=disable ;;
@@ -136,10 +138,12 @@ fi
MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
-if [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
+if [ -z "$optForce" ] \
+&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Already has shared library: $MPI_ARCH_PATH"
-elif [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
+elif [ -z "$optForce" ] \
+ && [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo "Already has static library: $MPI_ARCH_PATH"
else
diff --git a/makePETSC b/makePETSC
index c003ade..80e97b2 100755
--- a/makePETSC
+++ b/makePETSC
@@ -49,6 +49,7 @@ usage() {
usage: ${0##*/} [OPTION] [lib|libso] [HYPRE-VERSION] [PETSC-VERSION] [-- configure-options]
options:
+ -force Force compilation, even if include/library already exists
-gcc Force use of gcc/g++
-inplace Build/install inplace (expert option)
-no-hypre Disable automatic hypre detection
@@ -69,7 +70,7 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
-unset optInplace
+unset optForce optInplace
# Parse options
while [ "$#" -gt 0 ]
@@ -78,10 +79,8 @@ do
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-
- -inplace)
- optInplace=true
- ;;
+ -force) optForce=true ;;
+ -inplace) optInplace=true ;;
lib|libso)
targetType="$1"
diff --git a/makeQt b/makeQt
index 711fde8..ef2c6de 100755
--- a/makeQt
+++ b/makeQt
@@ -38,6 +38,7 @@ usage() {
usage: ${0##*/} [OPTION] [qt-VERSION] [-- configure-options]
options:
+ -force Force compilation, even if it already exists
-gcc Force use of gcc/g++
-help
@@ -50,6 +51,8 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler true # Compiler info + flags for CMake/configure
+unset optForce
+
# Parse options
while [ "$#" -gt 0 ]
do
@@ -58,6 +61,7 @@ do
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
+ -force) optForce=true ;;
-qt-[0-9]* | [0-9]* | qt-*)
# -qt-VERSION, VERSION, qt-VERSION, qt-everywhere-opensource-src-VERSION
@@ -95,7 +99,10 @@ echo
echo ========================================
echo "Build Qt $qtPACKAGE"
echo
-if [ -d "$QT_ARCH_PATH" -a -r "$QT_ARCH_PATH/bin/qmake" ]
+
+if [ -z "$optForce" ] \
+&& [ -d "$QT_ARCH_PATH" ] \
+&& [ -r "$QT_ARCH_PATH/bin/qmake" ]
then
echo "Already built: Qt-$qtVERSION"
else
diff --git a/makeSCOTCH b/makeSCOTCH
index cc6d43f..618865f 100755
--- a/makeSCOTCH
+++ b/makeSCOTCH
@@ -19,8 +19,6 @@
#
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
-#------------------------------------------------------------------------------
-
#------------------------------------------------------------------------------
# Run from third-party directory only
cd "${0%/*}" || exit
@@ -29,11 +27,6 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo " Check your OpenFOAM environment and installation"
exit 1
}
-[ -n "$FOAM_EXT_LIBBIN" ] || {
- echo "Error (${0##*/}) : \$FOAM_EXT_LIBBIN not set"
- echo " Check your OpenFOAM environment and installation"
- exit 1
-}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
_foamConfig scotch # Get SCOTCH_ARCH_PATH, SCOTCH_VERSION
@@ -53,6 +46,7 @@ usage()
Usage: ${0##*/} [OPTION] [libso] [scotch-VERSION]
options:
-force Force compilation, even if include/library already exists
+ Also force build attempt of pt-scotch (mingw)
-gcc Force use of gcc/g++
-bin Create scotch binaries as well (experimental)
-no-bin Suppress creation of scotch binaries (default)
@@ -69,6 +63,7 @@ USAGE
#------------------------------------------------------------------------------
unset optBinaries optForce
+
# Parse options
while [ "$#" -gt 0 ]
do
@@ -76,11 +71,11 @@ do
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
+ -force) optForce=true ;;
- -force) optForce=true ;;
- -bin) optBinaries=true ;;
- -no-bin) unset optBinaries ;;
- -no-mpi) unset withMPI ;;
+ -bin) optBinaries=true ;;
+ -no-bin) unset optBinaries ;;
+ -no-mpi) unset withMPI ;;
scotch-[0-9]* | scotch-git | scotch_* )
scotchPACKAGE="${1%%/}"
@@ -106,6 +101,8 @@ then
exit 0
fi
+requireExtLibBin
+
#------------------------------------------------------------------------------
# Needs generalizing, but works fairly well
@@ -230,6 +227,19 @@ then
exit 0
fi
+# Known build issues for mingw (MS-MPI source code annotations)
+case "$WM_COMPILER" in
+(Mingw*)
+ if [ -z "$optForce" ]
+ then
+ echo "Skipping pt-scotch - known compilation issues with $WM_COMPILER"
+ exit 0
+ else
+ echo "Warning: pt-scotch - known compilation issues with $WM_COMPILER"
+ fi
+ ;;
+esac
+
# Build ptscotch if normal scotch was built (has include and library)
# (reuse prefix/include/lib dirs set above)