From a0a1c8ab0d579527608a43077012c231022f3b9a Mon Sep 17 00:00:00 2001 From: "James D. Mitchell" Date: Thu, 26 Oct 2023 13:31:17 +0100 Subject: [PATCH] Remove -mavx flag + bump cmake to 3.8 --- CMakeLists.txt | 15 ++++++--------- tests/test_epu.cpp | 1 + 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bcfcc986..d48153d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,8 @@ # http://www.gnu.org/licenses/ # #****************************************************************************# -cmake_minimum_required(VERSION 2.8) +# Require at least 3.8 so that we can set cmake_policy CMP0067 below +cmake_minimum_required(VERSION 3.8) ##################### # Project description @@ -41,12 +42,8 @@ set(CMAKE_CXX_EXTENSIONS OFF) # -std=c++14 instead of -std=gnu++14 add_definitions(-DHPCOMBI_HAVE_CONFIG) message(STATUS "*** Compiler id is ${CMAKE_CXX_COMPILER_ID}") -if ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) - # Workaround of CMAKE bug https://stackoverflow.com/questions/47213356/ - set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -std=c++14) - add_compile_options(-std=c++14 -Wall -g -pg) -endif() - +# See https://stackoverflow.com/questions/47213356/ for discussion +cmake_policy(SET CMP0067 NEW) ################################## # Checks for compiler capabilities @@ -78,7 +75,7 @@ check_cxx_source_compiles( " HPCOMBI_CONSTEXPR_FUN_ARGS) -check_cxx_compiler_flag('-mavx' HPCOMBI_HAVE_FLAG_AVX) +# check_cxx_compiler_flag('-mavx' HPCOMBI_HAVE_FLAG_AVX) #check_cxx_compiler_flag('-march=native' HPCOMBI_HAVE_FLAG_NATIVE) #check_cxx_compiler_flag('-mavx2' HPCOMBI_HAVE_FLAG_AVX2) #check_cxx_compiler_flag('-mavx512bw' HPCOMBI_HAVE_FLAG_AVX512BW) @@ -113,7 +110,7 @@ check_cxx_compiler_flag('-mavx' HPCOMBI_HAVE_FLAG_AVX) # endif() # endforeach() -add_compile_options(-mavx -mtune=native -funroll-loops -flax-vector-conversions) +add_compile_options(-mtune=native -funroll-loops -flax-vector-conversions) ################### # Project Structure diff --git a/tests/test_epu.cpp b/tests/test_epu.cpp index 5eb5e5e0..f5ea53fa 100644 --- a/tests/test_epu.cpp +++ b/tests/test_epu.cpp @@ -21,6 +21,7 @@ #include "test_main.hpp" #include +// TODO uncomment // #define TEST_AGREES(ref, fun) \ // BOOST_FIXTURE_TEST_CASE(Epu8::agrees_##fun, Fix) { \ // for (auto x : v) \