Skip to content

Commit 61d267a

Browse files
committed
use -mtune=native as -march=native is not supported on all CPU arches
1 parent dac41b5 commit 61d267a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmake/compilers.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
99
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
1010
string(APPEND CMAKE_Fortran_FLAGS " -Wall -Wextra -fimplicit-none")
1111
string(APPEND CMAKE_Fortran_FLAGS_DEBUG " -fcheck=all -Werror=array-bounds")
12-
add_compile_options(-march=native)
12+
# -march=native is not for all CPU arches with GCC.
13+
add_compile_options(-mtune=native)
1314

1415
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 8)
1516
string(APPEND CMAKE_Fortran_FLAGS " -std=f2018")

0 commit comments

Comments
 (0)