Skip to content

Commit b22d29a

Browse files
committed
Deploying to gh-pages from @ 56ff714 🚀
1 parent cbbe102 commit b22d29a

42 files changed

Lines changed: 483 additions & 9489 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 70 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ This assertion utility contains four public entities:
1919

2020
The `assert` subroutine
2121
* Error-terminates with a variable stop code when a caller-provided logical assertion fails,
22-
* Includes user-supplied diagnostic data in the output if provided by the calling procedure,
2322
* Is callable inside `pure` procedures, and
2423
* Can be eliminated at compile-time, as controlled by the `ASSERTIONS` preprocessor define.
2524

@@ -42,10 +41,6 @@ If instead `fpm install` is used, then either the user must copy `include/assert
4241
the user must invoke `assert` directly (via `call assert(...)`).
4342
In the latter approach when the assertions are disabled, the `assert` procedure will start and end with `if (.false.) then ... end if`, which might facilitate automatic removal of `assert` during the dead-code removal phase of optimizing compilers.
4443

45-
The `characterizable_t` type defines an `as_character()` deferred binding that produces `character` strings for use as diagnostic output from a user-defined derived type that extends `characterizable_t` and implements the deferred binding.
46-
47-
The `intrinsic_array_t` type that extends `characterizable_t` provides a convenient mechanism for producing diagnostic output from arrays of intrinsic type `complex`, `integer`, `logical`, or `real`.
48-
4944
Use Cases
5045
---------
5146
Two common use cases include
@@ -63,27 +58,49 @@ The requirements and assurances might be constraints of three kinds:
6358

6459
The [example/README.md] file shows examples of writing constraints in notes on class diagrams using the formal syntax of the Object Constraint Language ([OCL]).
6560

66-
Downloading, Building, and Running Examples
67-
-------------------------------------------
61+
Running the Examples
62+
--------------------
63+
See the [./example](./example) subdirectory.
64+
65+
Building and Testing
66+
--------------------
67+
68+
- [Cray Compiler Environment (CCE) `ftn`](#cray-compiler-environment-cce-ftn)
69+
- [GNU Compiler Collection (GCC) `gfortran`](#gnu-compiler-collection-gcc-gfortran))
70+
- [Intel `ifx`](#intel-ifx))
71+
- [LFortran `lfortran`](#lfortran-lfortran)
72+
- [LLVM `flang-new`](#llvm-flang-new)
73+
- [Numerical Algorithms Group (NAG) `nagfor`](#numerical-algorithms-group-nag-nagfor)
74+
75+
### Cray Compiler Environment (CCE) `ftn`
76+
Because `fpm` uses the compiler name to determine the compiler identity and because
77+
CCE provides one compiler wrapper, `ftn`, for invoking all compilers, you will
78+
need to invoke `ftn` in a shell script named to identify CCE compiler. For example,
79+
place a script named `crayftn.sh` in your path with the following contents and with
80+
executable privileges set appropriately:
81+
```
82+
#!/bin/bash
6883
69-
### Downloading Assert
84+
ftn $@
7085
```
71-
git clone git@github.com:berkeleylab/assert
72-
cd assert
86+
Then build and test Assert with the command
87+
```
88+
fpm test --compiler crayftn.sh --profile release
7389
```
7490

75-
### Building and testing with `gfortran`
91+
### GNU Compiler Collection (GCC) `gfortran`
92+
7693
#### Single-image (serial) execution
77-
The command below builds Assert and runs the full test suite in a single image.
78-
For `gfortran` 14 or later, use
94+
With `gfortran` 14 or later, use
7995
```
8096
fpm test --profile release
8197
```
82-
For `gfortran` 13 or earlier, use
98+
With `gfortran` 13 or earlier, use
8399
```
84100
fpm test --profile release --flag "-ffree-line-length-0"
85101
```
86102
The above commands build the Assert library (with the default of assertion enforcement disabled) and runs the test suite.
103+
87104
#### Multi-image (parallel) execution
88105
With `gfortran` 14 or later versions and OpenCoarrays installed, use
89106
```
@@ -93,60 +110,56 @@ With `gfortran` 13 or earlier versions and OpenCoarrays installed,
93110
```
94111
fpm test --compiler caf --profile release --runner "cafrun -n 2" --flag "-ffree-line-length-0"
95112
```
96-
To build and test with the Numerical Algorithms Group (NAG) Fortran compiler version
97-
7.1 or later, use
98-
```
99-
fpm test --compiler=nagfor --profile release --flag "-coarray=cosmp -fpp -f2018"
100-
```
101113

102-
### Building and testing with the Intel `ifx` compiler
114+
### Intel `ifx`
115+
103116
#### Single-image (serial) execution
104117
```
105118
fpm test --compiler ifx --profile release
106119
```
120+
107121
#### Multi-image (parallel) execution
108122
With Intel Fortran and Intel MPI installed,
109123
```
110124
fpm test --compiler ifx --profile release --flag "-coarray -DASSERT_MULTI_IMAGE"
111125
```
112126

