OpenFOAM 1.5.x on Windows
For the latest version of our Windows patch for OpenFOAM visit "OpenFOAM 2.1.x on Windows 64-bit with MS MPI".
We have updated our Windows patch for OpenFOAM to match the latest OpenFOAM release (v1.5.x). Be warned - to build OpenFOAM for Windows with a cross compiler requires expert knowledge of Linux utilities and compilers.
A set of OpenFOAM binary applications are available for purchase at "OpenFlow: OpenFOAM for Windows."
The following steps are required to produce a native Windows version of OpenFOAM 1.5.x using a cross compiler:
- Configure, build, install and test a MinGW cross compiler for Windows running on Linux. I used the build-mingw script.
#include_next <float.h>to the end of
"lib/gcc/mingw32/4.2.3/include/float.h" and remove it from
"mingw32/include/float.h" to include the right "float.h".
- Install the OpenFOAM 1.5.x source (git Commit: 316c16a7cda8318061508cd4822037bf4685033c, Date: March 25, 2009) distribution on Linux
- Install the Third Party source pack and only compile the zlib library.
- Patch (using the Linux patch command) the OpenFOAM 1.5.x source distribution with our MinGW Windows modifications [last updated April 16, 2009 to v3].
- Copy wmkdep and dirToString from wmake/rules/linuxGcc to wmake/rules/linuxmingw32.
- Modify (or set environment variables) and source the etc/bashrc-mingw32 script to match your OpenFOAM 1.5.x source location.
- Build using Allwmake in the OpenFOAM-1.5.x directory on Linux.
- Transfer the OpenFOAM executables (applications/bin/linuxmingw32DPOpt/*.exe) and libraries (lib/linuxmingw32DPOpt/*.dll) to the Windows computer.
- Launch a Windows command prompt to run OpenFOAM.
Note that this latest version (v3) can now compile snappyHexMesh.
On the Windows computer ensure the following:
- The WM_PROJECT_DIR and USERNAME variables are set.
- The etc directory from the original source distribution is within the WM_PROJECT_DIR.
- The PATH variable is set to include the OpenFOAM executable and library locations.
With this method of building OpenFOAM for Windows the following features (there maybe more) are unavailable:
- job control scripts in bin (such as foamSolverSweeps)
The following applications and libraries are unlikely to build:
- metis and any dependents
You may need to copy foamFlex++ from a Linux OpenFOAM build to the MinGW build (applications/bin/linuxmingw32DPOpt).