summaryrefslogblamecommitdiff
path: root/var/spack/repos/builtin/packages/openfoam-com/common/spack-Allwmake
blob: eb2d097c4ea1eccbd5b1797cbba287f6ca9f244a (plain) (tree)
1
2
3
4
5
6
7






                                                                      






                                             






                                                      

  













                                                                               
#!/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

# -----------------------------------------------------------------------------