Skip to content

Commit c46419e

Browse files
authored
docs: add and update build/testing documentation (#993)
1 parent c908be4 commit c46419e

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed
File renamed without changes.

CMAKE_INSTRUCTIONS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ make install
5252
### User configurable options:
5353
By default, FMS is built without `OpenMP` and in `single precision (r4)`
5454

55+
The 64BIT and 32BIT precision options will build distinct libraries when enabled with the given default
56+
real size, libfms_r4 or libfms_r8.
57+
5558
The following build options are available:
5659
```
5760
-DOPENMP "Build FMS with OpenMP support" DEFAULT: OFF

INSTALL.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ build libFMS without MPI support, pass to `configure` the `--disable-mpi` flag.
3232

3333
## Supported Build Systems
3434

35+
The FMS repository has two build systems in place, GNU autotools and CMake.
36+
It is also compiled with the GFDL's internally-developed build tool, [mkmf](https://github.com/noaa-gfdl/mkmf)
37+
38+
CMake and Autotools have some variation in options and the resulting build targets.
39+
40+
Autotools will build with 64 bit real defaults unless configured with `--enable-mixed-mode` in
41+
which case it will default to 32 bit reals and add overloads to allow for both 32 bit and 64 bit
42+
operations. This results in one library with both 32 bit and 64 bit routines (defaulting to 32 bit reals).
43+
44+
By default CMake will build the library with 32 bit reals. It also has an option for 64 bit defaults
45+
, and if enabled will build an additional library with 64 bit reals. This results in distinct 32 bit and 64 bit libraries (libfms_r4.a and libfms_r8.a)
46+
3547
### GNU Autoconf/Automake
3648

3749
In many cases, running the shell command `./configure && make && make install`

TESTING.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Unit Testing
2+
3+
FMS includes a suite of MPI unit tests using the testing infrastructure included in the GNU autotools build system
4+
in order to check the functionality of the library's modules.
5+
6+
It consists of programs in the test_fms/ directory, with shell scripts to handle directory set up and input files.
7+
test_lib.sh.in and tap-driver.sh provide additional helper functions used in the scripts and manage output.
8+
9+
### Running the Tests
10+
11+
1. Configure with autotools
12+
```
13+
mkdir build # create a build directory in FMS
14+
autoreconf -if ../configure.ac
15+
../configure <configure options>
16+
```
17+
18+
2. Build and run suite
19+
```
20+
make check
21+
```
22+
This will compile any code not already compiled and then proceed to run the test scripts.
23+
24+
### Debugging Output and Test Options
25+
26+
Setting the environment variable TEST_VERBOSE will direct output to stdout as the test runs, while setting VERBOSE will only output on failure.
27+
Logs are created for each test as well, with the name \<test script name\>.log in it's corresponding test_fms/ directory.
28+
29+
To run an individual test:
30+
```
31+
make check -C test_fms/<test directory> TESTS=<test script name>
32+
```
33+
34+
SKIP_TESTS can be set to in order to skip specific tests in a script. It uses the script name and test number, and takes ranges as well:
35+
```
36+
SKIP_TESTS="test_name.4 test_name.[1-3]"
37+
```
38+
39+
Some options that effect the test suite can be set by passing options to the ./configure script that creates the makefiles
40+
for the build system:
41+
42+
- `--enable-code-coverage` allows for compilation with flags for coverage information.
43+
If enabled a coverage report can be generated with `make check-code-coverage`
44+
- `--enable-test-input=/path/to/input` turns on test scripts that require input netcdf files (interpolator, xgrid, data_override).
45+
This option is mainly used internally and in automated testing since we do not host the input data publicly.
46+
- `--with-yaml` compile with yaml input and enable it's associated tests

0 commit comments

Comments
 (0)