#!/bin/sh #------------------------------------------------------------------------------ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | www.openfoam.com # \\/ M anipulation | #------------------------------------------------------------------------------ # Copyright (C) 2016-2020 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. # # Script # makeFFTW # # Description # Build script for FFTW # # ---------------------------------------------- # NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE #------------------------------------------------------------------------------ # Dynamic library ending (default is .so) [ "$(uname -s)" = Darwin ] && EXT_SO=.dylib || EXT_SO=.so # Short-circuit test for an installation 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" ] then echo " fftw include: $dir/include" echo " fftw library: $dir/lib$WM_COMPILER_LIB_ARCH" exit 0 else exit 2 fi fi #------------------------------------------------------------------------------ # Run from third-party directory only cd "${0%/*}" || exit 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 } . etc/tools/ThirdPartyFunctions #------------------------------------------------------------------------------ # FFTW version from OpenFOAM etc/config.sh file: _foamConfig FFTW fftwPACKAGE=${fftw_version:-fftw-system} #------------------------------------------------------------------------------ usage() { exec 1>&2 while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat<