spack/var/spack/repos/builtin/packages/openfoam-com/common/spack-Allwmake
Mark Olesen cbedd507cf ENH: fixes and updates for openfoam-com build (#10065)
- previous removal of FOAM_EXT_LIBBIN (ThirdParty) from the environment
  during the build could lead to the system scotch library being found
  instead of the spack installation.

  Avoid this largely cosmetic change to the setting in favour of
  improved build robustness. These modifications will be largely
  superfluous in the 1812 release anyhow.

- Split the patching algorithm into 'regular' and '@:1806' since the
  next versions of openfoam will again need fewer patches.

- Add hook into foamCreateManpage to be used where available
2018-12-17 12:58:09 -06:00

38 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# Build wrapper script - FOAM_INST_DIR is only required by foam-extend
export FOAM_INST_DIR=$(cd .. && pwd -L)
. $PWD/etc/bashrc '' # No arguments
mkdir -p $FOAM_APPBIN $FOAM_LIBBIN 2>/dev/null # Allow interrupt
echo "Build openfoam with SPACK ($@)"
echo WM_PROJECT_DIR = $WM_PROJECT_DIR
# Prefer spack-specific Allwmake if it exists
if [ -f Allwmake-spack ]
then
./Allwmake-spack $@ # Pass arguments
else
./Allwmake $@ # Pass arguments
# Generate manpages
if [ -x bin/tools/foamCreateManpage ]
then
bin/tools/foamCreateManpage -gzip || \
echo "ignore problems generating manpages"
fi
fi
# Link non-dummy MPI_FOAM type to parent-dir, where rpath can find it
if [ "${FOAM_MPI:=dummy}" != dummy -a -d "$FOAM_LIBBIN/$FOAM_MPI" ]
then
(
cd "$FOAM_LIBBIN" || exit 1
for i in $FOAM_MPI/lib*.so
do
[ -f $i ] && ln -sf $i "${i##*/}"
done
)
fi
# -----------------------------------------------------------------------------