Skip to content

Commit b5f5317

Browse files
authored
Merge pull request #72 from sourceryinstitute/partial-cray-support
Partial Cray support
2 parents 1b01017 + 0d11ce5 commit b5f5317

File tree

5 files changed

+73
-53
lines changed

5 files changed

+73
-53
lines changed

README.md

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,19 @@ compiler standard-conformance, including a test for each scenario in which the
6464
the Fortran 2023 standard requires that an object be finalized. The table below
6565
summarizes the observed compiler behaviors:
6666

67-
| _Compiler_ | _Test failures_ | _Version tested_ |
68-
| :--- | :---: | :--- |
69-
| AMD `flang` | N.A. (see Note 1.) | 13.0.0 (AOCC_3.2.0-Build\#128 2021\_11\_12) |
70-
| Cray `ftn` | >= 3 (see Note 2.) | 13.0.1 |
71-
| GCC `gfortran` :trophy: | 0 | 13.1.0 |
72-
| IBM `xlf2008_r` | 1 | 17.1.0 on AIX |
73-
| Intel `ifort` | 1 | 2021.7.0 Build 20220726_000000 |
74-
| Intel `ifx` | 1 | 2024.0.0 Build 20231017 |
75-
| LLVM `flang` :trophy: | 0 | 19.0.0 `git` commit 325f5123 |
76-
| NAG `nagfor` :trophy: | 0 | 7.1 Build 7113 |
77-
| NVIDIA `nvfortran` | 2 | 22.7-0 |
78-
79-
**Notes**
80-
1. Fails to build due to an internal compiler error (ICE).
81-
2. Fails to build due to `fpm` issue [767]. See [test/README.md#cray] for a lower bound on the Cray compiler test failures.
67+
| _Compiler_ | _Test failures_ | _Version tested_ |
68+
| :--- | :---: | :--- |
69+
| AMD `flang` | N.A. (see Note) | 13.0.0 (AOCC_3.2.0-Build\#128 2021\_11\_12) |
70+
| Cray `ftn` | 4 | 17.0.0 |
71+
| GCC `gfortran` :trophy: | 0 | 13.1.0 |
72+
| IBM `xlf2008_r` | 1 | 17.1.0 on AIX |
73+
| Intel `ifort` | 1 | 2021.7.0 Build 20220726_000000 |
74+
| Intel `ifx` | 1 | 2024.0.0 Build 20231017 |
75+
| LLVM `flang` :trophy: | 0 | 19.0.0 `git` commit 325f5123 |
76+
| NAG `nagfor` :trophy: | 0 | 7.1 Build 7113 |
77+
| NVIDIA `nvfortran` | 2 | 22.7-0 |
78+
79+
Note: AMD `flang` fails to build Smart-Pointers due to an internal compiler error (ICE).
8280

8381
See the [test suite README.md](./test/README.md) for more details on each compiler's test
8482
results.
@@ -93,42 +91,66 @@ cd smart-pointer
9391
```
9492
followed by one of the commands below corresponding to your compiler choice.
9593

96-
### Numerical Algorithms Group
94+
### Fully supported compilers
95+
The following compilers pass all Smart-Pointers tests.
96+
97+
#### GCC `gfortran`
98+
```
99+
fpm test
100+
```
101+
102+
#### LLVM `flang`
103+
```
104+
fpm test --compiler flang-new
105+
```
106+
107+
#### NAG `nagfor`
97108
```
98109
fpm test --compiler nagfor --flag -fpp
99110
```
100111

101-
### Intel
112+
### Partially supported compilers
113+
The following compilers pass most Smart-Pointers tests.
114+
115+
#### HPE: Cray Compiler Environment (CCE)
116+
Building with `fpm` using the CCE `ftn` compiler wrapper requires an additional
117+
wrapper to identify the wrapped compiler. Place a file named `crayftn.sh` at the
118+
front of your `PATH` environment variable containing the following contents:
102119
```
103-
fpm test --compiler ifort
120+
#!/bin/bash
121+
122+
ftn "$@"
104123
```
105-
or
124+
Then test with the following command
106125
```
107-
fpm test --compiler ifx
126+
fpm test --compiler crayftn.sh
108127
```
109-
where the latter requires `fpm` 0.10.0 or later.
110128

111-
### IBM
129+
#### IBM
112130
```
113131
fpm test --archiver ar --compiler xlf2008_r --flag -DXLF
114132
```
115133

116-
### GCC
134+
#### Intel `ifort`
117135
```
118-
fpm test
136+
fpm test --compiler ifort
119137
```
120138

121-
### LLVM
139+
#### Intel `ifx`
122140
```
123-
fpm test --compiler flang-new
141+
fpm test --compiler ifx
124142
```
143+
where the latter requires `fpm` 0.10.0 or later.
125144

126-
### NVIDIA
145+
#### NVIDIA `nvfortran`
127146
```
128147
fpm test --compiler nvfortran --flag -Mpreprocess
129148
```
130149

131-
### AMD
150+
### Unsupported compiler
151+
The following compiler cannot build the Smart-Pointers library.
152+
153+
#### AMD `flang`
132154
```
133155
fpm test --compiler flang --flag -cpp
134156
```

example/test-support/specification_expression_finalization.F90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ program specification_expression_finalization
6767
contains
6868

6969
subroutine finalize_specification_expression_result
70+
#ifndef _CRAYFTN
7071
real tmp(component(finalizable_t(component=0))) !! Finalizes the finalizable_t function result
7172
real eliminate_unused_variable_warning
7273
tmp = eliminate_unused_variable_warning
74+
#endif
7375
end subroutine
7476

7577
end program

test/README.md

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,31 +30,27 @@ Detailed Results
3030
- Result: Fails to build due to an internal compiler error (ICE)
3131

3232
### Cray
33-
- Version: 13.0.1
34-
- Result: at least 3 test failures.
35-
The Smart-Pointers library does not currenlty build with the Cray Fortran compiler, but
36-
the compiler standard-conformance tests embodied in [compiler_test_m.f90] also exist in
37-
a standalone format in a type-finalization [branch] of the Berkely Lab fork of the
38-
llvm-test-suite repository. The reslts of running those compiler test show three compiler
39-
test failures as follows:
33+
- Version: 17.0.0
34+
- Result: 4 test failures.
4035
```
41-
git clone https://github.com/berkeleylab/llvm-test-suite
42-
cd llvm-test-suite/Fortran/UnitTests/finalization
43-
ftn compile_me_only.f90
44-
> ./a.out
45-
Cray Fortran : Version 13.0.1 fails to compile specification_expression_finalization.f90
46-
Pass: finalizes a non-allocatable object on the LHS of an intrinsic assignment
47-
Fail: finalizes an allocated allocatable LHS of an intrinsic assignment
48-
Pass: finalizes a target when the associated pointer is deallocated
49-
Pass: finalizes an object upon explicit deallocation
50-
Pass: finalizes a non-pointer non-allocatable object at the END statement
51-
Pass: finalizes a non-pointer non-allocatable object at the end of a block construct
52-
Pass: finalizes a function reference on the RHS of an intrinsic assignment
53-
Fail: finalizes a specification expression function result
54-
Fail: finalizes an intent(out) derived type dummy argument
55-
Pass: finalizes an allocatable component object
36+
The compiler
37+
Pass: finalizes a non-allocatable object on the LHS of an intrinsic assignment
38+
Fail: finalizes an allocated allocatable LHS of an intrinsic assignment
39+
Pass: finalizes a target when the associated pointer is deallocated
40+
Pass: finalizes an object upon explicit deallocation
41+
Pass: finalizes a non-pointer non-allocatable object at the END statement
42+
Pass: finalizes a non-pointer non-allocatable object at END BLOCK statement
43+
Pass: finalizes a function reference on the RHS of an intrinsic assignment
44+
Pass: finalizes a specification expression function result
45+
Fail: finalizes an intent(out) derived type dummy argument
46+
Pass: finalizes an allocatable component object
47+
48+
A smart_pointer
49+
Pass: creates a resource when constructed
50+
Fail: removes the resource when the object goes out of scope
51+
Pass: copy points to the same resource as the original
52+
Fail: has zero references after a shallow copy goes out of scope
5653
```
57-
The number of unit test failures for the remainder of the Smart-Pointers test suite is unknown.
5854

5955
### GCC
6056
- Version: 13.1.0
File renamed without changes.

test/sp_smart_pointer_test_m.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function check_deletion() result(test_passes)
9191
function check_copy() result(test_passes)
9292
logical test_passes
9393
type(object_t) :: reference
94-
#ifdef XLF
94+
#if defined(XLF) || defined(_CRAYFTN)
9595
type(object_t) :: original
9696

9797
original = object_t()
@@ -107,7 +107,7 @@ function check_copy() result(test_passes)
107107
reference_to_declared = declared
108108
test_passes = associated(original%ref, reference%ref) .and. associated(declared%ref, reference_to_declared%ref)
109109
end block
110-
#ifndef XLF
110+
#if !defined(XLF) && !defined(_CRAYFTN)
111111
end associate
112112
#endif
113113

0 commit comments

Comments
 (0)