Skip to content

Commit

Permalink
Remove redundant cmake stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
james-d-mitchell committed Oct 29, 2023
1 parent 0f76708 commit 967de58
Showing 1 changed file with 3 additions and 52 deletions.
55 changes: 3 additions & 52 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#****************************************************************************#
# Copyright (C) 2016 Florent Hivert <[email protected]>, #
# Copyright (C) 2016-2023 Florent Hivert <[email protected]>, #
# #
# Distributed under the terms of the GNU General Public License (GPL) #
# #
Expand All @@ -10,7 +10,7 @@
# #
# The full text of the GPL is available at: #
# #
# http://www.gnu.org/licenses/ #
# http://www.gnu.org/licenses/ #
#****************************************************************************#

# Require at least 3.8 so that we can set cmake_policy CMP0067 below
Expand All @@ -32,7 +32,6 @@ message(STATUS "**** Build type = ${CMAKE_BUILD_TYPE}")
# set(CMAKE_BUILD_TYPE Debug)
# set(CMAKE_VERBOSE_MAKEFILE 1)


################################
# General compiler configuration
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -50,56 +49,11 @@ include(CheckIncludeFileCXX)
include(CheckCXXSourceCompiles)
include(CheckCXXCompilerFlag)

## Check for buggy constexpr support G++ 5.0
# check_cxx_source_compiles(
# "
# using T = int;
# constexpr int exec(T f()) { return f(); }
# constexpr int foo() { return 1; }
# static_assert(exec(foo) == 1, \"Failed exec\");
# int main() {}
# "
# HPCOMBI_CONSTEXPR_FUN_ARGS)

check_cxx_compiler_flag('-march=native' HPCOMBI_HAVE_FLAG_ARCH_NATIVE)
check_cxx_compiler_flag('-mtune=native' HPCOMBI_HAVE_FLAG_TUNE_NATIVE)
# TODO check for -funroll-loops + -flax-vector-constexpr
# TODO only check for and set the flags required to make HPCombi work


#check_cxx_compiler_flag('-mavx2' HPCOMBI_HAVE_FLAG_AVX2)
#check_cxx_compiler_flag('-mavx512bw' HPCOMBI_HAVE_FLAG_AVX512BW)

## Check for Intel intrisics
# check_include_file_cxx("x86intrin.h" HPCOMBI_HAVE_X86INTRIN)
# if (NOT ${HPCOMBI_HAVE_FLAG_AVX} OR NOT ${HPCOMBI_HAVE_X86INTRIN})
# message(FATAL_ERROR "No SSE/AVX compiler intrinsics")
# endif()
# file(READ ${CMAKE_SOURCE_DIR}/list_intrin.txt hpcombi_intrinsics)
# string(REPLACE ";" "|" hpcombi_intrinsics "${hpcombi_intrinsics}")
# string(REPLACE "\n" ";" hpcombi_intrinsics "${hpcombi_intrinsics}")
# foreach (intrin ${hpcombi_intrinsics})
# if ("${intrin}" MATCHES "^#" ) # Comment
# continue()
# endif()
# string(REPLACE "|" ";" intrin "${intrin}")
# list(GET intrin 0 intrin_name)
# list(GET intrin 1 intrin_params)
# set(CMAKE_REQUIRED_FLAGS "-mavx")
# check_cxx_source_compiles("
# #include<x86intrin.h>
# int main() {
# ${intrin_name}(${intrin_params});
# return 0;
# }
# "
# "HPCOMBI_HAVE_${intrin_name}"
# )
# if (NOT "${HPCOMBI_HAVE_${intrin_name}}")
# message(FATAL_ERROR "Intrinsic ${intrin_name} not supported by compiler")
# endif()
# endforeach()

add_compile_options(-funroll-loops -flax-vector-conversions)
if (HPCOMBI_HAVE_FLAG_ARCH_NATIVE)
add_compile_options(-march=native)
Expand Down Expand Up @@ -130,10 +84,8 @@ IF (BUILD_TESTING)
ENDIF(BUILD_TESTING)

#####################
# Is this needed ?
configure_file(${CMAKE_SOURCE_DIR}/.VERSION.in ${CMAKE_BINARY_DIR}/.VERSION)

set(AUTOGENERATED_WARNING "WARNING: THIS IS A CMAKE AUTO-GENERATED FILE.")
configure_file(${CMAKE_SOURCE_DIR}/.VERSION.in ${CMAKE_BINARY_DIR}/.VERSION)

####################
# Installation
Expand All @@ -156,7 +108,6 @@ install (
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hpcombi.pc.in
# ${CMAKE_CURRENT_BINARY_DIR}/hpcombi.pc @ONLY)


#################
# Packing stuff
#
Expand Down

0 comments on commit 967de58

Please sign in to comment.