From 374cd24fb268c452c613c77b84fa5fb0410737c9 Mon Sep 17 00:00:00 2001 From: zaikunzhang Date: Wed, 1 May 2024 20:06:29 +0800 Subject: [PATCH 1/2] 240501.200629.HKT test CMakeLists.txt regarding `PRIMA_HEAP_ARRAYS` --- .github/workflows/cmake.yml | 44 +++++++++++++------------- .github/workflows/cmake_mac.yml | 2 +- .github/workflows/cmake_mac_nagfor.yml | 4 +-- .github/workflows/cmake_nagfor.yml | 2 +- .github/workflows/cmake_pi.yml | 8 ++--- CMakeLists.txt | 16 +++++----- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 1a405bdc0b..00769638ca 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -34,12 +34,12 @@ jobs: # First define the toolchains on Linux and macOS. os: [ubuntu-latest, macos-12, macos-13] toolchain: - - {compiler: gcc, version: 11, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'} - - {compiler: gcc, version: 12, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'} - - {compiler: gcc, version: 13, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'} - - {compiler: intel-classic, version: '2021.8', cflags: '-diag-disable=10441 -Wall -w3 -Werror-all', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'} - - {compiler: intel-classic, version: '2021.9', cflags: '-diag-disable=10441 -Wall -w3 -Werror-all', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'} - - {compiler: intel-classic, version: '2021.10', cflags: '-diag-disable=10441 -Wall -w3 -Werror-all', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'} + - {compiler: gcc, version: 11, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -fcheck=all -fstack-check -Wno-function-elimination'} + - {compiler: gcc, version: 12, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -fcheck=all -fstack-check -Wno-function-elimination'} + - {compiler: gcc, version: 13, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -fcheck=all -fstack-check -Wno-function-elimination'} + - {compiler: intel-classic, version: '2021.8', cflags: '-diag-disable=10441 -Wall -w3 -Werror-all', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics'} + - {compiler: intel-classic, version: '2021.9', cflags: '-diag-disable=10441 -Wall -w3 -Werror-all', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics'} + - {compiler: intel-classic, version: '2021.10', cflags: '-diag-disable=10441 -Wall -w3 -Werror-all', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics'} include: # intel compiler (ifx) does not support macOS. So they are not included above but below. @@ -48,19 +48,19 @@ jobs: # compiler, but the (new) intel c compiler does not recognize '-W3 -Werror-all', even though the # official documentation of the compiler mentions them. Why? - os: ubuntu-latest - toolchain: {compiler: intel, version: '2023.2', cflags: '-Wall -Werror', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'} + toolchain: {compiler: intel, version: '2023.2', cflags: '-Wall -Werror', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics'} - os: ubuntu-latest - toolchain: {compiler: intel, version: '2024.0', cflags: '-Wall -Werror', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'} + toolchain: {compiler: intel, version: '2024.0', cflags: '-Wall -Werror', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics'} - os: ubuntu-latest - toolchain: {compiler: intel, version: '2024.1', cflags: '-Wall -Werror', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics -assume recursion'} + toolchain: {compiler: intel, version: '2024.1', cflags: '-Wall -Werror', fflags: '-warn all -debug extended -fimplicit-none -standard-semantics'} # What follows contains the toolchains for Windows, including gcc, intel classic, and intel. - os: windows-latest - toolchain: {compiler: gcc, version: 11, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'} + toolchain: {compiler: gcc, version: 11, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -fcheck=all -fstack-check -Wno-function-elimination'} - os: windows-latest - toolchain: {compiler: gcc, version: 12, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'} + toolchain: {compiler: gcc, version: 12, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -fcheck=all -fstack-check -Wno-function-elimination'} - os: windows-latest - toolchain: {compiler: gcc, version: 13, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'} + toolchain: {compiler: gcc, version: 13, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-Wall -Wextra -Wpedantic -Werror -fimplicit-none -fcheck=all -fstack-check -Wno-function-elimination'} # Zaikun 20240423: # 1. On windows-latest, the cflags will not be recognized correctly if we start them with `/` instead # of `-`, even though the former aligns with the official documentation of the compilers. Why? @@ -68,21 +68,21 @@ jobs: # compiler, but the (new) intel c compiler does not recognize '-W5 -Werror-all', even though the # official documentation of the compiler mentions them. Why? - os: windows-latest - toolchain: {compiler: intel, version: '2023.2', cflags: '-Wall -Werror', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'} + toolchain: {compiler: intel, version: '2023.2', cflags: '-Wall -Werror', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics'} - os: windows-latest - toolchain: {compiler: intel, version: '2024.0', cflags: '-Wall -Werror', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'} + toolchain: {compiler: intel, version: '2024.0', cflags: '-Wall -Werror', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics'} - os: windows-latest - toolchain: {compiler: intel, version: '2024.1', cflags: '-Wall -Werror', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'} + toolchain: {compiler: intel, version: '2024.1', cflags: '-Wall -Werror', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics'} - os: windows-latest - toolchain: {compiler: intel, version: '2024.1', cflags: '-Wall -W4 -WX', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion', cc: cl} + toolchain: {compiler: intel, version: '2024.1', cflags: '-Wall -W4 -WX', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics', cc: cl} # N.B.: As of 20240401, setup-fortran fails constantly with windows-latest and intel-classic # 2021.8. Thus this combination is not included. - os: windows-latest - toolchain: {compiler: intel-classic, version: '2021.9', cflags: '-Qdiag-disable:10441 -Wall -W5 -Werror-all', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'} + toolchain: {compiler: intel-classic, version: '2021.9', cflags: '-Qdiag-disable:10441 -Wall -W5 -Werror-all', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics'} - os: windows-latest - toolchain: {compiler: intel-classic, version: '2021.10', cflags: '-Qdiag-disable:10441 -Wall -W5 -Werror-all', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion'} + toolchain: {compiler: intel-classic, version: '2021.10', cflags: '-Qdiag-disable:10441 -Wall -W5 -Werror-all', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics'} - os: windows-latest - toolchain: {compiler: intel-classic, version: '2021.10', cflags: '-Wall -W4 -WX', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics /assume:recursion', cc: cl} + toolchain: {compiler: intel-classic, version: '2021.10', cflags: '-Wall -W4 -WX', fflags: '/warn:all /debug:extended /Z7 /fimplicit-none /standard-semantics', cc: cl} steps: @@ -168,9 +168,9 @@ jobs: toolchain: # Classic Flang family with -Mchkptr would fail. See https://forums.developer.nvidia.com/t/bug-in-nvfortran-with-mchkptr-for-unallocated-optional-arguments/223220 # As of 20240220, aflang with -Mbounds would fail due to the bug at https://github.com/flang-compiler/flang/issues/1238 - - {compiler: nvfortran, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-C -Wall -Wextra -Minform=warn -Mstandard -Mrecursive -Mbounds -Mchkstk'} - - {compiler: flang, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-std=f2018 -pedantic -fimplicit-none -Werror -fno-stack-arrays -mmlir -fdynamic-heap-array'} - - {compiler: aflang, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-pedantic -Weverything -Wall -Wextra -Minform=warn -Mstandard -Mrecursive'} + - {compiler: nvfortran, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-C -Wall -Wextra -Minform=warn -Mstandard -Mbounds -Mchkstk'} + - {compiler: flang, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-std=f2018 -pedantic -fimplicit-none -Werror'} + - {compiler: aflang, cflags: '-Wall -Wextra -Wpedantic -Werror', fflags: '-pedantic -Weverything -Wall -Wextra -Minform=warn -Mstandard'} steps: diff --git a/.github/workflows/cmake_mac.yml b/.github/workflows/cmake_mac.yml index 57f4f2ed3e..cf023aed31 100644 --- a/.github/workflows/cmake_mac.yml +++ b/.github/workflows/cmake_mac.yml @@ -69,7 +69,7 @@ jobs: CFLAGS="-Wall -Wextra -Wpedantic -Werror" export FC=${{ matrix.fc }} - export FFLAGS='-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination' + export FFLAGS='-Wall -Wextra -Wpedantic -Werror -fimplicit-none -fcheck=all -fstack-check -Wno-function-elimination' $FC --version $CC --version diff --git a/.github/workflows/cmake_mac_nagfor.yml b/.github/workflows/cmake_mac_nagfor.yml index 1cf506db5a..d6b167c49d 100644 --- a/.github/workflows/cmake_mac_nagfor.yml +++ b/.github/workflows/cmake_mac_nagfor.yml @@ -65,11 +65,11 @@ jobs: export FC="nagfor" source ~/local/bin/nag_licensing || echo "\n\nNAG licensing failed.\n\n" - export FFLAGS='-fpp -nan -ieee=stop -recursive -gline -u -C -C=alias -C=dangling -C=intovf -kind=unique -Warn=constant_coindexing -Warn=subnormal' + export FFLAGS='-fpp -nan -ieee=stop -gline -u -C -C=alias -C=dangling -C=intovf -kind=unique -Warn=constant_coindexing -Warn=subnormal' # Zaikun 20240121: With gcc 13.2 or AppleClang 1.5.0 and nagfor 7.1.7143, if '-C=undefined' # is included in FFLAGS, then the C tests will encounter a segmentation fault, although # the Fortran tests work correctly. - #export FFLAGS='-fpp -nan -ieee=stop -recursive -gline -u -C -C=alias -C=dangling -C=intovf -C=undefined -kind=unique -Warn=constant_coindexing -Warn=subnormal' + #export FFLAGS='-fpp -nan -ieee=stop -gline -u -C -C=alias -C=dangling -C=intovf -C=undefined -kind=unique -Warn=constant_coindexing -Warn=subnormal' $FC -V $CC --version diff --git a/.github/workflows/cmake_nagfor.yml b/.github/workflows/cmake_nagfor.yml index 2bf3a4e6bb..a8cb04cdf5 100644 --- a/.github/workflows/cmake_nagfor.yml +++ b/.github/workflows/cmake_nagfor.yml @@ -62,7 +62,7 @@ jobs: if [[ -n "${{ github.event.inputs.fflags }}" ]]; then export FFLAGS="${{ github.event.inputs.fflags }}" else - export FFLAGS='-fpp -nan -ieee=stop -recursive -gline -u -C -C=alias -C=dangling -C=intovf -kind=unique -Warn=constant_coindexing -Warn=subnormal' + export FFLAGS='-fpp -nan -ieee=stop -gline -u -C -C=alias -C=dangling -C=intovf -kind=unique -Warn=constant_coindexing -Warn=subnormal' # Zaikun 20240121: With gcc 13.2 or AppleClang 1.5.0 and nagfor 7.1.7143, if '-C=undefined' # is included in FFLAGS, then the C tests will encounter a segmentation fault, although # the Fortran tests work correctly. According to NAG support, -C=undefined "is not compatible with calling C code via a BIND(C) interface". diff --git a/.github/workflows/cmake_pi.yml b/.github/workflows/cmake_pi.yml index fd7c59d355..4d474a2b70 100644 --- a/.github/workflows/cmake_pi.yml +++ b/.github/workflows/cmake_pi.yml @@ -28,12 +28,12 @@ jobs: fail-fast: false matrix: toolchain: - - {fc: gfortran, fflags: '-Wall -Wextra -Wpedantic -Werror -pedantic -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'} + - {fc: gfortran, fflags: '-Wall -Wextra -Wpedantic -Werror -pedantic -fimplicit-none -fcheck=all -fstack-check -Wno-function-elimination'} # Flang family with -Mchkptr would fail. See https://forums.developer.nvidia.com/t/bug-in-nvfortran-with-mchkptr-for-unallocated-optional-arguments/223220 # As of 20240220, flang and armflang with -Mbounds would fail due to the bug at https://github.com/flang-compiler/flang/issues/1238 - - {fc: nvfortran, fflags: '-C -Wall -Wextra -Minform=warn -Mstandard -Mrecursive -Mbounds -Mchkstk'} - - {fc: flang, fflags: '-pedantic -Weverything -Wall -Wextra -Minform=warn -Mstandard -Mrecursive'} - - {fc: armflang, fflags: '-pedantic -Weverything -Wall -Wextra -Minform=warn -Mstandard -Mrecursive'} + - {fc: nvfortran, fflags: '-C -Wall -Wextra -Minform=warn -Mstandard -Mbounds -Mchkstk'} + - {fc: flang, fflags: '-pedantic -Weverything -Wall -Wextra -Minform=warn -Mstandard'} + - {fc: armflang, fflags: '-pedantic -Weverything -Wall -Wextra -Minform=warn -Mstandard'} steps: diff --git a/CMakeLists.txt b/CMakeLists.txt index 9344d0d3d6..f0fdc18565 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,24 +23,24 @@ endif () option (PRIMA_HEAP_ARRAYS "allocate arrays on heap" ON) if (PRIMA_HEAP_ARRAYS) if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU") # gfortran - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-stack-arrays -frecursive") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -fno-stack-arrays -frecursive") elseif (CMAKE_Fortran_COMPILER_ID MATCHES "Intel|IntelLLVM") # Intel compilers if (WIN32) - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /heap-arrays /assume:recursion") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST /heap-arrays /assume:recursion") else () - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -heap-arrays -assume recursion") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -heap-arrays -assume recursion") endif () elseif (CMAKE_Fortran_COMPILER_ID MATCHES "NAG") # nagfor - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive") # What about stack/heap? + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -recursive") # What about stack/heap? elseif (CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang") # flang-new # See https://github.com/llvm/llvm-project/issues/88344 - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-stack-arrays -mmlir -fdynamic-heap-array") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -fno-stack-arrays -mmlir -fdynamic-heap-array") elseif (CMAKE_Fortran_COMPILER_ID MATCHES "Flang") # Classic Flang - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -Mrecursive") elseif (CMAKE_Fortran_COMPILER_ID MATCHES "ARMClang") # ARM Flang - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-stack-arrays -Mrecursive") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -fno-stack-arrays -Mrecursive") elseif (CMAKE_Fortran_COMPILER_ID MATCHES "NVHPC") # nvfortran - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mnostack_arrays -Mrecursive") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -Mnostack_arrays -Mrecursive") endif () endif () From dd76e8ba5fb1d61c83c64d299668662b92a69e61 Mon Sep 17 00:00:00 2001 From: zaikunzhang Date: Wed, 1 May 2024 20:31:57 +0800 Subject: [PATCH 2/2] 240501.203157.HKT add `verbose-makefile` to the cmake workflow dispatch options --- .github/workflows/cmake.yml | 19 ++++++++++++++++--- .github/workflows/cmake_mac.yml | 12 ++++++++++-- .github/workflows/cmake_mac_nagfor.yml | 11 ++++++++++- .github/workflows/cmake_nagfor.yml | 12 ++++++++++-- .github/workflows/cmake_pi.yml | 12 ++++++++++-- CMakeLists.txt | 16 ++++++++-------- 6 files changed, 64 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 00769638ca..a6d892076b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -13,9 +13,12 @@ on: stress-test: description: Stress Test (Optional, true or false) required: false + verbose-makefile: + description: Verbose Makefile (Optional, true or false) + required: false # Show the git ref in the workflow name if it is invoked manually. -run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}', inputs.git-ref, inputs.stress-test) || '' }} +run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}, {2}', inputs.git-ref, inputs.stress-test, inputs.verbose-makefile) || '' }} permissions: @@ -144,7 +147,12 @@ jobs: run: | cmake --version - cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${{ matrix.toolchain.cflags }}" -DCMAKE_Fortran_FLAGS="${{ matrix.toolchain.fflags }}" . + VERBOSE_MAKEFILE=OFF + if [[ ${{ github.event.inputs.verbose-makefile }} == 'true' ]] ; then + VERBOSE_MAKEFILE=ON + fi + + cmake -G Ninja -DCMAKE_VERBOSE_MAKEFILE:BOOL=$VERBOSE_MAKEFILE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${{ matrix.toolchain.cflags }}" -DCMAKE_Fortran_FLAGS="${{ matrix.toolchain.fflags }}" . cmake --build . --target install cmake --build . --target tests ctest --output-on-failure -V -E stress @@ -211,7 +219,12 @@ jobs: #$CC --version cmake --version - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${{ matrix.toolchain.cflags }}" -DCMAKE_Fortran_FLAGS="${{ matrix.toolchain.fflags }}" . + VERBOSE_MAKEFILE=OFF + if [[ ${{ github.event.inputs.verbose-makefile }} == 'true' ]] ; then + VERBOSE_MAKEFILE=ON + fi + + cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=$VERBOSE_MAKEFILE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${{ matrix.toolchain.cflags }}" -DCMAKE_Fortran_FLAGS="${{ matrix.toolchain.fflags }}" . cmake --build . --target install cmake --build . --target tests diff --git a/.github/workflows/cmake_mac.yml b/.github/workflows/cmake_mac.yml index cf023aed31..8c887f5397 100644 --- a/.github/workflows/cmake_mac.yml +++ b/.github/workflows/cmake_mac.yml @@ -16,9 +16,12 @@ on: stress-test: description: Stress Test (Optional, true or false) required: false + verbose-makefile: + description: Verbose Makefile (Optional, true or false) + required: false # Show the git ref in the workflow name if it is invoked manually. -run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}', inputs.git-ref, inputs.stress-test) || '' }} +run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}, {2}', inputs.git-ref, inputs.stress-test, inputs.verbose-makefile) || '' }} permissions: @@ -75,7 +78,12 @@ jobs: $CC --version cmake --version - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" . + VERBOSE_MAKEFILE=OFF + if [[ ${{ github.event.inputs.verbose-makefile }} == 'true' ]] ; then + VERBOSE_MAKEFILE=ON + fi + + cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=$VERBOSE_MAKEFILE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" . cmake --build . --target install cmake --build . --target tests ctest --output-on-failure -V -E stress diff --git a/.github/workflows/cmake_mac_nagfor.yml b/.github/workflows/cmake_mac_nagfor.yml index d6b167c49d..6f0e8df422 100644 --- a/.github/workflows/cmake_mac_nagfor.yml +++ b/.github/workflows/cmake_mac_nagfor.yml @@ -16,6 +16,9 @@ on: stress-test: description: Stress Test (Optional, true or false) required: false + verbose-makefile: + description: Verbose Makefile (Optional, true or false) + required: false # Show the git ref in the workflow name if it is invoked manually. run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}', inputs.git-ref, inputs.stress-test) || '' }} @@ -74,7 +77,13 @@ jobs: $FC -V $CC --version cmake --version - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" . + + VERBOSE_MAKEFILE=OFF + if [[ ${{ github.event.inputs.verbose-makefile }} == 'true' ]] ; then + VERBOSE_MAKEFILE=ON + fi + + cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=$VERBOSE_MAKEFILE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" . cmake --build . --target install cmake --build . --target tests ctest --output-on-failure -V -E stress diff --git a/.github/workflows/cmake_nagfor.yml b/.github/workflows/cmake_nagfor.yml index a8cb04cdf5..6be31be203 100644 --- a/.github/workflows/cmake_nagfor.yml +++ b/.github/workflows/cmake_nagfor.yml @@ -19,9 +19,12 @@ on: fflags: description: FFLAGS required: false + verbose-makefile: + description: Verbose Makefile (Optional, true or false) + required: false # Show the git ref in the workflow name if it is invoked manually. -run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}', inputs.git-ref, inputs.stress-test) || '' }} +run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}, {2}', inputs.git-ref, inputs.stress-test, inputs.verbose-makefile) || '' }} permissions: @@ -72,7 +75,12 @@ jobs: $CC --version cmake --version - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" . + VERBOSE_MAKEFILE=OFF + if [[ ${{ github.event.inputs.verbose-makefile }} == 'true' ]] ; then + VERBOSE_MAKEFILE=ON + fi + + cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=$VERBOSE_MAKEFILE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" . cmake --build . --target install cmake --build . --target tests ctest --output-on-failure -V -E stress diff --git a/.github/workflows/cmake_pi.yml b/.github/workflows/cmake_pi.yml index 4d474a2b70..23c268fbd7 100644 --- a/.github/workflows/cmake_pi.yml +++ b/.github/workflows/cmake_pi.yml @@ -12,9 +12,12 @@ on: stress-test: description: Stress Test (Optional, true or false) required: false + verbose-makefile: + description: Verbose Makefile (Optional, true or false) + required: false # Show the git ref in the workflow name if it is invoked manually. -run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}', inputs.git-ref, inputs.stress-test) || '' }} +run-name: ${{ github.event_name == 'workflow_dispatch' && format('Manual run {0} , {1}, {2}', inputs.git-ref, inputs.stress-test, inputs.verbose-makefile) || '' }} permissions: @@ -70,7 +73,12 @@ jobs: $CC --version cmake --version - cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" . + VERBOSE_MAKEFILE=OFF + if [[ ${{ github.event.inputs.verbose-makefile }} == 'true' ]] ; then + VERBOSE_MAKEFILE=ON + fi + + cmake -G Ninja -DCMAKE_VERBOSE_MAKEFILE:BOOL=$VERBOSE_MAKEFILE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" . cmake --build . --target install cmake --build . --target tests diff --git a/CMakeLists.txt b/CMakeLists.txt index f0fdc18565..9344d0d3d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,24 +23,24 @@ endif () option (PRIMA_HEAP_ARRAYS "allocate arrays on heap" ON) if (PRIMA_HEAP_ARRAYS) if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU") # gfortran - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -fno-stack-arrays -frecursive") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-stack-arrays -frecursive") elseif (CMAKE_Fortran_COMPILER_ID MATCHES "Intel|IntelLLVM") # Intel compilers if (WIN32) - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST /heap-arrays /assume:recursion") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /heap-arrays /assume:recursion") else () - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -heap-arrays -assume recursion") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -heap-arrays -assume recursion") endif () elseif (CMAKE_Fortran_COMPILER_ID MATCHES "NAG") # nagfor - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -recursive") # What about stack/heap? + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -recursive") # What about stack/heap? elseif (CMAKE_Fortran_COMPILER_ID MATCHES "LLVMFlang") # flang-new # See https://github.com/llvm/llvm-project/issues/88344 - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -fno-stack-arrays -mmlir -fdynamic-heap-array") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-stack-arrays -mmlir -fdynamic-heap-array") elseif (CMAKE_Fortran_COMPILER_ID MATCHES "Flang") # Classic Flang - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -Mrecursive") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mrecursive") elseif (CMAKE_Fortran_COMPILER_ID MATCHES "ARMClang") # ARM Flang - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -fno-stack-arrays -Mrecursive") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-stack-arrays -Mrecursive") elseif (CMAKE_Fortran_COMPILER_ID MATCHES "NVHPC") # nvfortran - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} TEST_TEST -Mnostack_arrays -Mrecursive") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Mnostack_arrays -Mrecursive") endif () endif ()