From c06bce0ee0b4245f613d77643253bb6417ad3196 Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Fri, 11 Nov 2022 17:45:57 -0300 Subject: [PATCH] CMAKE: Allow enabling/disabling FMA only on x86_64 architecture. By default disable FMA on x86_64. Signed-off-by: Grzegorz Kowal --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f77a884..de7f1c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,8 @@ if(ENABLE_OPENMP) endif() endif() -option(DISABLE_FMA "Disable FMA operations for slightly slower, but symmetric floating-point arithmetics." OFF) +if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") +option(DISABLE_FMA "Disable FMA operations for slightly slower, but symmetric floating-point arithmetics." ON) if(DISABLE_FMA) if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") target_compile_options(amun.x PRIVATE "-mno-fma;-mno-fma4") @@ -91,6 +92,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "NVHPC") target_compile_options(amun.x PRIVATE "-Mnofma") endif() endif() +endif() option(ENABLE_SIGNALS "Enables signal handler support." ON) if(ENABLE_SIGNALS)