Quickstart¶
This quick start guide shows how to get the SWM code and build the C and Fortran versions of the mini-app. The only required dependencies are:
- CMake
- C Compiler
- Fortran Compiler
For an overview of all available versions of the mini-app see the swm repository tour page.
Step 1: Get the Code¶
The source code is available on GitHub at NCAR SWM. The recommended way to get it is:
Throughout this documentSWM_ROOT will refer to the directory where you pulled the SWM repository. We recommend exporting SWM_ROOT as an environment variable in your shell so you can copy paste subsequent steps in this quickstart tutorial. In the bash shell you can do this with the command: Some of the provided build/run scripts in the SWM repository also use the
SWM_ROOTenvironment variable.
Step 2: Generate the Build Directory¶
CMake is the recommended way to build the various versions of the SWM mini-app. The following command generates a build that uses all default options.
Where SWM_ROOT points to the directory where you pulled the SWM repository in the previous step and SWM_BUILD_DIR is a directory where the build will be generated.
You can place the build directory
SWM_BUILD_DIRanywhere, but it is recommended to put it somewhere outside of theSWM_ROOTdirectory. That way the files generated inSWM_BUILD_DIRare independent of your source controlledSWM_ROOTdirectory. This allows you to generate multiple builds with different options or run the executables within a build without generating a lot of untracked files in yourSWM_ROOTdirectory. I usually just put the build directory right next to the source directory with:
For more on the available SWM CMake build options see the build page.
Step 3: Build¶
To build the code run the command:
When we generated the build directory in the previous step we did not specify which build system to use. But most systems will use Make by default. If that is the case on your system then the build directory should have a top level makefile that can also be used to build all the executables. See the build page for more details.
Step 4: Run¶
There should now be two executables in SWM_BUILD_DIR. The C and Fortran versions of the mini-app do not take any command-line arguments or input files. You can run them via:
Step 5: Solution Verification¶
TODO