diff --git a/.github/workflows/cmake_nagfor.yml b/.github/workflows/cmake_nagfor.yml index 12d9fe8856..feaab56694 100644 --- a/.github/workflows/cmake_nagfor.yml +++ b/.github/workflows/cmake_nagfor.yml @@ -16,9 +16,6 @@ on: stress-test: description: Stress Test (Optional, true or false) required: false - cflags: - description: CFLAGS - required: false fflags: description: FFLAGS required: false @@ -56,11 +53,17 @@ jobs: - name: Conduct the test run: | source ~/local/bin/nag_licensing || echo "\n\nNAG licensing failed.\n\n" + export CFLAGS="-Wall -Wextra -Wpedantic -Werror" export FC=nagfor - #export FFLAGS='-fpp -nan -ieee=stop -recursive -info -gline -u -C -C=alias -C=dangling -C=intovf -C=undefined -kind=unique -Warn=constant_coindexing -Warn=subnormal' - #export CFLAGS='-Wall -Wextra -Wpedantic -Werror' - export FFLAGS="${{ github.event.inputs.fflags }}" - export CFLAGS="${{ github.event.inputs.cflags }}" + if [[ -n "${{ github.event.inputs.fflags }}" ]]; then + export FFLAGS="${{ github.event.inputs.fflags }}" + else + export FFLAGS='-fpp -nan -ieee=stop -recursive -info -gline -u -C -C=alias -C=dangling -C=intovf -kind=unique -Warn=constant_coindexing -Warn=subnormal' + # Zaikun 20240121: With gcc 11.4.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 -info -gline -u -C -C=alias -C=dangling -C=intovf -C=undefined -kind=unique -Warn=constant_coindexing -Warn=subnormal' + fi cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" . cmake --build . --target install cmake --build . --target tests