File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,22 @@ macro(CheckLAPACKCompilerFlags)
5959 add_compile_definitions ("$<$<COMPILE_LANGUAGE:C>:FORTRAN_STRLEN=int>" )
6060 endif ()
6161
62+ # Disabling loop vectorization for GNU Fortran versions affected by
63+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122408. See issue
64+ # https://github.com/Reference-LAPACK/lapack/issues/1160 as well.
65+ if (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm|arm64|aarch64" )
66+ if ((CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "14.0" AND
67+ CMAKE_Fortran_COMPILER_VERSION VERSION_LESS_EQUAL "14.4" ) OR
68+ (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "15.0" AND
69+ CMAKE_Fortran_COMPILER_VERSION VERSION_LESS_EQUAL "15.2" ))
70+ message (WARNING
71+ "Disabling loop vectorization for GNU Fortran (14.0-14.4, 15.0-15.2) on ARM "
72+ "due to a compiler bug (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122408). "
73+ "For full performance, consider changing to a different compiler or compiler version." )
74+ add_compile_options ("$<$<COMPILE_LANGUAGE:Fortran>:-fno-tree-loop-vectorize>" )
75+ endif ()
76+ endif ()
77+
6278 # Intel Fortran
6379 elseif (CMAKE_Fortran_COMPILER_ID MATCHES "Intel" )
6480 set (FPE_EXIT_FLAG "[-/]fpe(-all=|)0" )
You can’t perform that action at this time.
0 commit comments