]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | # jerasure plugin |
2 | ||
3 | set(jerasure_utils_src | |
4 | ErasureCodePluginJerasure.cc | |
5 | ErasureCodeJerasure.cc) | |
6 | ||
7 | add_library(jerasure_utils OBJECT ${jerasure_utils_src}) | |
8 | add_dependencies(jerasure_utils ${CMAKE_SOURCE_DIR}/src/ceph_ver.h) | |
9 | ||
10 | # Set the CFLAGS correctly for gf-complete based on SIMD compiler support | |
11 | set(GF_COMPILE_FLAGS) | |
12 | if(HAVE_ARMV8_SIMD) | |
13 | list(APPEND GF_COMPILE_FLAGS ARM_NEON ARCH_AARCH64) | |
14 | endif() | |
15 | if(HAVE_ARM_NEON) | |
16 | list(APPEND GF_COMPILE_FLAGS ARM_NEON) | |
17 | endif() | |
18 | if(HAVE_INTEL_SSE) | |
19 | list(APPEND GF_COMPILE_FLAGS INTEL_SSE) | |
20 | endif() | |
21 | if(HAVE_INTEL_SSE2) | |
22 | list(APPEND GF_COMPILE_FLAGS INTEL_SSE2) | |
23 | endif() | |
24 | if(HAVE_INTEL_SSE3) | |
25 | list(APPEND GF_COMPILE_FLAGS INTEL_SSE3) | |
26 | endif() | |
27 | if(HAVE_INTEL_SSSE3) | |
28 | list(APPEND GF_COMPILE_FLAGS INTEL_SSSE3) | |
29 | endif() | |
30 | if(HAVE_INTEL_PCLMUL) | |
31 | list(APPEND GF_COMPILE_FLAGS INTEL_SSE4_PCLMUL) | |
32 | endif() | |
33 | if(HAVE_INTEL_SSE4_1) | |
34 | list(APPEND GF_COMPILE_FLAGS INTEL_SSE4) | |
35 | endif() | |
36 | if(HAVE_INTEL_SSE4_2) | |
37 | list(APPEND GF_COMPILE_FLAGS INTEL_SSE4) | |
38 | endif() | |
39 | ||
40 | # set this to TRUE to enable debugging of SIMD detection | |
41 | # inside gf-complete. gf-complete will printf the SIMD | |
42 | # instructions detected to stdout. | |
43 | if (FALSE) | |
44 | list(APPEND GF_COMPILE_FLAGS DEBUG_CPU_DETECTION) | |
45 | endif() | |
46 | ||
47 | set(gf-complete_srcs | |
48 | gf-complete/src/gf_cpu.c | |
49 | gf-complete/src/gf_wgen.c | |
50 | gf-complete/src/gf_w16.c | |
51 | gf-complete/src/gf.c | |
52 | gf-complete/src/gf_w32.c | |
53 | gf-complete/src/gf_w64.c | |
54 | gf-complete/src/gf_w128.c | |
55 | gf-complete/src/gf_general.c | |
56 | gf-complete/src/gf_w4.c | |
57 | gf-complete/src/gf_rand.c | |
58 | gf-complete/src/gf_w8.c) | |
59 | ||
60 | if(HAVE_ARM_NEON OR HAVE_ARMV8_SIMD) | |
61 | list(APPEND gf-complete_srcs | |
62 | gf-complete/src/neon/gf_w4_neon.c | |
63 | gf-complete/src/neon/gf_w8_neon.c | |
64 | gf-complete/src/neon/gf_w16_neon.c | |
65 | gf-complete/src/neon/gf_w32_neon.c | |
66 | gf-complete/src/neon/gf_w64_neon.c) | |
67 | endif() | |
68 | ||
69 | add_library(gf-complete_objs OBJECT ${gf-complete_srcs}) | |
70 | set_target_properties(gf-complete_objs PROPERTIES | |
71 | COMPILE_FLAGS "${SIMD_COMPILE_FLAGS}") | |
72 | set_target_properties(gf-complete_objs PROPERTIES | |
73 | COMPILE_DEFINITIONS "${GF_COMPILE_FLAGS}") | |
74 | ||
75 | set(jerasure_srcs | |
76 | jerasure/src/cauchy.c | |
77 | jerasure/src/galois.c | |
78 | jerasure/src/jerasure.c | |
79 | jerasure/src/liberation.c | |
80 | jerasure/src/reed_sol.c | |
81 | jerasure_init.cc) | |
82 | add_library(jerasure_objs OBJECT ${jerasure_srcs}) | |
83 | ||
84 | set(ec_jerasure_objs | |
85 | $<TARGET_OBJECTS:gf-complete_objs> | |
86 | $<TARGET_OBJECTS:jerasure_objs> | |
87 | $<TARGET_OBJECTS:jerasure_utils> | |
88 | $<TARGET_OBJECTS:erasure_code_objs>) | |
89 | ||
90 | add_library(ec_jerasure SHARED ${ec_jerasure_objs}) | |
91 | set_target_properties(ec_jerasure PROPERTIES | |
92 | INSTALL_RPATH "") | |
93 | target_link_libraries(ec_jerasure ${EXTRALIBS}) | |
94 | install(TARGETS ec_jerasure DESTINATION ${erasure_plugin_dir}) | |
95 | ||
96 | # legacy libraries | |
97 | foreach(flavor ${jerasure_legacy_flavors}) | |
98 | set(plugin_name "ec_jerasure_${flavor}") | |
99 | add_library(${plugin_name} SHARED ${ec_jerasure_objs}) | |
100 | set_target_properties(${plugin_name} PROPERTIES | |
101 | INSTALL_RPATH "") | |
102 | install(TARGETS ${plugin_name} DESTINATION ${erasure_plugin_dir}) | |
103 | add_dependencies(ec_jerasure ${plugin_name}) | |
104 | endforeach() |