Skip to content

Commit

Permalink
240122.025657.HKT fix failure of cmake on macOS ARM64
Browse files Browse the repository at this point in the history
  • Loading branch information
zaikunzhang committed Jan 21, 2024
1 parent 03a07ce commit 39a4667
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/cmake_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/cmake_nagfor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fortran/examples/bobyqa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion fortran/examples/cobyla/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion fortran/examples/lincoa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion fortran/examples/newuoa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion fortran/examples/uobyqa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 39a4667

Please sign in to comment.