diff --git a/makeHYPRE b/makeHYPRE new file mode 100755 index 0000000..b8f3dcc --- /dev/null +++ b/makeHYPRE @@ -0,0 +1,172 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of OpenFOAM, licensed under GNU General Public License +# . +# +# Script +# makeHYPRE +# +# Description +# Build script for HYPRE +# +# ---------------------------------------------- +# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE +#------------------------------------------------------------------------------ +# Dynamic library endings (default is .so) +[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so + +# Short-circuit test for an installation +if [ "$1" = "-test" ] +then + [ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; } + dir="$2" # <- HYPRE_ARCH_PATH + if [ -d "$dir/include" ] + then + for lib in \ + $FOAM_EXT_LIBBIN/libhypre.$SO \ + $dir/lib/libhypre.a \ + $dir/lib/libhypre.$SO \ + $dir/lib$WM_COMPILER_LIB_ARCH/libhypre.a \ + $dir/lib$WM_COMPILER_LIB_ARCH/libhypre.$SO \ + ; + do + if [ -r "$lib" ] + then + echo " hypre include: $dir/include" + echo " hypre library: ${lib%/*}" + exit 0 + fi + done + fi + exit 2 +fi +#------------------------------------------------------------------------------ +# Run from third-party directory only +cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || { + echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR" + 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 hypre + +hyprePACKAGE=${hypre_version:-hypre-system} +targetType=libso + +#------------------------------------------------------------------------------ +usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat</dev/null + + ./configure \ + --prefix=$HYPRE_ARCH_PATH \ + --disable-fortran \ + --enable-shared \ + $configOpt \ + && make -j $WM_NCOMPPROCS \ + && echo "Built: hypre" \ + && make install \ + && echo "Installed: hypre" +) || { + echo "Error building: hypre" + exit 1 +} + + +#------------------------------------------------------------------------------ diff --git a/makePETSC b/makePETSC new file mode 100755 index 0000000..6b86ec0 --- /dev/null +++ b/makePETSC @@ -0,0 +1,194 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2018 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of OpenFOAM, licensed under GNU General Public License +# . +# +# Script +# makePETSC +# +# Description +# Build script for PETSC +# +# ---------------------------------------------- +# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE +#------------------------------------------------------------------------------ +# Dynamic library endings (default is .so) +[ "$(uname -s)" = Darwin ] && SO=dylib || SO=so + +# Short-circuit test for an installation +if [ "$1" = "-test" ] +then + [ "$#" -eq 2 ] || { echo "${0##*/} -test : needs 1 argument"; exit 1; } + dir="$2" # <- PETSC_ARCH_PATH + if [ -d "$dir/include" ] + then + for lib in \ + $FOAM_EXT_LIBBIN/libpetsc.$SO \ + $dir/lib/libpetsc.a \ + $dir/lib/libpetsc.$SO \ + $dir/lib$WM_COMPILER_LIB_ARCH/libpetsc.a \ + $dir/lib$WM_COMPILER_LIB_ARCH/libpetsc.$SO \ + ; + do + if [ -r "$lib" ] + then + echo " petsc include: $dir/include" + echo " petsc library: ${lib%/*}" + exit 0 + fi + done + fi + exit 2 +fi +#------------------------------------------------------------------------------ +# Run from third-party directory only +cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || { + echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR" + 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 petsc + +petscPACKAGE=${petsc_version:-petsc-system} +targetType=libso + +#------------------------------------------------------------------------------ +usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat<