From 2367726578884f3975d12e276927b1f52acc152c Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 30 Sep 2020 23:28:49 +0200 Subject: [PATCH 1/3] Remove redundant status message --- cmake/system_check.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/system_check.cmake b/cmake/system_check.cmake index d06f4779f..b0ab926fc 100644 --- a/cmake/system_check.cmake +++ b/cmake/system_check.cmake @@ -121,7 +121,6 @@ endif() include(CheckIncludeFile) CHECK_INCLUDE_FILE("stdatomic.h" HAVE_C11) -if (HAVE_C11 EQUAL 1) -message (STATUS found stdatomic.h) +if (HAVE_C11) set (CCOMMON_OPT "${CCOMMON_OPT} -DHAVE_C11") endif() From de27e4f5fb54a792ea35720b67f0a395ad3e1026 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 11 Oct 2020 00:40:22 +0200 Subject: [PATCH 2/3] Stop DYNAMIC_ARCH build if the toplevel source contains a stray config_kernel.h from a gmake build This is unlikely to happen in practice, but if it does, the rogue file would get included instead of the dynamically generated version for each target_core, leading to very confusing errors like "invalid operands (undefined UND and ABS sections)" in compilation of the assembly kernels as macros like PREFETCH would remain undefined --- cmake/arch.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/arch.cmake b/cmake/arch.cmake index c00f8fe71..e851dd088 100644 --- a/cmake/arch.cmake +++ b/cmake/arch.cmake @@ -1,4 +1,3 @@ -## ## Author: Hank Anderson ## Description: Ported from portion of OpenBLAS/Makefile.system ## Sets various variables based on architecture. @@ -80,10 +79,15 @@ if (DYNAMIC_ARCH) string(REGEX REPLACE "-march=native" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") endif () if (DYNAMIC_LIST) - set(DYNAMIC_CORE PRESCOTT ${DYNAMIC_LIST}) + set(DYNAMIC_CORE ${DYNAMIC_LIST}) endif () endif () + CHECK_INCLUDE_FILE ("${PROJECT_SOURCE_DIR}/config_kernel.h" TRAP) + if (TRAP) + message (FATAL_ERROR "Your build directory contains a file config_kernel.h, probably from a previous compilation with make. This will conflict with the cmake compilation and cause strange compiler errors - please remove the file before trying again") + endif () + if (NOT DYNAMIC_CORE) message (STATUS "DYNAMIC_ARCH is not supported on this architecture, removing from options") unset(DYNAMIC_ARCH CACHE) From 82a497ec5d4c759acc9994b6d1eba54ea90e3b9b Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 11 Oct 2020 00:43:09 +0200 Subject: [PATCH 3/3] restore PRESCOTT default for DYNAMIC_LIST --- cmake/arch.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/arch.cmake b/cmake/arch.cmake index e851dd088..c048f13d1 100644 --- a/cmake/arch.cmake +++ b/cmake/arch.cmake @@ -79,7 +79,7 @@ if (DYNAMIC_ARCH) string(REGEX REPLACE "-march=native" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") endif () if (DYNAMIC_LIST) - set(DYNAMIC_CORE ${DYNAMIC_LIST}) + set(DYNAMIC_CORE PRESCOTT ${DYNAMIC_LIST}) endif () endif ()