CMAKE: Remove host cpu tuning options.

It help with cross compilation and these flags can be added from the
command line, e.g., using
cmake <source_path> -DCMAKE_Fortran_FLAGS="-march=native".

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2023-04-01 23:25:03 -03:00
parent 271dd571ae
commit ebfca7e92c

View File

@ -19,13 +19,13 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
endif() endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
add_compile_options("$<$<CONFIG:RELEASE>:-march=native;-pipe;-fno-tree-vectorize;-fno-unsafe-math-optimizations;-frounding-math;-fsignaling-nans;-finline-limit=10000;-fdiagnostics-color=always>") add_compile_options("$<$<CONFIG:RELEASE>:-pipe;-fno-tree-vectorize;-fno-unsafe-math-optimizations;-frounding-math;-fsignaling-nans;-finline-limit=10000;-fdiagnostics-color=always>")
add_compile_options("$<$<CONFIG:DEBUG>:-Og;-pedantic;-fcheck=all;-W;-Wall;-Wno-unused-dummy-argument>") add_compile_options("$<$<CONFIG:DEBUG>:-Og;-pedantic;-fcheck=all;-W;-Wall;-Wno-unused-dummy-argument>")
endif() endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
add_compile_options("$<$<CONFIG:RELEASE>:-xHost;-fp-model=source;-heap-arrays;-ip;-unroll-aggressive;-simd;-qopt-prefetch;-use-intel-optimized-headers;-finline-limit=1000;-fno-omit-frame-pointer>") add_compile_options("$<$<CONFIG:RELEASE>:-fp-model=source;-heap-arrays;-ip;-unroll-aggressive;-simd;-qopt-prefetch;-use-intel-optimized-headers;-finline-limit=1000;-fno-omit-frame-pointer>")
add_compile_options("$<$<CONFIG:DEBUG>:-O>") add_compile_options("$<$<CONFIG:DEBUG>:-O>")
add_compile_options(-assume byterecl) add_compile_options("-assume byterecl")
endif() endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES "PGI") if(CMAKE_Fortran_COMPILER_ID MATCHES "PGI")
add_compile_options("$<$<CONFIG:RELEASE>:-fastsse;-O4;-Mvect=simd;-Minline=maxsize:1000>") add_compile_options("$<$<CONFIG:RELEASE>:-fastsse;-O4;-Mvect=simd;-Minline=maxsize:1000>")