Add getarch flags to disable AVX on x86
(and other small fixes to match Makefile behaviour)
This commit is contained in:
parent
ae9e8b131e
commit
f69a0be712
|
@ -70,6 +70,13 @@ if (X86_64)
|
||||||
set(GETARCH_FLAGS "${GETARCH_FLAGS} -march=native")
|
set(GETARCH_FLAGS "${GETARCH_FLAGS} -march=native")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# On x86 no AVX support is available
|
||||||
|
if (X86 OR X86_64)
|
||||||
|
if ((DEFINED BINARY AND BINARY EQUAL 32) OR ("$CMAKE_SIZEOF_VOID_P}" EQUAL "4"))
|
||||||
|
set(GETARCH_FLAGS "${GETARCH_FLAGS} -DNO_AVX -DNO_AVX2 -DNO_AVX512")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (INTERFACE64)
|
if (INTERFACE64)
|
||||||
message(STATUS "Using 64-bit integers.")
|
message(STATUS "Using 64-bit integers.")
|
||||||
set(GETARCH_FLAGS "${GETARCH_FLAGS} -DUSE64BITINT")
|
set(GETARCH_FLAGS "${GETARCH_FLAGS} -DUSE64BITINT")
|
||||||
|
@ -148,7 +155,9 @@ else()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include("${PROJECT_SOURCE_DIR}/cmake/prebuild.cmake")
|
include("${PROJECT_SOURCE_DIR}/cmake/prebuild.cmake")
|
||||||
|
if (DEFINED BINARY)
|
||||||
|
message(STATUS "Compiling a ${BINARY}-bit binary.")
|
||||||
|
endif ()
|
||||||
if (NOT DEFINED NEED_PIC)
|
if (NOT DEFINED NEED_PIC)
|
||||||
set(NEED_PIC 1)
|
set(NEED_PIC 1)
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -165,6 +174,9 @@ include("${PROJECT_SOURCE_DIR}/cmake/cc.cmake")
|
||||||
if (NOT NOFORTRAN)
|
if (NOT NOFORTRAN)
|
||||||
# Fortran Compiler dependent settings
|
# Fortran Compiler dependent settings
|
||||||
include("${PROJECT_SOURCE_DIR}/cmake/fc.cmake")
|
include("${PROJECT_SOURCE_DIR}/cmake/fc.cmake")
|
||||||
|
else ()
|
||||||
|
set(NO_LAPACK 1)
|
||||||
|
set(NO_LAPACKE 1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (BINARY64)
|
if (BINARY64)
|
||||||
|
@ -190,9 +202,14 @@ if (NEED_PIC)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (DYNAMIC_ARCH)
|
if (DYNAMIC_ARCH)
|
||||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_ARCH")
|
if (X86 OR X86_64 OR ARM64 OR PPC)
|
||||||
if (DYNAMIC_OLDER)
|
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_ARCH")
|
||||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_OLDER")
|
if (DYNAMIC_OLDER)
|
||||||
|
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_OLDER")
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
unset (DYNAMIC_ARCH)
|
||||||
|
message (STATUS "DYNAMIC_ARCH is not supported on the target architecture, removing")
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue