From 39a466758e4c482be45c1bf52c36a62fdbcb00a6 Mon Sep 17 00:00:00 2001 From: zaikunzhang Date: Mon, 22 Jan 2024 02:56:57 +0800 Subject: [PATCH] 240122.025657.HKT fix failure of cmake on macOS ARM64 --- .github/workflows/cmake_mac.yml | 10 +++++++--- .github/workflows/cmake_nagfor.yml | 10 +++++----- fortran/examples/bobyqa/Makefile | 2 +- fortran/examples/cobyla/Makefile | 2 +- fortran/examples/lincoa/Makefile | 2 +- fortran/examples/newuoa/Makefile | 2 +- fortran/examples/uobyqa/Makefile | 2 +- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cmake_mac.yml b/.github/workflows/cmake_mac.yml index 4f47add2e9..c4fd4fec69 100644 --- a/.github/workflows/cmake_mac.yml +++ b/.github/workflows/cmake_mac.yml @@ -63,11 +63,15 @@ jobs: run: | export CC=${{ matrix.cc }} export CFLAGS='-Wall -Wextra -Wpedantic -Werror' - export FC=${{ matrix.fc }} - if [[ "$FC"=="nagfor" ]] ; then + export FC=${{ matrix.fc }} + if [[ "$FC" == "nagfor" ]] ; then source ~/local/bin/nag_licensing || echo "\n\nNAG licensing failed.\n\n" - 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 FFLAGS='-fpp -nan -ieee=stop -recursive -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' else export FFLAGS='-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination' fi diff --git a/.github/workflows/cmake_nagfor.yml b/.github/workflows/cmake_nagfor.yml index feaab56694..ab10247124 100644 --- a/.github/workflows/cmake_nagfor.yml +++ b/.github/workflows/cmake_nagfor.yml @@ -58,11 +58,11 @@ jobs: 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' + export FFLAGS='-fpp -nan -ieee=stop -recursive -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' fi cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" . cmake --build . --target install diff --git a/fortran/examples/bobyqa/Makefile b/fortran/examples/bobyqa/Makefile index d3da5ad7ca..c832589f05 100644 --- a/fortran/examples/bobyqa/Makefile +++ b/fortran/examples/bobyqa/Makefile @@ -61,7 +61,7 @@ ftest: FC := flang -Wall -Wextra -std=f$(FSTD) -Mstandard gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics # Intel ifort -itest: FC := ifort -warn all -stand f$(FS) +itest: FC := ifort -warn all -stand f$(FS) -diag-disable=10448 # 10448: suppress the warning about deprecation of ifort. # NAG nagfor ntest: FC := nagfor -C -f$(FSTD) -fpp # As of nagfor 7.1, -fpp is needed on macOS and Windows, but not on Linux. diff --git a/fortran/examples/cobyla/Makefile b/fortran/examples/cobyla/Makefile index 87aa8e4369..7407fe01db 100644 --- a/fortran/examples/cobyla/Makefile +++ b/fortran/examples/cobyla/Makefile @@ -61,7 +61,7 @@ ftest: FC := flang -Wall -Wextra -std=f$(FSTD) -Mstandard gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics # Intel ifort -itest: FC := ifort -warn all -stand f$(FS) +itest: FC := ifort -warn all -stand f$(FS) -diag-disable=10448 # 10448: suppress the warning about deprecation of ifort. # NAG nagfor ntest: FC := nagfor -C -f$(FSTD) -fpp # As of nagfor 7.1, -fpp is needed on macOS and Windows, but not on Linux. diff --git a/fortran/examples/lincoa/Makefile b/fortran/examples/lincoa/Makefile index fc8e4206ec..cbccc90776 100644 --- a/fortran/examples/lincoa/Makefile +++ b/fortran/examples/lincoa/Makefile @@ -61,7 +61,7 @@ ftest: FC := flang -Wall -Wextra -std=f$(FSTD) -Mstandard gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics # Intel ifort -itest: FC := ifort -warn all -stand f$(FS) +itest: FC := ifort -warn all -stand f$(FS) -diag-disable=10448 # 10448: suppress the warning about deprecation of ifort. # NAG nagfor ntest: FC := nagfor -C -f$(FSTD) -fpp # As of nagfor 7.1, -fpp is needed on macOS and Windows, but not on Linux. diff --git a/fortran/examples/newuoa/Makefile b/fortran/examples/newuoa/Makefile index 2299fe56c2..b07b35d79f 100644 --- a/fortran/examples/newuoa/Makefile +++ b/fortran/examples/newuoa/Makefile @@ -61,7 +61,7 @@ ftest: FC := flang -Wall -Wextra -std=f$(FSTD) -Mstandard gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics # Intel ifort -itest: FC := ifort -warn all -stand f$(FS) +itest: FC := ifort -warn all -stand f$(FS) -diag-disable=10448 # 10448: suppress the warning about deprecation of ifort. # NAG nagfor ntest: FC := nagfor -C -f$(FSTD) -fpp # As of nagfor 7.1, -fpp is needed on macOS and Windows, but not on Linux. diff --git a/fortran/examples/uobyqa/Makefile b/fortran/examples/uobyqa/Makefile index a018cb8c60..26dd6e2a96 100644 --- a/fortran/examples/uobyqa/Makefile +++ b/fortran/examples/uobyqa/Makefile @@ -61,7 +61,7 @@ ftest: FC := flang -Wall -Wextra -std=f$(FSTD) -Mstandard gtest: FC := gfortran -Wall -Wextra -Wno-function-elimination -std=f$(FSTD) -fall-intrinsics # Intel ifort -itest: FC := ifort -warn all -stand f$(FS) +itest: FC := ifort -warn all -stand f$(FS) -diag-disable=10448 # 10448: suppress the warning about deprecation of ifort. # NAG nagfor ntest: FC := nagfor -C -f$(FSTD) -fpp # As of nagfor 7.1, -fpp is needed on macOS and Windows, but not on Linux.