Prerequisites

Introduction

This tutorial explains how to specify prereqs (short for prerequisites) to the build and test system. Your software may depend on one or more external tools or libraries in order to build or test. Often these components are not bundled as part of the “stock” operating system you are targetting. The build and test system, by default, provides a “clean” environment with only the default tools that are provided by the OS in question.

This need for external tools can be addressed in two different ways:

  1. Specify prereqs to NMI in your build and test specification file. These prereqs must be installed by the NMI pool administrator on one or more of the machines you require before your jobs will be able to run. The prereq list is used by NMI to ensure your submission only runs on resources which offer the necessary external tools, and to ensure that your submission runs with each of its specifed prereqs automatically present in its PATH. You may use the nmi_list_prereqs tool to find or view any and all prereqs installed in the NMI B&T Lab. This tutorial demonstrates this approach.
  1. Include the external tool yourself as an additional input to your build or test. The advantage is that you will have a more portable build or test that can run on unmodified instances of the given platform, without requiring special software to be installed in advance. This may provide you with access to many more resources. The disadvantage is that, depending on the number and size of your dependencies, your inputs could become large and unwieldy.
One way to do this is to use a precompiled binary of the tool or library as input; another is to submit a separate NMI build of the tool itself, and then specify to NMI that this build’s output should be used as input to a subsequent NMI build or test which requires it. This approach is sometimes called “build (or test) chaining”, and is demonstrated here. It has the advantage of allowing you to more target a new platform without having to manually locate or build binaries for each of your external tools yourself.