2022-04-27 01:37:38 +00:00
## The Intel® QPL provides high performance implementations of data processing functions for existing hardware accelerator, and/or software path in case if hardware accelerator is not available.
2022-07-05 20:54:17 +00:00
if ( OS_LINUX AND ARCH_AMD64 AND ( ENABLE_AVX2 OR ENABLE_AVX512 ) )
2022-07-05 18:08:44 +00:00
option ( ENABLE_QPL "Enable Intel® Query Processing Library" ${ ENABLE_LIBRARIES } )
elseif ( ENABLE_QPL )
2022-07-05 19:28:41 +00:00
message ( ${ RECONFIGURE_MESSAGE_LEVEL } "QPL library is only supported on x86_64 arch with avx2/avx512 support" )
2022-07-05 18:08:44 +00:00
endif ( )
if ( NOT ENABLE_QPL )
message ( STATUS "Not using QPL" )
return ( )
endif ( )
2022-04-27 01:37:38 +00:00
2023-02-02 14:26:27 +00:00
## QPL has build dependency on libaccel-config. Here is to build libaccel-config which is required by QPL.
## libaccel-config is the utility library for controlling and configuring Intel® In-Memory Analytics Accelerator (Intel® IAA).
set ( LIBACCEL_SOURCE_DIR "${ClickHouse_SOURCE_DIR}/contrib/idxd-config" )
set ( UUID_DIR "${ClickHouse_SOURCE_DIR}/contrib/qpl-cmake" )
set ( LIBACCEL_HEADER_DIR "${ClickHouse_SOURCE_DIR}/contrib/qpl-cmake/idxd-header" )
set ( SRCS
" $ { L I B A C C E L _ S O U R C E _ D I R } / a c c f g / l i b / l i b a c c f g . c "
" $ { L I B A C C E L _ S O U R C E _ D I R } / u t i l / l o g . c "
" $ { L I B A C C E L _ S O U R C E _ D I R } / u t i l / s y s f s . c "
)
add_library ( accel-config ${ SRCS } )
target_compile_options ( accel-config PRIVATE "-D_GNU_SOURCE" )
target_include_directories ( accel-config BEFORE
P R I V A T E $ { U U I D _ D I R }
P R I V A T E $ { L I B A C C E L _ H E A D E R _ D I R }
P R I V A T E $ { L I B A C C E L _ S O U R C E _ D I R } )
## QPL build start here.
2022-04-27 01:37:38 +00:00
set ( QPL_PROJECT_DIR "${ClickHouse_SOURCE_DIR}/contrib/qpl" )
set ( QPL_SRC_DIR "${ClickHouse_SOURCE_DIR}/contrib/qpl/sources" )
2022-07-05 18:08:44 +00:00
set ( QPL_BINARY_DIR "${ClickHouse_BINARY_DIR}/build/contrib/qpl" )
2022-12-07 21:41:12 +00:00
set ( EFFICIENT_WAIT OFF )
2022-04-27 01:37:38 +00:00
set ( BLOCK_ON_FAULT ON )
2022-04-27 17:54:57 +00:00
set ( LOG_HW_INIT OFF )
set ( SANITIZE_MEMORY OFF )
set ( SANITIZE_THREADS OFF )
set ( LIB_FUZZING_ENGINE OFF )
2023-04-25 18:52:28 +00:00
set ( DYNAMIC_LOADING_LIBACCEL_CONFIG OFF )
2022-04-27 17:54:57 +00:00
function ( GetLibraryVersion _content _outputVar )
2023-04-25 18:52:28 +00:00
string ( REGEX MATCHALL "QPL VERSION (.+) LANGUAGES" VERSION_REGEX "${_content}" )
2022-04-27 17:54:57 +00:00
SET ( ${ _outputVar } ${ CMAKE_MATCH_1 } PARENT_SCOPE )
endfunction ( )
FILE ( READ "${QPL_PROJECT_DIR}/CMakeLists.txt" HEADER_CONTENT )
GetLibraryVersion ( "${HEADER_CONTENT}" QPL_VERSION )
2022-04-27 01:37:38 +00:00
message ( STATUS "Intel QPL version: ${QPL_VERSION}" )
2022-07-06 14:34:22 +00:00
# There are 5 source subdirectories under $QPL_SRC_DIR: isal, c_api, core-sw, middle-layer, c_api.
# Generate 7 library targets: middle_layer_lib, isal, isal_asm, qplcore_px, qplcore_avx512, core_iaa, middle_layer_lib.
# Output ch_contrib::qpl by linking with 7 library targets.
2022-04-27 01:37:38 +00:00
include ( "${QPL_PROJECT_DIR}/cmake/CompileOptions.cmake" )
2022-05-05 15:56:11 +00:00
# check nasm compiler
include ( CheckLanguage )
check_language ( ASM_NASM )
if ( NOT CMAKE_ASM_NASM_COMPILER )
2022-12-07 21:41:12 +00:00
message ( FATAL_ERROR "Please install NASM from 'https://www.nasm.us/' because NASM compiler can not be found!" )
2022-05-05 15:56:11 +00:00
endif ( )
2022-04-27 01:37:38 +00:00
# [SUBDIR]isal
enable_language ( ASM_NASM )
set ( ISAL_C_SRC ${ QPL_SRC_DIR } /isal/igzip/adler32_base.c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / h u f f _ c o d e s . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / h u f f t a b l e s _ c . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ b a s e . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / f l a t t e n _ l l . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / e n c o d e _ d f . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ b a s e . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i n f l a t e . c
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ b o d y . c
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c _ b a s e . c
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 6 4 _ b a s e . c )
set ( ISAL_ASM_SRC ${ QPL_SRC_DIR } /isal/igzip/igzip_body.asm
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ g e n _ i c f _ m a p _ l h 1 _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ g e n _ i c f _ m a p _ l h 1 _ 0 6 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ d e c o d e _ b l o c k _ s t a t e l e s s _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ f i n i s h . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / e n c o d e _ d f _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / e n c o d e _ d f _ 0 6 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ d e c o d e _ b l o c k _ s t a t e l e s s _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / p r o c _ h e a p . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ b o d y _ h 1 _ g r _ b t . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i c f _ f i n i s h . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ i n f l a t e _ m u l t i b i n a r y . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ u p d a t e _ h i s t o g r a m _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ u p d a t e _ h i s t o g r a m _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / r f c 1 9 5 1 _ l o o k u p . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / a d l e r 3 2 _ s s e . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / a d l e r 3 2 _ a v x 2 _ 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ d e f l a t e _ h a s h . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ s e t _ l o n g _ i c f _ f g _ 0 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ s e t _ l o n g _ i c f _ f g _ 0 6 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / i g z i p _ m u l t i b i n a r y . a s m
$ { Q P L _ S R C _ D I R } / i s a l / i g z i p / s t d m a c . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c _ m u l t i b i n a r y . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ g z i p _ r e f l _ b y 8 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ g z i p _ r e f l _ b y 8 _ 0 2 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ g z i p _ r e f l _ b y 1 6 _ 1 0 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ 0 2 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ b y 4 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i e e e _ b y 1 6 _ 1 0 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i s c s i _ 0 0 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i s c s i _ 0 1 . a s m
$ { Q P L _ S R C _ D I R } / i s a l / c r c / c r c 3 2 _ i s c s i _ b y 1 6 _ 1 0 . a s m )
# Adding ISA-L library target
add_library ( isal OBJECT ${ ISAL_C_SRC } )
add_library ( isal_asm OBJECT ${ ISAL_ASM_SRC } )
# Setting external and internal interfaces for ISA-L library
target_include_directories ( isal
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / i s a l / i n c l u d e >
P R I V A T E $ { Q P L _ S R C _ D I R } / i s a l / i n c l u d e
P U B L I C $ { Q P L _ S R C _ D I R } / i s a l / i g z i p )
target_compile_options ( isal PRIVATE
" $ < $ < C _ C O M P I L E R _ I D : G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S } > "
" $ < $ < C O N F I G : D e b u g > : > "
" $ < $ < C O N F I G : R e l e a s e > : > " )
2022-12-07 21:41:12 +00:00
target_compile_options ( isal_asm PRIVATE "-I${QPL_SRC_DIR}/isal/include/"
P R I V A T E " - I $ { Q P L _ S R C _ D I R } / i s a l / i g z i p / "
P R I V A T E " - I $ { Q P L _ S R C _ D I R } / i s a l / c r c / "
P R I V A T E " - D Q P L _ L I B " )
2022-07-06 16:19:37 +00:00
# AS_FEATURE_LEVEL=10 means "Check SIMD capabilities of the target system at runtime and use up to AVX512 if available".
2022-07-09 18:13:12 +00:00
# AS_FEATURE_LEVEL=5 means "Check SIMD capabilities of the target system at runtime and use up to AVX2 if available".
2022-07-06 16:19:37 +00:00
# HAVE_KNOWS_AVX512 means rely on AVX512 being available on the target system.
2022-07-05 20:54:17 +00:00
if ( ENABLE_AVX512 )
2022-12-07 21:41:12 +00:00
target_compile_options ( isal_asm PRIVATE "-DHAVE_AS_KNOWS_AVX512" "-DAS_FEATURE_LEVEL=10" )
2022-07-06 16:19:37 +00:00
else ( )
2022-12-07 21:41:12 +00:00
target_compile_options ( isal_asm PRIVATE "-DAS_FEATURE_LEVEL=5" )
2022-07-05 19:28:41 +00:00
endif ( )
2022-04-27 01:37:38 +00:00
2022-07-06 14:34:22 +00:00
# Here must remove "-fno-sanitize=undefined" from COMPILE_OPTIONS.
# Otherwise nasm compiler would fail to proceed due to unrecognition of "-fno-sanitize=undefined"
2022-06-05 18:46:28 +00:00
if ( SANITIZE STREQUAL "undefined" )
get_target_property ( target_options isal_asm COMPILE_OPTIONS )
2022-06-29 02:52:11 +00:00
list ( REMOVE_ITEM target_options "-fno-sanitize=undefined" )
2022-06-05 18:46:28 +00:00
set_property ( TARGET isal_asm PROPERTY COMPILE_OPTIONS ${ target_options } )
endif ( )
2022-04-27 01:37:38 +00:00
target_compile_definitions ( isal PUBLIC
Q P L _ L I B
N D E B U G )
# [SUBDIR]core-sw
2022-07-06 17:26:07 +00:00
# Two libraries:qplcore_avx512/qplcore_px for SW fallback will be created which are implemented by AVX512 and non-AVX512 instructions respectively.
# The upper level QPL API will check SIMD capabilities of the target system at runtime and decide to call AVX512 function or non-AVX512 function.
# Hence, here we don't need put qplcore_avx512 under an ENABLE_AVX512 CMake switch.
# Actually, if we do that, some undefined symbols errors would happen because both of AVX512 function and non-AVX512 function are referenced by QPL API.
# PLATFORM=2 means AVX512 implementation; PLATFORM=0 means non-AVX512 implementation.
2022-04-27 01:37:38 +00:00
# Find Core Sources
file ( GLOB SOURCES
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / c h e c k s u m s / * . c
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / f i l t e r i n g / * . c
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / o t h e r / * . c
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / c o m p r e s s i o n / * . c )
file ( GLOB DATA_SOURCES
$ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / d a t a / * . c )
2022-07-06 17:26:07 +00:00
# Create avx512 library
2022-04-27 01:37:38 +00:00
add_library ( qplcore_avx512 OBJECT ${ SOURCES } )
2022-07-06 17:26:07 +00:00
2022-04-27 01:37:38 +00:00
target_compile_definitions ( qplcore_avx512 PRIVATE PLATFORM=2 )
target_include_directories ( qplcore_avx512
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / i n c l u d e >
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / i n c l u d e >
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / c o m p r e s s i o n / i n c l u d e >
P R I V A T E $ < T A R G E T _ P R O P E R T Y : i s a l , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
set_target_properties ( qplcore_avx512 PROPERTIES
$ < $ < C _ C O M P I L E R _ I D : G N U > : C _ S T A N D A R D 1 7 > )
target_link_libraries ( qplcore_avx512 ${ CMAKE_DL_LIBS } isal )
2022-07-05 18:08:44 +00:00
target_compile_options ( qplcore_avx512
P R I V A T E $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S }
P R I V A T E - m a r c h = s k y l a k e - a v x 5 1 2
P R I V A T E " $ < $ < C O N F I G : D e b u g > : > "
P R I V A T E " $ < $ < C O N F I G : R e l e a s e > : - O 3 ; - D _ F O R T I F Y _ S O U R C E = 2 > " )
2022-04-27 01:37:38 +00:00
target_compile_definitions ( qplcore_avx512 PUBLIC QPL_BADARG_CHECK )
#
# Create px library
#
#set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Create library
add_library ( qplcore_px OBJECT ${ SOURCES } ${ DATA_SOURCES } )
target_compile_definitions ( qplcore_px PRIVATE PLATFORM=0 )
target_include_directories ( qplcore_px
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / i n c l u d e >
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / i n c l u d e >
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - s w / s r c / c o m p r e s s i o n / i n c l u d e >
P R I V A T E $ < T A R G E T _ P R O P E R T Y : i s a l , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
set_target_properties ( qplcore_px PROPERTIES
$ < $ < C _ C O M P I L E R _ I D : G N U > : C _ S T A N D A R D 1 7 > )
target_link_libraries ( qplcore_px isal ${ CMAKE_DL_LIBS } )
2022-07-05 18:08:44 +00:00
target_compile_options ( qplcore_px
P R I V A T E $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S }
P R I V A T E " $ < $ < C O N F I G : D e b u g > : > "
P R I V A T E " $ < $ < C O N F I G : R e l e a s e > : - O 3 ; - D _ F O R T I F Y _ S O U R C E = 2 > " )
2022-04-27 01:37:38 +00:00
target_compile_definitions ( qplcore_px PUBLIC QPL_BADARG_CHECK )
# [SUBDIR]core-iaa
file ( GLOB HW_PATH_SRC ${ QPL_SRC_DIR } /core-iaa/sources/aecs/*.c
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / a e c s / * . c p p
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / d r i v e r _ l o a d e r / * . c
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / d r i v e r _ l o a d e r / * . c p p
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / d e s c r i p t o r s / * . c
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / d e s c r i p t o r s / * . c p p
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / b i t _ r e v . c )
# Create library
add_library ( core_iaa OBJECT ${ HW_PATH_SRC } )
target_include_directories ( core_iaa
P R I V A T E $ { U U I D _ D I R }
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - i a a / i n c l u d e >
2023-04-25 18:52:28 +00:00
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / i n c l u d e >
P R I V A T E $ < B U I L D _ I N T E R F A C E : $ { Q P L _ P R O J E C T _ D I R } / i n c l u d e > # status.h in own_checkers.h
P R I V A T E $ < B U I L D _ I N T E R F A C E : $ { Q P L _ P R O J E C T _ D I R } / s o u r c e s / c _ a p i > # own_checkers.h
2022-04-27 01:37:38 +00:00
P R I V A T E $ < T A R G E T _ P R O P E R T Y : q p l c o r e _ a v x 5 1 2 , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
target_compile_options ( core_iaa
P R I V A T E $ < $ < C _ C O M P I L E R _ I D : G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S } ;
2022-07-05 18:08:44 +00:00
$ < $ < C O N F I G : R e l e a s e > : - O 3 ; - D _ F O R T I F Y _ S O U R C E = 2 > > )
2022-04-27 01:37:38 +00:00
target_compile_features ( core_iaa PRIVATE c_std_11 )
target_compile_definitions ( core_iaa PRIVATE QPL_BADARG_CHECK
P R I V A T E $ < $ < B O O L : $ { B L O C K _ O N _ F A U L T } > : B L O C K _ O N _ F A U L T _ E N A B L E D >
P R I V A T E $ < $ < B O O L : $ { L O G _ H W _ I N I T } > : L O G _ H W _ I N I T > )
# [SUBDIR]middle-layer
generate_unpack_kernel_arrays ( ${ QPL_BINARY_DIR } )
file ( GLOB MIDDLE_LAYER_SRC
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / a n a l y t i c s / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c _ w r a p p e r / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c h e c k s u m / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m m o n / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m p r e s s i o n / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m p r e s s i o n / * / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / c o m p r e s s i o n / * / * / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / d i s p a t c h e r / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / o t h e r / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / u t i l / * . c p p
$ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r / i n f l a t e / * . c p p
$ { Q P L _ S R C _ D I R } / c o r e - i a a / s o u r c e s / a c c e l e r a t o r / * . c p p ) # todo
file ( GLOB GENERATED_PX_TABLES_SRC ${ QPL_BINARY_DIR } /generated/px_*.cpp )
file ( GLOB GENERATED_AVX512_TABLES_SRC ${ QPL_BINARY_DIR } /generated/avx512_*.cpp )
add_library ( middle_layer_lib OBJECT
$ { G E N E R A T E D _ P X _ T A B L E S _ S R C }
$ { G E N E R A T E D _ A V X 5 1 2 _ T A B L E S _ S R C }
$ { M I D D L E _ L A Y E R _ S R C } )
target_compile_options ( middle_layer_lib
P R I V A T E $ < $ < C _ C O M P I L E R _ I D : G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S } ;
$ { Q P L _ L I N U X _ T O O L C H A I N _ D Y N A M I C _ L I B R A R Y _ F L A G S } ;
$ < $ < C O N F I G : R e l e a s e > : - O 3 ; - D _ F O R T I F Y _ S O U R C E = 2 > >
2022-07-05 18:08:44 +00:00
P R I V A T E $ < $ < C O M P I L E _ L A N G _ A N D _ I D : C X X , G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ C P P _ E M B E D D E D _ F L A G S } > )
2022-04-27 01:37:38 +00:00
target_compile_definitions ( middle_layer_lib
2022-04-27 17:54:57 +00:00
P U B L I C Q P L _ V E R S I O N = " $ { Q P L _ V E R S I O N } "
2022-04-27 01:37:38 +00:00
P U B L I C $ < $ < B O O L : $ { L O G _ H W _ I N I T } > : L O G _ H W _ I N I T >
P U B L I C $ < $ < B O O L : $ { E F F I C I E N T _ W A I T } > : Q P L _ E F F I C I E N T _ W A I T >
P U B L I C Q P L _ B A D A R G _ C H E C K )
set_source_files_properties ( ${ GENERATED_PX_TABLES_SRC } PROPERTIES COMPILE_DEFINITIONS PLATFORM=0 )
set_source_files_properties ( ${ GENERATED_AVX512_TABLES_SRC } PROPERTIES COMPILE_DEFINITIONS PLATFORM=2 )
target_include_directories ( middle_layer_lib
P R I V A T E $ { U U I D _ D I R }
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / m i d d l e - l a y e r >
P U B L I C $ < T A R G E T _ P R O P E R T Y : _ q p l , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
P U B L I C $ < T A R G E T _ P R O P E R T Y : q p l c o r e _ p x , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
P U B L I C $ < T A R G E T _ P R O P E R T Y : q p l c o r e _ a v x 5 1 2 , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
P U B L I C $ < T A R G E T _ P R O P E R T Y : i s a l , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
P U B L I C $ < T A R G E T _ P R O P E R T Y : c o r e _ i a a , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S > )
target_compile_definitions ( middle_layer_lib PUBLIC -DQPL_LIB )
2022-07-06 14:34:22 +00:00
# [SUBDIR]c_api
2022-04-27 01:37:38 +00:00
file ( GLOB_RECURSE QPL_C_API_SRC
$ { Q P L _ S R C _ D I R } / c _ a p i / * . c
$ { Q P L _ S R C _ D I R } / c _ a p i / * . c p p )
add_library ( _qpl STATIC ${ QPL_C_API_SRC }
$ < T A R G E T _ O B J E C T S : m i d d l e _ l a y e r _ l i b >
$ < T A R G E T _ O B J E C T S : i s a l >
$ < T A R G E T _ O B J E C T S : i s a l _ a s m >
$ < T A R G E T _ O B J E C T S : q p l c o r e _ p x >
$ < T A R G E T _ O B J E C T S : q p l c o r e _ a v x 5 1 2 >
$ < T A R G E T _ O B J E C T S : c o r e _ i a a >
$ < T A R G E T _ O B J E C T S : m i d d l e _ l a y e r _ l i b > )
target_include_directories ( _qpl
P U B L I C $ < B U I L D _ I N T E R F A C E : $ { Q P L _ P R O J E C T _ D I R } / i n c l u d e / >
P R I V A T E $ < T A R G E T _ P R O P E R T Y : m i d d l e _ l a y e r _ l i b , I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S >
P R I V A T E $ < B U I L D _ I N T E R F A C E : $ { Q P L _ S R C _ D I R } / c _ a p i > )
target_compile_options ( _qpl
P R I V A T E $ < $ < C _ C O M P I L E R _ I D : G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ R E Q U I R E D _ F L A G S } ;
$ { Q P L _ L I N U X _ T O O L C H A I N _ D Y N A M I C _ L I B R A R Y _ F L A G S } ;
$ < $ < C O N F I G : R e l e a s e > : - O 3 ; - D _ F O R T I F Y _ S O U R C E = 2 > >
2022-07-05 18:08:44 +00:00
P R I V A T E $ < $ < C O M P I L E _ L A N G _ A N D _ I D : C X X , G N U > : $ { Q P L _ L I N U X _ T O O L C H A I N _ C P P _ E M B E D D E D _ F L A G S } > )
2022-04-27 01:37:38 +00:00
target_compile_definitions ( _qpl
2022-07-05 18:08:44 +00:00
P R I V A T E - D Q P L _ L I B
P R I V A T E - D Q P L _ B A D A R G _ C H E C K
P U B L I C - D E N A B L E _ Q P L _ C O M P R E S S I O N )
2022-04-26 17:52:35 +00:00
2022-04-27 01:37:38 +00:00
target_link_libraries ( _qpl
2023-02-02 14:26:27 +00:00
P R I V A T E a c c e l - c o n f i g
2022-04-27 01:37:38 +00:00
P R I V A T E $ { C M A K E _ D L _ L I B S } )
2022-04-26 17:52:35 +00:00
2022-04-27 01:37:38 +00:00
add_library ( ch_contrib::qpl ALIAS _qpl )
2023-04-25 18:52:28 +00:00
target_include_directories ( _qpl SYSTEM BEFORE
P U B L I C " $ { Q P L _ P R O J E C T _ D I R } / i n c l u d e "
P U B L I C " $ { L I B A C C E L _ S O U R C E _ D I R } / a c c f g "
P U B L I C $ { U U I D _ D I R } )