To build OpenFOAM® for Windows with a cross-compiler requires expert knowledge of Windows and Linux utilities and compilers.
Instructions based on "OpenFOAM 2.1.x on Windows 64-bit with MS MPI"
The following steps are required to produce a native Windows version of OpenFOAM 2.1.x 64-bit with [optional] native Windows MS MPI:
<mingw-w64>/x86_64-w64-mingw32/include/zconf.h<mingw-w64>/x86_64-w64-mingw32/include/zlib.h<mingw-w64>/bin/zlib1.dll<mingw-w64>/x86_64-w64-mingw32/lib/libz.a<mingw-w64>/x86_64-w64-mingw32/lib/libzdll.asignals/sigFpe.C:45:15: error: '_clearfp' was not declared in this scope#include_next <float.h> to the end of<mingw-w64>/lib/gcc/x86_64-w64-mingw32/<gcc-version>/include/float.h and remove it from<mingw-w64>/x86_64-w64-mingw32/include/float.h to include the right float.hexport FOAM_INST_DIR="$(HOME)/projects/of/2.1"; source $(FOAM_INST_DIR)/OpenFOAM-2.1.x/etc/bashrc WM_OSTYPE=MSwindows WM_COMPILER=mingw-w64 WM_ARCH_OPTION=64 WM_PRECISION_OPTION=SP WM_CC=x86_64-w64-mingw32-gcc WM_CXX=x86_64-w64-mingw32-g++ compilerInstall=system [optional] WM_MPLIB=MSMPI [optional] MPI_ARCH_PATH="$(HOME)/projects/msmpi/install"
ln -s $(WM_THIRD_PARTY_DIR)/scotch<version> $(WM_THIRD_PARTY_DIR)/scotchln -s $(WM_PROJECT_DIR)/extra/scotch/src/Make.inc/Makefile.inc.mingw-w64 $(WM_THIRD_PARTY_DIR)/scotch/src/Makefile.inccp $(WM_PROJECT_DIR)/extra/scotch/src/libscotch/* $(WM_THIRD_PARTY_DIR)/scotch/src/libscotch/.cd $(WM_THIRD_PARTY_DIR)/scotch/srccp $(WM_PROJECT_DIR)/extra/scotch/src/Makefile .make libscotchmkdir -p $(FOAM_LIBBIN)cd $(WM_THIRD_PARTY_DIR)/scotch/src/libscotchcp libscotch.* $(FOAM_LIBBIN)cd $(WM_PROJECT_DIR)/wmake/src; makeln -s $(WM_PROJECT_DIR)/wmake/platforms/linux64Gcc $(WM_PROJECT_DIR)/wmake/platforms/linux64mingw-w64cd $(WM_PROJECT_DIR);./Allwmake<mingw-w64>/bin/zlib1.dll<mingw-w64>/bin/libgcc_s_sjlj-1.dll<mingw-w64>/bin/libstdc++-6.dllto the Windows computer
OpenFOAM is a registered trademark of OpenCFD and is unaffiliated with Symscape