1. Port POP from Linux to Windows

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 (such as OpenFOAM) can be ported in this way.

This step of the tutorial will guide you through the process of recompiling POP 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.

You will recompile recompile POP to produce a Windows executable and then copy the POP executable and run folder to Windows in preparation for uploading them to a Windows Azure Storage service.

1.1. Prerequisites

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

  1. An installation of HPC Linux with PToolsWin.

  2. NetCDF for Windows.

1.2. Build POP as a Windows Executable

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

     

  2. Create your POP directory:

     

  3. Download and extract the POP source code from LANL to $POPDIR:

     

  4. Execute the setup_run_dir script in the pop directory to create and populate a new POP run directory named “windows”:

     

  5. When we compiled NetCDF for Windows, we passed the --host=x86_64-w64-mingw32 flag to the configure script to indicate that the MinGW cross compilers should be used instead of the native compilers. This is the preferred method of cross compiling an application that uses the GNU Autoconf build system. Autoconf is very common among Linux applications, but there are some applications (like POP!) that do not use it, and hence do not have a configure script. POP uses a custom build system that gets its configuration from a file with a .gnu extension.

    We have created a customized .gnu file for cross compilation, starting with linux.gnu as the template. Download ptoolswin.gnu to $POPDIR/pop/windows:

  6. If you compare ptoolswin.gnu with linux.gnu you can see what changes are required to switch from native compilation to cross compilation:
    Notice that only a few changes are required. PToolsWin provides mpif90 and mpicc commands, so the only compiler change is to explicitly set the C compiler to the PToolsWin cross compiler. LDFLAGS has been updated to force a “.exe” suffix on the binary executable, and the NetCDF DLL files have been added to the linker command line arguments.
  7. Compile POP by setting the ARCHDIR environment variable and running “make”:

     

     

1.3. Copy POP and Required Libraries to Windows

Now that POP has compiled successfully, we need to gather together the POP executable and all its required files and transfer them to your Windows machine.

  1. Copy files from POP:

     

  2. Next, copy the NetCDF libraries and MinGW-w64 runtime libraries:

  3. POP depends on MPI, but we do not need to copy the Microsoft MPI libraries because they are already installed on the Windows host. All together, your transfer folder should look like this ($POPDIR is /home/livetau/windows):

     

  4. Create a zip file from the contents of the transfer folder:

    Your $POPDIR/pop.zip file should be approximately 6.2M in size.

  5. Verify that you have created pop.zip correctly by comparing your pop.zip file with ours. You can view the contents of our pop.zip file or you can download pop.zip and unpack it.

  6. If pop.zip looks correct, copy it to your local Windows installation. Don’t extract it yet. We will create a new Windows Azure service before we unpack pop.zip and upload it to a Windows Azure storage service.

You are now ready to proceed to Step 3: The Windows Azure HPC Scheduler.


msdevelLogo