mirror of
https://develop.openfoam.com/Development/ThirdParty-common.git
synced 2025-12-08 06:57:50 +00:00
ENH: mingw cross-compile for FFTW (issue #57)
This commit is contained in:
39
makeFFTW
39
makeFFTW
@ -60,7 +60,7 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
|
|||||||
# FFTW version from OpenFOAM etc/config.sh file:
|
# FFTW version from OpenFOAM etc/config.sh file:
|
||||||
_foamConfig FFTW
|
_foamConfig FFTW
|
||||||
|
|
||||||
fftwPACKAGE=${fftw_version:-fftw-system}
|
fftwPACKAGE="${fftw_version:-fftw-system}"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
usage() {
|
||||||
@ -131,8 +131,8 @@ fi
|
|||||||
# FFTW_SOURCE_DIR : location of the original sources
|
# FFTW_SOURCE_DIR : location of the original sources
|
||||||
# FFTW_ARCH_PATH : installation directory
|
# FFTW_ARCH_PATH : installation directory
|
||||||
|
|
||||||
FFTW_SOURCE_DIR=$sourceBASE/$fftwPACKAGE
|
FFTW_SOURCE_DIR="$sourceBASE/$fftwPACKAGE"
|
||||||
FFTW_ARCH_PATH=$installBASE/$fftwPACKAGE
|
FFTW_ARCH_PATH="$installBASE/$fftwPACKAGE"
|
||||||
|
|
||||||
if [ -z "$optForce" ] \
|
if [ -z "$optForce" ] \
|
||||||
&& {
|
&& {
|
||||||
@ -150,6 +150,21 @@ else
|
|||||||
# Configuration options:
|
# Configuration options:
|
||||||
unset configOpt
|
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
|
# Additional configure options
|
||||||
if [ "$1" = "--" ]
|
if [ "$1" = "--" ]
|
||||||
then
|
then
|
||||||
@ -159,20 +174,20 @@ else
|
|||||||
|
|
||||||
# End of configuration options
|
# End of configuration options
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
buildDIR=$buildBASE/$fftwPACKAGE
|
buildDIR="$buildBASE/$fftwPACKAGE"
|
||||||
|
|
||||||
cd "$FFTW_SOURCE_DIR" || exit
|
cd "$FFTW_SOURCE_DIR" || exit
|
||||||
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
export GIT_DIR="$PWD/.git" # Mask seeing our own git-repo
|
||||||
|
|
||||||
rm -rf $FFTW_ARCH_PATH
|
rm -rf "$FFTW_ARCH_PATH"
|
||||||
rm -rf $buildDIR
|
rm -rf "$buildDIR"
|
||||||
mkdir -p $buildDIR
|
mkdir -p "$buildDIR"
|
||||||
cd $buildDIR
|
cd "$buildDIR"
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
$FFTW_SOURCE_DIR/configure \
|
"$FFTW_SOURCE_DIR"/configure \
|
||||||
--prefix=$FFTW_ARCH_PATH \
|
--prefix="$FFTW_ARCH_PATH" \
|
||||||
--libdir=$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
|
--libdir="$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH" \
|
||||||
--enable-shared --disable-static \
|
--enable-shared --disable-static \
|
||||||
--disable-fortran \
|
--disable-fortran \
|
||||||
$configOpt \
|
$configOpt \
|
||||||
@ -180,7 +195,7 @@ else
|
|||||||
&& make -j $WM_NCOMPPROCS \
|
&& make -j $WM_NCOMPPROCS \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& echo "Built $fftwPACKAGE" \
|
&& echo "Built $fftwPACKAGE" \
|
||||||
&& pkgconfigAdjust $FFTW_ARCH_PATH
|
&& pkgconfigAdjust "$FFTW_ARCH_PATH"
|
||||||
) || {
|
) || {
|
||||||
echo "Error building: FFTW"
|
echo "Error building: FFTW"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user