Skip to content
Snippets Groups Projects
Commit f197c721 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: mingw cross-compile for FFTW (issue #57)

parent 11e3723f
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || { ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment