11 Commits
v2006 ... v2012

Author SHA1 Message Date
ddfdec4cd9 CONFIG: update adios and petsc version information 2020-12-14 15:19:35 +01:00
834efe6dda COMP: handle forced use of gcc/g++ for wmake components
- does not change WM_OPTIONS or output directories, so that the target
  directories are correct.
2020-11-16 08:29:39 +01:00
69cff3b3d3 CONFIG: add detection of newer libadios2 libs
- prevent unneeded recompilation

DOC: add link for new scotch package
2020-11-04 20:45:06 +01:00
c3aa2a4bfe CONFIG: remove redundant petsc configure options, add '-debug' option 2020-09-11 13:35:27 +02:00
9a3938551a ENH: build petsc with debugging off (fixes #58)
- also permit petsc to determine its own hypre version (#58)
2020-09-07 15:56:42 +02:00
28f482b836 CONFIG: skip compilation of ADIOS2, METIS with mingw (#57)
- adios is out of scope for cross-compilation

- metis does not seem to support cross-compilation.
  Use scotch instead.
2020-08-12 16:45:17 +02:00
53a1736aad BUG: boost user-config.jam written into incorrect directory
- mistake introduced by 11e3723f10
2020-08-12 16:41:54 +02:00
f197c721c8 ENH: mingw cross-compile for FFTW (issue #57) 2020-08-11 16:21:26 +02:00
11e3723f10 ENH: improve test for existing libraries (fixes #56)
- check lib as well as lib64

- support -force option in a few more places
2020-08-10 15:10:31 +02:00
9a8a4852bc CONFIG: remove libz dependency for scotch (issue #55)
- reduces ThirdParty inter-dependency.
  Only useful for reading in graph files, which are not used
  internally by OpenFOAM.

- Was already removed for Mingw compilation.
2020-08-07 13:49:58 +02:00
507c01e485 CONFIG: add mpicc/mpicxx handling for Fujitsu MPI (issue #54)
- uses mpifcc/mpiFCC for mpicc/mpicxx, respectively
2020-08-07 13:49:45 +02:00
17 changed files with 366 additions and 186 deletions

View File

@ -524,12 +524,14 @@ easier to use `grep` and find the relevant pages and links.
<!-- parallel -->
[page adios]: https://csmd.ornl.gov/software/adios2
[repo adios]: https://github.com/ornladios/ADIOS2
[link adios]: https://github.com/ornladios/ADIOS2/archive/v2.4.0.tar.gz
[link adios]: https://github.com/ornladios/ADIOS2/archive/v2.6.0.tar.gz
[page zfp]: http://computation.llnl.gov/projects/floating-point-compression/zfp-versions
[page scotch]: https://www.labri.fr/perso/pelegrin/scotch/
[repo scotch]: https://gitlab.inria.fr/scotch/scotch
[link scotch61]: https://gforge.inria.fr/frs/download.php/file/38352/scotch_6.1.0.tar.gz
[link scotch60_10]: https://gforge.inria.fr/frs/download.php/file/38350/scotch_6.0.10.tar.gz
[link scotch]: https://gforge.inria.fr/frs/download.php/file/38187/scotch_6.0.9.tar.gz
[older scotch]: https://gforge.inria.fr/frs/download.php/file/38114/scotch_6.0.8.tar.gz
[oldest scotch]: https://gforge.inria.fr/frs/download.php/file/37622/scotch_6.0.6.tar.gz
@ -565,7 +567,7 @@ easier to use `grep` and find the relevant pages and links.
[link FFTW]: http://www.fftw.org/fftw-3.3.7.tar.gz
[page petsc]: https://www.mcs.anl.gov/petsc/
[link petsc]: http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.13.2.tar.gz
[link petsc]: https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.14.2.tar.gz
[page hypre]: https://computing.llnl.gov/projects/hypre-scalable-linear-solvers-multigrid-methods/
[repo hypre]: https://github.com/hypre-space/hypre/

View File

@ -1,5 +1,18 @@
Third-party software versions for recent OpenFOAM versions
OpenFOAM-2012
---------------
ADIOS-2.6.0 *update*
CGAL-4.12.2
ParaView-5.6.3
boost_1_66_0
fftw-3.3.7
openmpi-4.0.3
scotch_6.0.9
kahip-2.12
OpenFOAM-2006
---------------

View File

@ -29,7 +29,7 @@ CCS ?= $(CC)
CCP ?= mpicc
CCD = $(CCP)
CFLAGS = $(WM_CFLAGS) -fPIC -O3 \
-DCOMMON_FILE_COMPRESS_GZ \
-UCOMMON_FILE_COMPRESS \
-DCOMMON_RANDOM_FIXED_SEED \
-DSCOTCH_DETERMINISTIC \
-DSCOTCH_RENAME \
@ -41,7 +41,7 @@ CFLAGS += -DINTSIZE64
endif
CLIBFLAGS =
LDFLAGS = $(WM_LDFLAGS) -lz -lm
LDFLAGS = $(WM_LDFLAGS) -lm
MAKE = make
CP = cp

View File

@ -29,7 +29,7 @@ CCS ?= $(CC)
CCP ?= mpicc
CCD = $(CCP)
CFLAGS = $(WM_CFLAGS) -fPIC -O3 \
-DCOMMON_FILE_COMPRESS_GZ \
-UCOMMON_FILE_COMPRESS \
-DCOMMON_RANDOM_FIXED_SEED \
-DSCOTCH_DETERMINISTIC \
-DSCOTCH_RENAME \
@ -41,7 +41,7 @@ CFLAGS += -DINTSIZE64
endif
CLIBFLAGS = -shared
LDFLAGS = -Xlinker --no-as-needed $(WM_LDFLAGS) -lz -lm -lrt
LDFLAGS = -Xlinker --no-as-needed $(WM_LDFLAGS) -lm -lrt
MAKE = make
CP = cp

View File

@ -211,6 +211,16 @@ useGcc()
export CXX=g++
}
# Force use of system gcc/g++ (wmake compilation) without changing the
# WM_OPTIONS or output directories
useGccWmake()
{
export WM_COMPILER=Gcc
export WM_COMPILER_TYPE=system
}
# Scan arguments for a '-gcc' option, forcing gcc/g++ when found
useGccFlag()
{
@ -258,13 +268,20 @@ whichCXX()
}
# Return <mpicc> by default or <mpiicc> if possible for INTELMPI.
# Return
# <mpicc> by default
# <mpifcc> for FJMPI (if possible)
# <mpiicc> for INTELMPI (if possible)
#
# Cray doesn't have <mpicc>, but its <cc> manages mpi paths directly.
# NOTE: could further refine based on "wmake -show-c", but not yet needed
whichMpicc()
{
local comp="$(command -v mpicc)"
case "$WM_MPLIB" in
(FJMPI)
comp="$(command -v mpifcc)" # Fujitsu <mpifcc> available?
;;
(INTELMPI)
comp="$(command -v mpiicc)" # Intel <mpiicc> available?
;;
@ -276,13 +293,20 @@ whichMpicc()
}
# Return <mpicxx> by default or <mpiicpc> if possible for INTELMPI.
# Return
# <mpicxx> by default
# <mpiFCC> for FJMPI (if possible)
# <mpiicpc> for INTELMPI (if possible)
#
# Cray doesn't have <mpicxx>, but its <CC> manages mpi paths directly.
# NOTE: could further refine based on "wmake -show-cxx", but not yet needed
whichMpicxx()
{
local comp="$(command -v mpicxx)"
case "$WM_MPLIB" in
(FJMPI)
comp="$(command -v mpiFCC)" # Fujitsu <mpiFCC> available?
;;
(INTELMPI)
comp="$(command -v mpiicpc)" # Intel <mpiicpc> available?
;;

View File

@ -27,15 +27,26 @@ if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
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"
exit 0
else
exit 2
fi
[ -d "$dir/include" ] || exit 2
package="adios2"
libName="libadios2"
libName2="libadios2_cxx11_mpi"
for lib in \
"$dir/lib/$libName$EXT_SO" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
"$dir/lib/$libName2$EXT_SO" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName2$EXT_SO" \
;
do
if [ -r "$lib" ]
then
echo " $package include: $dir/include"
echo " $package library: ${lib%/*}"
exit 0
fi
done
exit 2
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
@ -115,6 +126,19 @@ then
exit 0
fi
# Known build issues for mingw (various things)
case "$WM_COMPILER" in
(Mingw*)
if [ "$optForce" = true ]
then
echo "Warning: adios2 - known compilation issues with $WM_COMPILER"
else
echo "Skipping adios2 - known compilation issues with $WM_COMPILER"
exit 0
fi
;;
esac
#------------------------------------------------------------------------------
#
# Build ADIOS
@ -135,10 +159,12 @@ echo
# - for mpi-specific library locations
if [ -z "$optForce" ] \
&& [ -f "$ADIOS2_ARCH_PATH/include/adios2.h" ] \
&& [ -r "$ADIOS2_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libadios2$EXT_SO" ]
&& {
[ -r "$ADIOS2_ARCH_PATH/lib/libadios2$EXT_SO" ] \
|| [ -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"
echo " ADIOS2 already built : $ADIOS2_ARCH_PATH"
else
# CMake options often lag the configure ones
echo "Starting build: $adiosPACKAGE (using cmake)"

View File

@ -73,7 +73,7 @@ do
case "$1" in
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-gcc) useGccWmake ;;
lib|libso)
targetType="$1"

View File

@ -35,7 +35,10 @@ if [ "$1" = "-test" ]
then
[ "$#" -eq 3 ] || { echo "${0##*/} -test : needs 2 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -d "$dir/include" ] && [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libCGAL$EXT_SO" ]
[ -d "$dir/include" ] || exit 2
# 2020-08-10: Needs reworking for header-only installations!
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libCGAL$EXT_SO" ]
then
echo " CGAL include: $dir/include"
echo " CGAL library: $dir/lib$WM_COMPILER_LIB_ARCH"
@ -115,7 +118,7 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
unset optHeadersOnly optToolset
unset optForce optHeadersOnly optToolset
# Parse options
while [ "$#" -gt 0 ]
@ -124,6 +127,7 @@ do
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
-cmake)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
@ -243,16 +247,17 @@ then
fi
# Use lib/ when lib64/ does not exist
[ ! -d "$boostLib" -a -d "$libdir" ] && boostLib="$libdir"
[ -d "$libdir" -a ! -d "$boostLib" ] && boostLib="$libdir"
elif [ -f "$boostInc/boost/version.hpp" ]
elif [ -z "$optForce" ] \
&& [ -f "$boostInc/boost/version.hpp" ]
then
echo "Using $boostPACKAGE"
libdir="$BOOST_ARCH_PATH/lib"
# Use lib when lib64 does not exist
[ ! -d "$boostLib" -a -d "$libdir" ] && boostLib="$libdir"
[ -d "$libdir" -a ! -d "$boostLib" ] && boostLib="$libdir"
else
echo "Starting build: $boostPACKAGE"
@ -260,14 +265,14 @@ else
# Absolute path for --libdir
(
# Configuration options:
unset buildOpt
# Write user-config.jam into source directory
cd "$BOOST_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
rm -rf $BOOST_ARCH_PATH
# Configuration options:
unset buildOpt
# Compiler-specific adjustments
case "$WM_COMPILER" in
(Arm*)
# Toolset for bootstrap
@ -306,6 +311,11 @@ else
;;
esac
# End of configuration options
# ----------------------------
rm -rf "$BOOST_ARCH_PATH"
./bootstrap.sh \
--prefix="$BOOST_ARCH_PATH" \
--libdir="$boostLib" \
@ -481,13 +491,13 @@ cgalIsCurrent()
}
if cgalIsCurrent
if [ -z "$optForce" ] \
&& cgalIsCurrent
then
echo " ${CGAL_ARCH_PATH##*/} build appears to be up-to-date - skipping"
echo
exit 0
fi
else
(
# Remove any existing build folder and recreate
if [ -d "$CGAL_BUILD_DIR" ]
@ -604,6 +614,7 @@ CMAKE_OPTIONS
unset cmakeDefs
# Compiler-specific adjustments
case "$WM_COMPILER" in
(Mingw*)
cmakeDefs="$cmakeDefs -DCMAKE_SYSTEM_NAME=Windows"
@ -658,5 +669,6 @@ CMAKE_OPTIONS
echo "Done CGAL"
)
fi
#------------------------------------------------------------------------------

View File

@ -28,15 +28,23 @@ if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
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"
exit 0
else
exit 2
fi
[ -d "$dir/include" ] || exit 2
package="fftw"
libName="libfftw3"
for lib in \
"$dir/lib/$libName$EXT_SO" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
;
do
if [ -r "$lib" ]
then
echo " $package include: $dir/include"
echo " $package library: ${lib%/*}"
exit 0
fi
done
exit 2
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
@ -52,7 +60,7 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
# FFTW version from OpenFOAM etc/config.sh file:
_foamConfig FFTW
fftwPACKAGE=${fftw_version:-fftw-system}
fftwPACKAGE="${fftw_version:-fftw-system}"
#------------------------------------------------------------------------------
usage() {
@ -123,13 +131,17 @@ fi
# FFTW_SOURCE_DIR : location of the original sources
# FFTW_ARCH_PATH : installation directory
FFTW_SOURCE_DIR=$sourceBASE/$fftwPACKAGE
FFTW_ARCH_PATH=$installBASE/$fftwPACKAGE
FFTW_SOURCE_DIR="$sourceBASE/$fftwPACKAGE"
FFTW_ARCH_PATH="$installBASE/$fftwPACKAGE"
if [ -z "$optForce" ] \
&& [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ]
&& {
[ -r "$FFTW_ARCH_PATH/lib/libfftw3$EXT_SO" ] \
|| [ -r "$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libfftw3$EXT_SO" ] \
|| [ -r "$FFTW_ARCH_PATH/bin/libfftw3-3$EXT_SO" ] # Windows
}
then
echo "Already has FFTW shared library"
echo "FFTW already built : $FFTW_ARCH_PATH"
else
echo "Starting build: FFTW ($fftwPACKAGE)"
echo
@ -138,6 +150,21 @@ else
# Configuration options:
unset configOpt
# Compiler-specific adjustments
case "$WM_COMPILER" in
(Mingw*)
# Cross-compiling
# See http://www.fftw.org/install/windows.html
configOpt="
--host=x86_64-w64-mingw32
--with-our-malloc
--enable-threads --with-combined-threads
--enable-sse2
--with-incoming-stack-boundary=2
"
;;
esac
# Additional configure options
if [ "$1" = "--" ]
then
@ -147,20 +174,20 @@ else
# End of configuration options
# ----------------------------
buildDIR=$buildBASE/$fftwPACKAGE
buildDIR="$buildBASE/$fftwPACKAGE"
cd "$FFTW_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
rm -rf $FFTW_ARCH_PATH
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
rm -rf "$FFTW_ARCH_PATH"
rm -rf "$buildDIR"
mkdir -p "$buildDIR"
cd "$buildDIR"
set -x
$FFTW_SOURCE_DIR/configure \
--prefix=$FFTW_ARCH_PATH \
--libdir=$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
"$FFTW_SOURCE_DIR"/configure \
--prefix="$FFTW_ARCH_PATH" \
--libdir="$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" \
--enable-shared --disable-static \
--disable-fortran \
$configOpt \
@ -168,7 +195,7 @@ else
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built $fftwPACKAGE" \
&& pkgconfigAdjust $FFTW_ARCH_PATH
&& pkgconfigAdjust "$FFTW_ARCH_PATH"
) || {
echo "Error building: FFTW"
exit 1

View File

@ -64,6 +64,7 @@ while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;

View File

@ -28,24 +28,25 @@ if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -d "$dir/include" ]
then
for lib in \
$FOAM_EXT_LIBBIN/libkahip$EXT_SO \
$dir/lib/libkahip.a \
$dir/lib/libkahip$EXT_SO \
$dir/lib$WM_COMPILER_LIB_ARCH/libkahip.a \
$dir/lib$WM_COMPILER_LIB_ARCH/libkahip$EXT_SO \
;
do
if [ -r "$lib" ]
then
echo " kahip include: $dir/include"
echo " kahip library: ${lib%/*}"
exit 0
fi
done
fi
[ -d "$dir/include" ] || exit 2
package="kahip"
libName="libkahip"
for lib in \
"$FOAM_EXT_LIBBIN/$libName$EXT_SO" \
"$dir/lib/$libName.a" \
"$dir/lib/$libName$EXT_SO" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName.a" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
;
do
if [ -r "$lib" ]
then
echo " $package include: $dir/include"
echo " $package library: ${lib%/*}"
exit 0
fi
done
exit 2
fi
#------------------------------------------------------------------------------
@ -95,7 +96,7 @@ do
case "$1" in
'') ;; # Ignore empty
-h | -help) usage ;;
-gcc) useGcc ;;
-gcc) useGccWmake ;;
-force) optForce=true ;;
-cmake)

