Skip to content

Commit

Permalink
use -mtune=native as -march=native is not supported on all CPU arches
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Mar 9, 2020
1 parent dac41b5 commit 61d267a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmake/compilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
string(APPEND CMAKE_Fortran_FLAGS " -Wall -Wextra -fimplicit-none")
string(APPEND CMAKE_Fortran_FLAGS_DEBUG " -fcheck=all -Werror=array-bounds")
add_compile_options(-march=native)
# -march=native is not for all CPU arches with GCC.
add_compile_options(-mtune=native)

if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 8)
string(APPEND CMAKE_Fortran_FLAGS " -std=f2018")
Expand Down

0 comments on commit 61d267a

Please sign in to comment.