From 9896e43e238e0b49d2c67e47aca17476b4c77599 Mon Sep 17 00:00:00 2001 From: gareth Date: Sat, 21 May 2022 14:58:20 +1000 Subject: [PATCH 1/4] update doc to specify CMAKE options --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 366fb9f5e..2c1e68b19 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,8 @@ Important options are 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. - `-DBUILD_SHARED_LIBS` set to `on` in case you want link your application dynamically against the standard library (default: `off`). - `-DBUILD_TESTING` set to `off` in case you want to disable the stdlib tests (default: `on`). +- `-DCMAKE_BUILD_TYPE` is set to `NoConfig` by default. Set to `Release` to compile with standard optimizations, or `RelWithDebInfo` for standard options for development. Other values can be passed to avoid having the associated compiler flags being set. +- `-DCMAKE_VERBOSE_MAKEFILE` is by default set to `Off`, but if set to `On` will show the commands used to compile the code. For example, to configure a build using the Ninja backend while specifying compiler flags `FFLAGS`, generating procedures up to rank 7, and installing to your home directory, use From 95d7a1fae69f338b6dbe165df74644a2a30f7435 Mon Sep 17 00:00:00 2001 From: gareth Date: Sat, 21 May 2022 15:14:50 +1000 Subject: [PATCH 2/4] update doc --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2c1e68b19..692d74bda 100644 --- a/README.md +++ b/README.md @@ -133,14 +133,14 @@ Important options are 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. - `-DBUILD_SHARED_LIBS` set to `on` in case you want link your application dynamically against the standard library (default: `off`). - `-DBUILD_TESTING` set to `off` in case you want to disable the stdlib tests (default: `on`). -- `-DCMAKE_BUILD_TYPE` is set to `NoConfig` by default. Set to `Release` to compile with standard optimizations, or `RelWithDebInfo` for standard options for development. Other values can be passed to avoid having the associated compiler flags being set. -- `-DCMAKE_VERBOSE_MAKEFILE` is by default set to `Off`, but if set to `On` will show the commands used to compile the code. +- `-DCMAKE_VERBOSE_MAKEFILE` is by default set to `Off`, but if set to `On` will show commands used to compile the code. +- `-DCMAKE_BUILD_TYPE` is set to `NoConfig` by default. Set to `Release` to compile with standard optimizations, or `RelWithDebInfo` for standard code development options. Beware these options may override compiler flags that are specified via `FFLAGS`. To avoid this, use an unknown value such as `-DCMAKE_BUILD_TYPE=UnknownBuildType`. -For example, to configure a build using the Ninja backend while specifying compiler flags `FFLAGS`, generating procedures up to rank 7, and installing to your home directory, use +For example, to configure a build using the Ninja backend while specifying compiler flags via `FFLAGS`, generating procedures up to rank 7, installing to your home directory, using the `Release` compiler flags, and printing the compiler options, use ```sh export FFLAGS="-O3" -cmake -B build -G Ninja -DCMAKE_MAXIMUM_RANK:String=7 -DCMAKE_INSTALL_PREFIX=$HOME/.local +cmake -B build -G Ninja -DCMAKE_MAXIMUM_RANK:String=7 -DCMAKE_INSTALL_PREFIX=$HOME/.local -DCMAKE_VERBOSE_MAKEFILE=On -DCMAKE_BUILD_TYPE=Release ``` To build the standard library run From 5839d6517a50c1d55d1d93d54826028290aadef9 Mon Sep 17 00:00:00 2001 From: gareth Date: Sat, 21 May 2022 15:41:17 +1000 Subject: [PATCH 3/4] correction --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 692d74bda..11c99aea1 100644 --- a/README.md +++ b/README.md @@ -134,13 +134,13 @@ Important options are - `-DBUILD_SHARED_LIBS` set to `on` in case you want link your application dynamically against the standard library (default: `off`). - `-DBUILD_TESTING` set to `off` in case you want to disable the stdlib tests (default: `on`). - `-DCMAKE_VERBOSE_MAKEFILE` is by default set to `Off`, but if set to `On` will show commands used to compile the code. -- `-DCMAKE_BUILD_TYPE` is set to `NoConfig` by default. Set to `Release` to compile with standard optimizations, or `RelWithDebInfo` for standard code development options. Beware these options may override compiler flags that are specified via `FFLAGS`. To avoid this, use an unknown value such as `-DCMAKE_BUILD_TYPE=UnknownBuildType`. +- `-DCMAKE_BUILD_TYPE` is by default set to `RelWithDebInfo` which uses compiler flags suitable for code development (but with only `-O2` optimization). These options may override compiler flags that are specified via `FFLAGS`. To avoid this, use the value `-DCMAKE_BUILD_TYPE=NoConfig` in conjunction with `FFLAGS`. -For example, to configure a build using the Ninja backend while specifying compiler flags via `FFLAGS`, generating procedures up to rank 7, installing to your home directory, using the `Release` compiler flags, and printing the compiler options, use +For example, to configure a build using the Ninja backend while specifying compiler optimization via `FFLAGS`, generating procedures up to rank 7, installing to your home directory, using the `NoConfig` compiler flags, and printing the compiler commands, use ```sh export FFLAGS="-O3" -cmake -B build -G Ninja -DCMAKE_MAXIMUM_RANK:String=7 -DCMAKE_INSTALL_PREFIX=$HOME/.local -DCMAKE_VERBOSE_MAKEFILE=On -DCMAKE_BUILD_TYPE=Release +cmake -B build -G Ninja -DCMAKE_MAXIMUM_RANK:String=7 -DCMAKE_INSTALL_PREFIX=$HOME/.local -DCMAKE_VERBOSE_MAKEFILE=On -DCMAKE_BUILD_TYPE=NoConfig ``` To build the standard library run From c1291b9ea2c5c46414b10ac7f1a0180fb3c6c487 Mon Sep 17 00:00:00 2001 From: gareth Date: Sat, 21 May 2022 15:44:38 +1000 Subject: [PATCH 4/4] improve wording --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 11c99aea1..117159df2 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ Important options are - `-DBUILD_SHARED_LIBS` set to `on` in case you want link your application dynamically against the standard library (default: `off`). - `-DBUILD_TESTING` set to `off` in case you want to disable the stdlib tests (default: `on`). - `-DCMAKE_VERBOSE_MAKEFILE` is by default set to `Off`, but if set to `On` will show commands used to compile the code. -- `-DCMAKE_BUILD_TYPE` is by default set to `RelWithDebInfo` which uses compiler flags suitable for code development (but with only `-O2` optimization). These options may override compiler flags that are specified via `FFLAGS`. To avoid this, use the value `-DCMAKE_BUILD_TYPE=NoConfig` in conjunction with `FFLAGS`. +- `-DCMAKE_BUILD_TYPE` is by default set to `RelWithDebInfo`, which uses compiler flags suitable for code development (but with only `-O2` optimization). Beware the compiler flags set this way will override any compiler flags specified via `FFLAGS`. To prevent this, use `-DCMAKE_BUILD_TYPE=NoConfig` in conjunction with `FFLAGS`. For example, to configure a build using the Ninja backend while specifying compiler optimization via `FFLAGS`, generating procedures up to rank 7, installing to your home directory, using the `NoConfig` compiler flags, and printing the compiler commands, use