Skip to content

Commit 8e715cb

Browse files
committed
260210.120955.CET [skip ci] revise comments in CMakelist.txt and fortran/example/README.txt
1 parent 12d7f53 commit 8e715cb

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ endif ()
2424
# 0. See https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER_ID.html for compiler IDs.
2525
# 1. We require the compilers to allocate arrays on the heap instead of the stack, which is
2626
# slower (does not matter for DFO applications) but can avoid memory errors on large problems.
27+
# The compiler flags for heap arrays are as follows:
28+
# - AMD AOCC Flang: -fno-stack-arrays
29+
# - AMD AOMP Flang: -fno-stack-arrays -mmlir -fdynamic-heap-array (-fno-stack-arrays insufficient as of AMOP 22.0)
30+
# - Arm Fortran Compiler: -fno-stack-arrays -mmlir -fdynamic-heap-array (-fno-stack-arrays insufficient as of ATfL 21.1)
31+
# - LLVM Flang: -fno-stack-arrays -mmlir -fdynamic-heap-array (-fno-stack-arrays insufficient as of LLVM 21.1.8)
32+
# - GNU gfortran: -fno-stack-arrays
33+
# - Intel ifx: -heap-arrays
34+
# - Intel ifort: -heap-arrays
35+
# - NVIDIA nvfortran: -Mnostack_arrays
36+
# - NAG Fortran Compiler: Not needed. According to the NAG support, "the behaviour of nagfor is for
37+
# small fixed-size arrays to go on the stack, and for variable-size arrays and fixed-size arrays to
38+
# go on the heap".
2739
# 2. We require the compilers to compile the solvers so that they can be called recursively.
2840
# See https://fortran-lang.discourse.group/t/frecursive-assume-recursion-and-recursion-thread-safety
2941
# 3. Zaikun 20260206: Is the ID for ARM Flang correct? What about the AMD AOMP Flang? See

fortran/examples/README.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ implementation of Powell's derivative-free optimization solvers.
33

44
N.B.:
55

6-
0. In real applications, if the dimension of the problem is big (e.g., more than 100), then
7-
compilers should be instructed to compile PRIMA with the automatic arrays allocated on the heap.
8-
Otherwise, those arrays may be allocated on the stack, which may lead to stack overflow. Since
9-
PRIMA is designed to solve problems with expensive function evaluations, we do not worry about
10-
the performance of heap arrays.
6+
0. In production, if the dimension of the problem is big (e.g., more than 100), then compilers
7+
should be instructed to compile PRIMA with the automatic arrays allocated on the heap. Otherwise,
8+
those arrays may be allocated on the stack, which may lead to stack overflow. Since PRIMA is
9+
designed to solve problems with expensive function evaluations, we do not worry about the
10+
performance of heap arrays.
1111

1212
The compiler flags for heap arrays are as follows:
1313
- AMD AOCC Flang: -fno-stack-arrays
@@ -17,8 +17,10 @@ The compiler flags for heap arrays are as follows:
1717
- GNU gfortran: -fno-stack-arrays
1818
- Intel ifx: -heap-arrays
1919
- Intel ifort: -heap-arrays
20-
- NAG Fortran Compiler: NO (unknown)
2120
- NVIDIA nvfortran: -Mnostack_arrays
21+
- NAG Fortran Compiler: Not needed. According to the NAG support, "the behaviour of nagfor is for
22+
small fixed-size arrays to go on the stack, and for variable-size arrays and fixed-size arrays to
23+
go on the heap".
2224

2325
If ever a segmentation fault occurs, check whether the above flags are used in the compilation.
2426

@@ -47,8 +49,8 @@ compliant with Fortran 2008 and above.
4749
- GNU gfortran 14.2
4850
- Intel ifx 2025.3
4951
- Intel ifort 2021.11.1
50-
- NAG Fortran Compiler Release 7.2(Shin-Urayasu) Build 7231
5152
- NVIDIA nvfortran 26.1
53+
- NAG Fortran Compiler Release 7.2(Shin-Urayasu) Build 7231
5254
The following discontinued compilers are not supported: Absoft af95, g95, Oracle sunf95.
5355

5456
Coded by Zaikun ZHANG (www.zhangzk.net).

0 commit comments

Comments
 (0)