Skip to content

Commit 1c6b2ae

Browse files
authored
Make maximum rank an option (#440)
- set default value of 4 to reduce compilation load
1 parent 79ec20a commit 1c6b2ae

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ check_fortran_source_runs("i=0; error stop i; end" f18errorstop SRC_EXT f90)
4949
check_fortran_source_compiles("real, allocatable :: array(:, :, :, :, :, :, :, :, :, :); end" f03rank SRC_EXT f90)
5050
check_fortran_source_runs("use, intrinsic :: iso_fortran_env, only : real128; real(real128) :: x; x = x+1; end" f03real128)
5151

52-
if(DEFINED CMAKE_MAXIMUM_RANK)
53-
set(CMAKE_MAXIMUM_RANK ${CMAKE_MAXIMUM_RANK})
54-
endif()
52+
option(CMAKE_MAXIMUM_RANK "Maximum array rank for generated procedures" 4)
5553

5654
# --- find preprocessor
5755
find_program(FYPP fypp)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ Important options are
127127
- `-G Ninja` to use the Ninja backend instead of the default Make backend. Other build backends are available with a similar syntax.
128128
- `-DCMAKE_INSTALL_PREFIX` is used to provide the install location for the library.
129129
- `-DCMAKE_MAXIMUM_RANK` the maximum array rank procedures should be generated for.
130-
The default is 15 for Fortran 2003 compliant compilers, otherwise 7 for compilers not supporting Fortran 2003 completely yet.
130+
The default value is chosen as 4.
131+
The maximum is 15 for Fortran 2003 compliant compilers, otherwise 7 for compilers not supporting Fortran 2003 completely yet.
131132
The minimum required rank to compile this project is 4.
132133
Compiling with maximum rank 15 can be resource intensive and requires at least 16 GB of memory to allow parallel compilation or 4 GB memory for sequential compilation.
133134
- `-DBUILD_SHARED_LIBS` set to `on` in case you want link your application dynamically against the standard library (default: `off`).

0 commit comments

Comments
 (0)