From 75a614be30c0fc56cb74594d5d5ab189aeaea79c Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Sun, 27 Dec 2020 16:35:32 +0100 Subject: [PATCH 1/4] add note about RAM issues --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 90b3451ae..d2460b142 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ cmake --build build cmake --build build --target test ``` + + ### Build with make Alternatively, you can build using provided Makefiles: @@ -66,6 +68,25 @@ Alternatively, you can build using provided Makefiles: make -f Makefile.manual ``` +## Memory issues during compilation + +Some issues can be encountered during compilation on low RAM computers. +These issues are due to the high number of procedures generated by the preprocessor. +They can be avoided by limiting the maximum rank of generated procedures, as follows with `CMake`: + +```sh +cmake -B build + +cmake --build build -DCMAKE_MAXIMUM_RANK=4 + +cmake --build build --target test +``` +or as follows with `make`: + +```sh +make -f Makefile.manual FYPPFLAGS=-DMAXRANK=4 +``` + ## Documentation Documentation is a work in progress (see issue #4) but is currently available at https://stdlib.fortran-lang.org. From e314a28130e838aa39c8c08e9caa0f407864c14e Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Sun, 27 Dec 2020 16:38:51 +0100 Subject: [PATCH 2/4] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index d2460b142..04a3cc7f8 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,6 @@ cmake --build build cmake --build build --target test ``` - - ### Build with make Alternatively, you can build using provided Makefiles: From 9c6bbbe5214b1290032b604f0099f75cfa48225e Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Mon, 28 Dec 2020 08:54:35 +0100 Subject: [PATCH 3/4] Update README.md Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 04a3cc7f8..2f91db619 100644 --- a/README.md +++ b/README.md @@ -73,9 +73,9 @@ These issues are due to the high number of procedures generated by the preproces They can be avoided by limiting the maximum rank of generated procedures, as follows with `CMake`: ```sh -cmake -B build +cmake -B build -DCMAKE_MAXIMUM_RANK=4 -cmake --build build -DCMAKE_MAXIMUM_RANK=4 +cmake --build build cmake --build build --target test ``` From f9febba81c86e5e41c30a656becd6b20284000ad Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Mon, 28 Dec 2020 20:27:45 +0100 Subject: [PATCH 4/4] Apply suggestions from code review as proposed by @milancurcic Co-authored-by: Milan Curcic --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2f91db619..1931149e5 100644 --- a/README.md +++ b/README.md @@ -66,24 +66,24 @@ Alternatively, you can build using provided Makefiles: make -f Makefile.manual ``` -## Memory issues during compilation +## Limiting the maximum rank of generated procedures -Some issues can be encountered during compilation on low RAM computers. -These issues are due to the high number of procedures generated by the preprocessor. -They can be avoided by limiting the maximum rank of generated procedures, as follows with `CMake`: +Stdlib's preprocessor (fypp) by default generates specific procedures for arrays of all ranks, up to rank 15. +This can result in long compilation times and, on some computers, exceeding available memory. +If you know that you won't need all 15 ranks, you can specify the maximum rank for which the specific procedures will be generated. +For example, with CMake: ```sh cmake -B build -DCMAKE_MAXIMUM_RANK=4 - cmake --build build - -cmake --build build --target test +cmake --build build --target test ``` or as follows with `make`: ```sh make -f Makefile.manual FYPPFLAGS=-DMAXRANK=4 ``` +Note that currently the minimum value for maximum rank is 4. ## Documentation