113-
### Building and testing with the LLVM `flang-new` compiler
114-
#### LLVM version 19
127+
### LLVM `flang-new`
128+
129+
#### Single-image (serial) execution
130+
With `flang-new` version 19, use
115131
```
116132
fpm test --compiler flang-new --flag "-mmlir -allow-assumed-rank -O3"
117133
```
118-
#### LLVM version 20 or later
134+
With `flang-new` version 20 or later, use
119135
```
120136
fpm test --compiler flang-new --flag "-O3"
121137
```
122138

123-
### Building and testing with the Numerical Algorithms Group (NAG) compiler
139+
### LFortran `lfortran`
140+
141+
#### Single-image (serial) execution
124142
```
125-
fpm test --compiler nagfor --profile release --flag "-fpp -coarray=cosmp"
143+
fpm test --compiler lfortran --profile release --flag --cpp
126144
```
127145

128-
### Building and testing with the Cray Compiler Environment (CCE)
129-
Because `fpm` uses the compiler name to determine the compiler identity and because
130-
CCE provides one compiler wrapper, `ftn`, for invoking all compilers, you will
131-
need to invoke `ftn` in a shell script named to identify CCE compiler. For example,
132-
place a script named `crayftn.sh` in your path with the following contents and with
133-
executable privileges set appropriately:
146+
### Numerical Algorithms Group (NAG) `nagfor`
147+
148+
#### Single-image (serial) execution
149+
With `nagfor` version 7.1 or later, use
150+
```
151+
fpm test --compiler nagfor --flag -fpp
134152
```
135-
#!/bin/bash
136153

137-
ftn $@
154+
#### Multi-image execution
155+
With `nagfor` 7.1, use
138156
```
139-
Then build and test Assert with the command
157+
fpm test --compiler nagfor --profile release --flag "-fpp -coarray=cosmp -f2018"
140158
```
141-
fpm test --compiler crayftn.sh --profile release
159+
With `nagfor` 7.2 or later, use
160+
```
161+
fpm test --compiler nagfor --flag -fpp
142162
```
143-
144-
145-
### Building and testing with other compilers
146-
To use Assert with other compilers, please submit an issue or pull request.
147-
148-
### Running the examples
149-
See the [./example](./example) subdirectory.
150163

151164
Documentation
152165
-------------
@@ -208,19 +221,19 @@ character for line-breaks in a macro invocation:
208221

209222
```fortran
210223
! OK for flang-new and gfortran
211-
call_assert_diagnose( computed_checksum == expected_checksum, \
212-
"Checksum mismatch failure!", \
213-
expected_checksum )
224+
call_assert_describe( computed_checksum == expected_checksum, \
225+
"Checksum mismatch failure!" \
226+
)
214227
```
215228

216229
Whereas Cray Fortran wants `&` line continuation characters, even inside
217230
a macro invocation:
218231

219232
```fortran
220233
! OK for Cray Fortran
221-
call_assert_diagnose( computed_checksum == expected_checksum, &
222-
"Checksum mismatch failure!", &
223-
expected_checksum )
234+
call_assert_describe( computed_checksum == expected_checksum, &
235+
"Checksum mismatch failure!" &
236+
)
224237
```
225238

226239
There appears to be no syntax acceptable to all compilers, so when writing
@@ -237,29 +250,29 @@ after macro expansion (on gfortran and flang-new):
237250

238251
```fortran
239252
! INCORRECT: cannot use Fortran comments inside macro invocation
240-
call_assert_diagnose( computed_checksum == expected_checksum, ! ensured since version 3.14
241-
"Checksum mismatch failure!", ! TODO: write a better message here
242-
computed_checksum )
253+
call_assert_describe( computed_checksum == expected_checksum, ! ensured since version 3.14
254+
"Checksum mismatch failure!" ! TODO: write a better message here
255+
)
243256
```
244257

245258
Depending on your compiler it *might* be possible to use a C-style block
246259
comment (because they are often removed by the preprocessor), for example with
247260
gfortran one can instead write the following:
248261

249262
```fortran
250-
call_assert_diagnose( computed_checksum == expected_checksum, /* ensured since version 3.14 */ \
251-
"Checksum mismatch failure!", /* TODO: write a better message here */ \
252-
computed_checksum )
263+
call_assert_describe( computed_checksum == expected_checksum, /* ensured since version 3.14 */ \
264+
"Checksum mismatch failure!" /* TODO: write a better message here */ \
265+
)
253266
```
254267

255268
However that capability might not be portable to other Fortran compilers.
256269
When in doubt, one can always move the comment outside the macro invocation:
257270