View File

@ -28,24 +28,25 @@ if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -d "$dir/include" ]
then
for lib in \
$FOAM_EXT_LIBBIN/libmetis$EXT_SO \
$dir/lib/libmetis.a \
$dir/lib/libmetis$EXT_SO \
$dir/lib$WM_COMPILER_LIB_ARCH/libmetis.a \
$dir/lib$WM_COMPILER_LIB_ARCH/libmetis$EXT_SO \
;
do
if [ -r "$lib" ]
then
echo " metis include: $dir/include"
echo " metis library: ${lib%/*}"
exit 0
fi
done
fi
[ -d "$dir/include" ] || exit 2
package="metis"
libName="libmetis"
for lib in \
"$FOAM_EXT_LIBBIN/$libName$EXT_SO" \
"$dir/lib/$libName.a" \
"$dir/lib/$libName$EXT_SO" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName.a" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
;
do
if [ -r "$lib" ]
then
echo " $package include: $dir/include"
echo " $package library: ${lib%/*}"
exit 0
fi
done
exit 2
fi
#------------------------------------------------------------------------------
@ -120,6 +121,17 @@ then
exit 0
fi
# Known build issues for mingw (various things)
case "$WM_COMPILER" in
(Mingw*)
if :
then
echo "Skipping metis - known compilation issues with $WM_COMPILER"
exit 0
fi
;;
esac
requireExtLibBin
#------------------------------------------------------------------------------

