Cross-compile WRF for Windows Azure

For many HPC applications, porting from Linux to Windows is as straightforward as recompiling the application source code with a special toolchain. More complex applications may require a little more work, but even complex HPC applications can be ported in this way. Visit the PToolsWin page for more information.

This step of the tutorial will guide you through the process of recompiling WRF 3.3.1 with the PToolsWin development environment. PToolsWin generates native Windows code (no intermediate POSIX layer is required), so your application will perform as well as a native Windows application.

Prerequisites

Before you continue, make sure you have these software prerequisites:

  1. An installation of HPC Linux with PToolsWin.

  2. NetCDF for Windows.

Build WRF as a Windows Executable

  1. Open a command line in your HPC Linux distro and load the PToolsWin module:

     

  2. Begin by creating a directory for WRF:

     

  3. Download and unpack the WRF source code:

     

  4. Apply paratools-WRFV3.3.1 to the WRF source code to fix a few known problems and add a new build configuration for PToolsWin:

     

  5. Configure your environment. WRF relies on several environment variables to locate NetCDF and select the appropriate configuration files:

     

  6. Configure WRF. Select Windows 64-bit, PToolsWin (dmpar) (Option 7) and basic nesting (Option 1):

  7. Compile WRF 1. There is a race condition in the build process, so it’s a good idea to do a second, serial compilation after the first:

    Verify that the ptoolswin module is loaded before you begin compiling. You can view loaded modules with the command module list

     

  8. You should now have several program executables in the main folder:

    If any of these .exe files are missing from main, check configure.log.2 for errors ( do a case-insensitive search for “Error”) and try re-compiling. Otherwise, continue to Step 3.

Notes

  1. Check the Compile module of the WRF ARW Online Tutorial for more information on compiling WRF. (1)