Skip to content

Commit

Permalink
Export build architecture to CMake cache
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Oct 27, 2022
1 parent 2703600 commit fce06b1
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,41 +55,41 @@ if (HAVE_AVX2)
else ()
set(MMSEQS_ARCH "${MMSEQS_ARCH} -mavx2 -mcx16 -Wa,-q")
endif ()
set(X64 1)
set(X64 1 CACHE INTERNAL "")
elseif (HAVE_SSE4_1)
set(MMSEQS_ARCH "${MMSEQS_ARCH} -msse4.1 -mcx16")
set(X64 1)
set(X64 1 CACHE INTERNAL "")
elseif (HAVE_SSE2)
set(MMSEQS_ARCH "${MMSEQS_ARCH} -msse2")
set(DISABLE_IPS4O 1)
set(X64 1)
set(X64 1 CACHE INTERNAL "")
elseif (HAVE_POWER9)
set(MMSEQS_ARCH "${MMSEQS_ARCH} -mcpu=power9 -mvsx")
set(PPC64 1)
set(PPC64 1 CACHE INTERNAL "")
elseif (HAVE_POWER8)
set(MMSEQS_ARCH "${MMSEQS_ARCH} -mcpu=power8 -mvsx")
set(PPC64 1)
set(PPC64 1 CACHE INTERNAL "")
elseif (HAVE_ARM8)
set(MMSEQS_ARCH "${MMSEQS_ARCH} -march=armv8-a+simd")
set(ARM 1)
set(ARM 1 CACHE INTERNAL "")
elseif (HAVE_S390X)
set(MMSEQS_ARCH "${MMSEQS_ARCH} -march=z14 -mzarch -mzvector")
set(ZARCH 1)
set(ZARCH 1 CACHE INTERNAL "")
endif ()

if (NATIVE_ARCH AND (MMSEQS_ARCH STREQUAL ""))
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|ARM.*|aarch64.*|AARCH64.*)")
set(ARM 1)
set(ARM 1 CACHE INTERNAL "")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "PPC64*|ppc64*|powerpc64*")
set(PPC64 1)
set(PPC64 1 CACHE INTERNAL "")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "amd64|AMD64")
set(X64 1)
set(X64 1 CACHE INTERNAL "")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "x86|X86")
set(X86 1)
set(X86 1 CACHE INTERNAL "")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390")
set(ZARCH 1)
set(ZARCH 1 CACHE INTERNAL "")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^sparc")
set(SPARC 1)
set(SPARC 1 CACHE INTERNAL "")
else ()
message(WARNING "CPU without native SIMD instructions. Performance will be bad.")
endif ()
Expand Down

0 comments on commit fce06b1

Please sign in to comment.