View File

@ -138,12 +138,13 @@ install()
# - for shared library
# - for mpi-specific library locations
if [ -z "$optForce" ] \
&& [ -f "$MGRIDGEN_ARCH_PATH/include/mgridgen.h" \
&& [ -r "$MGRIDGEN_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmgrid.a" ]
&& [ -f "$MGRIDGEN_ARCH_PATH/include/mgridgen.h" ] \
&& {
[ -r "$MGRIDGEN_ARCH_PATH/lib/libmgrid.a" ] \
|| [ -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
echo
echo " MGridGen already built : $MGRIDGEN_ARCH_PATH"
else
(
cd "$MGRIDGEN_SOURCE_DIR" || exit

View File

@ -28,18 +28,24 @@ if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Have mpich shared library (${dir##*/})"
exit 0
elif [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo "Have mpich static library (${dir##*/})"
exit 0
else
echo "No mpich libraries found: ${dir:-not-specified}"
exit 2
fi
package="mpich"
libName="libmpi"
for lib in \
"$dir/lib/$libName.a" \
"$dir/lib/$libName$EXT_SO" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName.a" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
;
do
if [ -r "$lib" ]
then
echo "Have $package shared library (${dir##*/})"
exit 0
fi
done
echo "No $package libraries found: ${dir:-not-specified}"
exit 2
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
@ -133,13 +139,19 @@ MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
if [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
&& {
[ -r "$MPI_ARCH_PATH/lib/libmpi$EXT_SO" ] \
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
}
then
echo "Already has shared library"
echo "Already has shared library: $MPI_ARCH_PATH"
elif [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
&& {
[ -r "$MPI_ARCH_PATH/lib/libmpi.a" ] \
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
}
then
echo "Already has static library"
echo "Already has static library: $MPI_ARCH_PATH"
else
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
echo

View File

@ -28,18 +28,24 @@ if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo "Have mpich shared library (${dir##*/})"
exit 0
elif [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo "Have mpich static library (${dir##*/})"
exit 0
else
echo "No mpich libraries found: ${dir:-not-specified}"
exit 2
fi
package="mvapich"
libName="libmpi"
for lib in \
"$dir/lib/$libName.a" \
"$dir/lib/$libName$EXT_SO" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName.a" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
;
do
if [ -r "$lib" ]
then
echo "Have $package library (${dir##*/})"
exit 0
fi
done
echo "No $package libraries found: ${dir:-not-specified}"
exit 2
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
@ -137,13 +143,19 @@ MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
if [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
&& {
[ -r "$MPI_ARCH_PATH/lib/libmpi$EXT_SO" ] \
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
}
then
echo "Already has shared library"
echo "Already has shared library: $MPI_ARCH_PATH"
elif [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
&& {
[ -r "$MPI_ARCH_PATH/lib/libmpi.a" ] \
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
}
then
echo "Already has static library"
echo "Already has static library: $MPI_ARCH_PATH"
else
echo "Starting build: $WM_MPLIB ($mpiPACKAGE)"
echo

View File

@ -28,18 +28,24 @@ if [ "$1" = "-test" ]
then
[ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; }
dir="${2%/}" # <- *_ARCH_PATH
if [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
then
echo " Have openmpi shared library (${dir##*/})"
exit 0
elif [ -r "$dir/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
then
echo " Have openmpi static library (${dir##*/})"
exit 0
else
echo "No openmpi libraries found: ${dir:-not-specified}"
exit 2
fi
package="openmpi"
libName="libmpi"
for lib in \
"$dir/lib/$libName.a" \
"$dir/lib/$libName$EXT_SO" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName.a" \
"$dir/lib$WM_COMPILER_LIB_ARCH/$libName$EXT_SO" \
;
do
if [ -r "$lib" ]
then
echo "Have $package library (${dir##*/})"
exit 0
fi
done
echo "No $package libraries found: ${dir:-not-specified}"
exit 2
fi
#------------------------------------------------------------------------------
# Run from third-party directory only
@ -139,11 +145,17 @@ MPI_SOURCE_DIR=$sourceBASE/$mpiPACKAGE
MPI_ARCH_PATH=$installBASE/$mpiPACKAGE
if [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
&& {
[ -r "$MPI_ARCH_PATH/lib/libmpi$EXT_SO" ] \
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi$EXT_SO" ]
}
then
echo "Already has shared library: $MPI_ARCH_PATH"
elif [ -z "$optForce" ] \
&& [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
&& {
[ -r "$MPI_ARCH_PATH/lib/libmpi.a" ] \
|| [ -r "$MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmpi.a" ]
}
then
echo "Already has static library: $MPI_ARCH_PATH"
else

109
makePETSC
View File

@ -30,16 +30,13 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
_foamConfig hypre
_foamConfig petsc
hyprePACKAGE="${hypre_version:-hypre-none}"
petscPACKAGE="${petsc_version:-petsc-system}"
targetType=libso
# Should be possible to build with download, but seems to fail
# hypreURL="https://github.com/hypre-space/hypre/archive/v2.14.0.tar.gz"
unset hypreURL
unset hyprePACKAGE
unset HYPRE_ARCH_PATH # Avoid inconsistency
#------------------------------------------------------------------------------
usage() {
@ -52,7 +49,9 @@ 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
-debug Build with debugging enabled
-hypre=URL Specify hypre download location
-no-hypre Disable automatic hypre download/detection
-help
* build PETSC with
@ -70,35 +69,40 @@ USAGE
#------------------------------------------------------------------------------
exportCompiler # Compiler info for CMake/configure
unset optForce optInplace
unset optDebug optForce optInplace optHypre
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
'') ;; # Ignore empty
--) break;; # Extra configure options (leave on $@ for later detection)
-h | -help) usage ;;
-gcc) useGcc ;;
-force) optForce=true ;;
-inplace) optInplace=true ;;
-debug) optDebug=true ;;
lib|libso)
targetType="$1"
lib|libso) targetType="$1" ;;
-hypre=*)
optHypre="${1#*=}" # URL for download
unset hyprePACKAGE HYPRE_ARCH_PATH
;;
-no-hypre)
unset hyprePACKAGE hypreURL
unset HYPRE_ARCH_PATH
optHypre=false
unset hyprePACKAGE HYPRE_ARCH_PATH
;;
hypre-[0-9]* | hypre-git)
hyprePACKAGE="${1%%/}"
unset hypreURL
unset HYPRE_ARCH_PATH # Avoid inconsistency
unset optHypre
unset HYPRE_ARCH_PATH # Avoid inconsistency
;;
petsc-[0-9]* | petsc-git)
petscPACKAGE="${1%%/}"
unset PETSC_ARCH_PATH # Avoid inconsistency
unset PETSC_ARCH_PATH # Avoid inconsistency
;;
*)
die "unknown option/argument: '$1'"
@ -123,13 +127,11 @@ fi
#------------------------------------------------------------------------------
# Integrations
# No hypre
if _foamIsNone "$hyprePACKAGE"
# Clunky
if [ -z "$optHypre" ] && [ -n "$hyprePACKAGE" ] \
&& ! _foamIsNone "$hyprePACKAGE"
then
:
elif [ -n "$hyprePACKAGE" ]
then
# Clunky
echo "Using $hyprePACKAGE"
: "${HYPRE_ARCH_PATH:=$installBASE$WM_SIZE_OPTIONS/$hyprePACKAGE}"
fi
@ -170,26 +172,28 @@ else
fi
echo "Starting build: $petscPACKAGE ($targetType)"
if [ "$WM_PRECISION_OPTION" = SP ]
then
optHypre=false # No single-precision hypre
echo "No single-precision hypre"
fi
if [ -d "$PETSC_SOURCE_DIR/$archOpt/externalpackages" ]
then
echo "Removing old $archOpt/externalpackages"
rm -rf "$PETSC_SOURCE_DIR/$archOpt/externalpackages"
fi
echo
(
# Configuration options
configOpt="--with-cc=$(whichMpicc) --with-cxx=$(whichMpicxx)"
# Normally want hypre but this is really clunky
if [ -f "$HYPRE_ARCH_PATH/include/HYPRE.h" ]
if [ "$optDebug" = true ]
then
echo "Has installed hypre: $hyprePACKAGE"
configOpt="$configOpt --with-hypre-dir=$HYPRE_ARCH_PATH"
elif [ -n "$urlHypre" ]
then
configOpt="$configOpt --download-hypre=$urlHypre"
fi
# Additional configure options
if [ "$1" = "--" ]
then
shift
configOpt="$configOpt $@"
configOpt="$configOpt --with-debugging=1"
else
# A reasonable assumption for optimization
configOpt="$configOpt --with-debugging=0"
configOpt="$configOpt --COPTFLAGS=-O3 --CXXOPTFLAGS=-O3"
fi
if [ "$targetType" = libso ]
@ -211,21 +215,45 @@ echo
configOpt="$configOpt --with-precision=double"
fi
case "$optHypre" in
false)
configOpt="$configOpt --with-hypre=0"
;;
ftp:* | git:* | http:* | https:*)
configOpt="$configOpt --download-hypre=$optHypre"
;;
*)
# This is a really clunky way to use ThirdParty hypre
if [ -f "$HYPRE_ARCH_PATH/include/HYPRE.h" ]
then
echo "Has installed hypre: $hyprePACKAGE"
configOpt="$configOpt --with-hypre-dir=$HYPRE_ARCH_PATH"
else
configOpt="$configOpt --download-hypre"
fi
;;
esac
# Additional configure options
if [ "$1" = "--" ]
then
shift
configOpt="$configOpt $@"
fi
# We export compiler settings (above) but actually use the
# --with-cc and --with-cxx. So ignore them and flags
# --with-cc and --with-cxx. So ignore these environment variables.
unset CC CXX
unset CFLAGS CXXFLAGS
cd "$PETSC_SOURCE_DIR" || exit
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
unset GIT_DIR # No special git-repo handling
rm -rf "$PETSC_ARCH_PATH"
# No clean here, if we have multiple arch in the same directory
## without tests? --testdir=..
## configOpt="$configOpt --download-f2cblaslapack=1"
echo
set -x
./configure \
${installPrefix:+--prefix="$installPrefix"} \
@ -233,9 +261,6 @@ echo
--with-petsc-arch="$archOpt" \
--with-clanguage=C \
--with-fc=0 \
--with-scalapack=0 \
--with-superlu_dist=0 \
--with-suitesparse=0 \
--with-x=0 \
$configOpt \
&& set +x \