258271
```fortran
259272
! assert a property ensured since version 3.14
260-
call_assert_diagnose( computed_checksum == expected_checksum, \
261-
"Checksum mismatch failure!", \
262-
computed_checksum ) ! TODO: write a better message above
273+
call_assert_describe( computed_checksum == expected_checksum, \
274+
"Checksum mismatch failure!" \
275+
) ! TODO: write a better message above
263276
```
264277

265278
Legal Information

index.html

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,14 @@
5252
<li><a href="./lists/files.html">Source Files</a></li>
5353
<li><a href="./lists/modules.html">Modules</a></li>
5454
<li><a href="./lists/procedures.html">Procedures</a></li>
55-
<li><a href="./lists/absint.html">Abstract Interfaces</a></li>
56-
<li><a href="./lists/types.html">Derived Types</a></li>
57-
55+
5856
</ul>
5957

6058
</li>
6159
<li class="visible-xs hidden-sm visible-lg"><a href="./lists/files.html">Source Files</a></li>
6260
<li class="visible-xs hidden-sm visible-lg"><a href="./lists/modules.html">Modules</a></li>
6361
<li class="visible-xs hidden-sm visible-lg"><a href="./lists/procedures.html">Procedures</a></li>
64-
<li class="visible-xs hidden-sm visible-lg"><a href="./lists/absint.html">Abstract Interfaces</a></li>
65-
<li class="visible-xs hidden-sm visible-lg"><a href="./lists/types.html">Derived Types</a></li>
66-
</ul>
62+
</ul>
6763
<form action="./search.html" class="navbar-form navbar-right" role="search">
6864
<div class="form-group">
6965
<input type="text" class="form-control" placeholder="Search" name="q" id="tipue_search_input" autocomplete="off" required>
@@ -90,40 +86,25 @@ <h1>Assert library</h1>
9086
</div>
9187
</div>
9288
<div class="row">
93-
<div class="col-xs-6 col-sm-3">
89+
<div class="col-xs-6 col-sm-4">
9490
<h3>Source Files</h3>
9591
<ul> <li><a href='./sourcefile/assert_m.f90.html'>assert_m.f90</a></li>
9692
<li><a href='./sourcefile/assert_subroutine_m.f90.html'>assert_subroutine_m.F90</a></li>
97-
<li><a href='./sourcefile/assert_subroutine_s.f90.html'>assert_subroutine_s.F90</a></li>
98-
<li><a href='./sourcefile/characterizable_m.f90.html'>characterizable_m.f90</a></li>
9993
<li><a href='./sourcefile/fortran_stringify_integer_m.f90.html'>fortran_stringify_integer_m.f90</a></li>
100-
<li><a href='./sourcefile/intrinsic_array_m.f90.html'>intrinsic_array_m.F90</a></li>
101-
<li><a href='./sourcefile/intrinsic_array_s.f90.html'>intrinsic_array_s.F90</a></li>
10294
</ul>
10395
</div>
104-
<div class="col-xs-6 col-sm-3">
96+
<div class="col-xs-6 col-sm-4">
10597
<h3>Modules</h3>
10698
<ul> <li><a href='./module/assert_m.html'>assert_m</a></li>
10799
<li><a href='./module/assert_subroutine_m.html'>assert_subroutine_m</a></li>
108-
<li><a href='./module/characterizable_m.html'>characterizable_m</a></li>
109100
<li><a href='./module/fortran_stringify_integer_m.html'>fortran_stringify_integer_m</a></li>
110-
<li><a href='./module/intrinsic_array_m.html'>intrinsic_array_m</a></li>
111101
</ul>
112102
</div>
113-
<div class="col-xs-6 col-sm-3">
103+
<div class="col-xs-6 col-sm-4">
114104
<h3>Procedures</h3>
115-
<ul> <li><a href='./proc/allocated_components.html'>allocated_components</a></li>
116-
<li><a href='./interface/as_character.html'>as_character</a></li>
117-
<li><a href='./interface/assert.html'>assert</a></li>
118-
<li><a href='./interface/assert_always.html'>assert_always</a></li>
105+
<ul> <li><a href='./proc/assert.html'>assert</a></li>
106+
<li><a href='./proc/assert_always.html'>assert_always</a></li>
119107
<li><a href='./proc/fortran_stringify_integer.html'>fortran_stringify_integer</a></li>
120-
<li><a href='./interface/intrinsic_array_t.html'>intrinsic_array_t</a></li>
121-
</ul>
122-
</div>
123-
<div class="col-xs-6 col-sm-3">
124-
<h3>Derived Types</h3>
125-
<ul> <li><a href='./type/characterizable_t.html'>characterizable_t</a></li>
126-
<li><a href='./type/intrinsic_array_t.html'>intrinsic_array_t</a></li>
127108
</ul>
128109
</div>
129110
</div>

0 commit comments

Comments
 (0)