From 03a07ceb4fe4cf8acbd1be7d2d58eeb5169e0530 Mon Sep 17 00:00:00 2001 From: zaikunzhang Date: Sun, 21 Jan 2024 19:19:38 +0800 Subject: [PATCH] 240121.191938.HKT remove -C=undefined from cmake_nagfor, as it will lead to segmentation fault for the C tests --- .github/workflows/cmake_nagfor.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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