Skip to content

Commit

Permalink
240501.203157.HKT add verbose-makefile to the cmake workflow dispat…
Browse files Browse the repository at this point in the history
…ch options
  • Loading branch information
zaikunzhang committed May 1, 2024
1 parent 374cd24 commit dd76e8b
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 18 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/cmake_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/cmake_mac_nagfor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) || '' }}
Expand Down Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/cmake_nagfor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/cmake_pi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

Expand Down

0 comments on commit dd76e8b

Please sign in to comment.