From 16956b94b97ddd64ce585746dab60c30b30e5912 Mon Sep 17 00:00:00 2001 From: Olli Date: Sun, 23 Feb 2025 13:00:17 +0200 Subject: [PATCH] Replace '-Ofast', being deprecated in some compilers, with '-O3 -ffast-math' --- CMakeLists.txt | 3 ++- configure.ac | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fb803b..445b096 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,8 @@ else() if(EMSCRIPTEN) list(APPEND COMPILE_OPTIONS -O3) else() - list(APPEND COMPILE_OPTIONS -Ofast) + # Apply -ffast-math to allow compiler autovectorization generate effective SIMD code for arm compilation + list(APPEND COMPILE_OPTIONS -O3 -ffast-math) endif() endif() diff --git a/configure.ac b/configure.ac index 81163b8..0683dfc 100644 --- a/configure.ac +++ b/configure.ac @@ -31,9 +31,8 @@ AC_DISABLE_STATIC dnl This makes libtool only build shared libs AC_LANG(C++) -# Compiler flags. Apply -Ofast (implies -O3 -ffast-math) to allow gcc autovectorization -# generate effective SIMD code. -CXXFLAGS="${CXXFLAGS} -Ofast -Wall -Wextra -Wzero-as-null-pointer-constant -Wno-unknown-pragmas" +# Compiler flags. Apply -ffast-math to allow compiler autovectorization generate effective SIMD code for arm compilation +CXXFLAGS="${CXXFLAGS} -O3 -ffast-math -Wall -Wextra -Wzero-as-null-pointer-constant -Wno-unknown-pragmas" # Set AR_FLAGS to avoid build warning "ar: `u' modifier ignored since `D' is the default (see `U')" AR_FLAGS='cr'