|
|
@ -253,16 +253,16 @@ macro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE flag have)
|
|
|
|
endmacro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
|
|
|
|
endmacro(ADD_CXX_COMPILER_FLAG_IF_AVAILABLE)
|
|
|
|
|
|
|
|
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${GCC_ARCH} -Wall -Wno-comment -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable -Wformat -Wmissing-field-initializers -Wtype-limits -std=c++03")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-comment -Wno-reorder -Wno-unused-but-set-variable -Wno-unused-variable -Wformat -Wmissing-field-initializers -Wtype-limits -std=c++03")
|
|
|
|
|
|
|
|
|
|
|
|
find_package(SSE)
|
|
|
|
find_package(SSE)
|
|
|
|
if (HAVE_AVX2)
|
|
|
|
if (HAVE_AVX2)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -mavx2 -DLV_HAVE_AVX2 -DLV_HAVE_AVX -DLV_HAVE_SSE")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${GCC_ARCH} -mfpmath=sse -mavx2 -DLV_HAVE_AVX2 -DLV_HAVE_AVX -DLV_HAVE_SSE")
|
|
|
|
else (HAVE_AVX2)
|
|
|
|
else (HAVE_AVX2)
|
|
|
|
if(HAVE_AVX)
|
|
|
|
if(HAVE_AVX)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -mavx -DLV_HAVE_AVX -DLV_HAVE_SSE")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${GCC_ARCH} -mfpmath=sse -mavx -DLV_HAVE_AVX -DLV_HAVE_SSE")
|
|
|
|
elseif(HAVE_SSE)
|
|
|
|
elseif(HAVE_SSE)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -msse4.1 -DLV_HAVE_SSE")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${GCC_ARCH} -mfpmath=sse -msse4.1 -DLV_HAVE_SSE")
|
|
|
|
endif(HAVE_AVX)
|
|
|
|
endif(HAVE_AVX)
|
|
|
|
endif (HAVE_AVX2)
|
|
|
|
endif (HAVE_AVX2)
|
|
|
|
endif(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
endif(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
@ -270,7 +270,7 @@ endif(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clan
|
|
|
|
ADD_CXX_COMPILER_FLAG_IF_AVAILABLE("-Werror=incompatible-pointer-types" HAVE_ERROR_INCOMPATIBLE)
|
|
|
|
ADD_CXX_COMPILER_FLAG_IF_AVAILABLE("-Werror=incompatible-pointer-types" HAVE_ERROR_INCOMPATIBLE)
|
|
|
|
|
|
|
|
|
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
|
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${GCC_ARCH} -Wall -Wno-comment -Wno-write-strings -Winline -Wno-unused-result -Wformat -Wmissing-field-initializers -Wtype-limits -std=c99 -D_GNU_SOURCE")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-comment -Wno-write-strings -Winline -Wno-unused-result -Wformat -Wmissing-field-initializers -Wtype-limits -std=c99 -D_GNU_SOURCE")
|
|
|
|
|
|
|
|
|
|
|
|
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
|
|
|
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb -O0 -DDEBUG_MODE -DBUILD_TYPE_DEBUG")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb -O0 -DDEBUG_MODE -DBUILD_TYPE_DEBUG")
|
|
|
@ -292,12 +292,12 @@ if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
|
|
|
|
|
|
|
|
|
|
find_package(SSE)
|
|
|
|
find_package(SSE)
|
|
|
|
if (HAVE_AVX2)
|
|
|
|
if (HAVE_AVX2)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse -mavx2 -DLV_HAVE_AVX2 -DLV_HAVE_AVX -DLV_HAVE_SSE")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${GCC_ARCH} -mfpmath=sse -mavx2 -DLV_HAVE_AVX2 -DLV_HAVE_AVX -DLV_HAVE_SSE")
|
|
|
|
else (HAVE_AVX2)
|
|
|
|
else (HAVE_AVX2)
|
|
|
|
if(HAVE_AVX)
|
|
|
|
if(HAVE_AVX)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse -mavx -DLV_HAVE_AVX -DLV_HAVE_SSE")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${GCC_ARCH} -mfpmath=sse -mavx -DLV_HAVE_AVX -DLV_HAVE_SSE")
|
|
|
|
elseif(HAVE_SSE)
|
|
|
|
elseif(HAVE_SSE)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse -msse4.1 -DLV_HAVE_SSE")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${GCC_ARCH} -mfpmath=sse -msse4.1 -DLV_HAVE_SSE")
|
|
|
|
endif(HAVE_AVX)
|
|
|
|
endif(HAVE_AVX)
|
|
|
|
endif (HAVE_AVX2)
|
|
|
|
endif (HAVE_AVX2)
|
|
|
|
|
|
|
|
|
|
|
@ -306,8 +306,8 @@ if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
|
|
endif (HAVE_FMA)
|
|
|
|
endif (HAVE_FMA)
|
|
|
|
|
|
|
|
|
|
|
|
if (HAVE_AVX512)
|
|
|
|
if (HAVE_AVX512)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx512f -mavx512cd -mavx512bw -mavx512dq -DLV_HAVE_AVX512")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${GCC_ARCH} -mavx512f -mavx512cd -mavx512bw -mavx512dq -DLV_HAVE_AVX512")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512f -mavx512cd -mavx512bw -mavx512dq -DLV_HAVE_AVX512")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${GCC_ARCH} -mavx512f -mavx512cd -mavx512bw -mavx512dq -DLV_HAVE_AVX512")
|
|
|
|
endif(HAVE_AVX512)
|
|
|
|
endif(HAVE_AVX512)
|
|
|
|
|
|
|
|
|
|
|
|
if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
|
|
|
if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
|
|
@ -316,14 +316,14 @@ if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
|
|
endif(HAVE_SSE)
|
|
|
|
endif(HAVE_SSE)
|
|
|
|
endif(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
|
|
|
endif(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
|
|
|
|
|
|
|
|
|
|
|
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
|
|
|
|
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -march=native -DIS_ARM -DHAVE_NEON")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DIS_ARM -DHAVE_NEON -mfloat-abi=hard -mfpu=neon")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIS_ARM")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIS_ARM -mfloat-abi=hard -mfpu=neon")
|
|
|
|
message(STATUS "have ARM")
|
|
|
|
message(STATUS "Detected ARM processor")
|
|
|
|
set(HAVE_NEON "True")
|
|
|
|
set(HAVE_NEON "True")
|
|
|
|
else(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
|
|
|
|
else(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch")
|
|
|
|
set(HAVE_NEON "False")
|
|
|
|
set(HAVE_NEON "False")
|
|
|
|
endif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
|
|
|
|
endif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch")
|
|
|
|
set(CMAKE_REQUIRED_FLAGS ${CMAKE_C_FLAGS})
|
|
|
|
set(CMAKE_REQUIRED_FLAGS ${CMAKE_C_FLAGS})
|
|
|
|
|
|
|
|
|
|
|
|
if(NOT HAVE_SSE AND NOT HAVE_NEON AND NOT DISABLE_SIMD)
|
|
|
|
if(NOT HAVE_SSE AND NOT HAVE_NEON AND NOT DISABLE_SIMD)
|
|
|
|