]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cmake: introduce WITH_EC_ISA_PLUGIN
authorKefu Chai <kchai@redhat.com>
Fri, 9 Apr 2021 04:14:23 +0000 (12:14 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 13 Apr 2021 01:13:46 +0000 (09:13 +0800)
instead of checking "HAVE_NASM_X64_AVX2 OR HAVE_ARMV8_SIMD" everywhere,
use a single cached variable of WITH_EC_ISA_PLUGIN. so it's more
consistent when checking the availability of ec_isa plugin.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/options.cc
src/erasure-code/CMakeLists.txt
src/include/config-h.in.cmake
src/test/erasure-code/CMakeLists.txt
src/test/erasure-code/TestErasureCodePluginClay.cc

index 8d6175d41a265c1b70f7fb5d63276f509846d7fb..15911cbe8205f1e8dec78b25c32aa77b246c131d 100644 (file)
@@ -2753,7 +2753,7 @@ std::vector<Option> get_global_options() {
 
     Option("osd_erasure_code_plugins", Option::TYPE_STR, Option::LEVEL_ADVANCED)
     .set_default("jerasure lrc"
-  #if defined(HAVE_NASM_X64_AVX2) || defined(HAVE_ARMV8_SIMD)
+  #if defined(WITH_EC_ISA_PLUGIN)
          " isa"
   #endif
         )
index ec091f584a9ade71f71b054a67b1fd1da4951448..18291f64b5cc9a9a26bb25364e3c9333c210e36a 100644 (file)
@@ -23,6 +23,10 @@ add_subdirectory(shec)
 add_subdirectory(clay)
 
 if(HAVE_NASM_X64_AVX2 OR HAVE_ARMV8_SIMD)
+  set(WITH_EC_ISA_PLUGIN TRUE CACHE BOOL "")
+endif()
+
+if(WITH_EC_ISA_PLUGIN)
   add_subdirectory(isa)
   set(EC_ISA_LIB ec_isa)
 endif()
index 338f7a4839036c8770a392de5be40788257a871e..1cdc77e65be450e360386598d772ca85c66449fa 100644 (file)
 /* we have a recent nasm and are x86_64 */
 #cmakedefine HAVE_NASM_X64
 
-/* nasm can also build the isa-l:avx2 */
-#cmakedefine HAVE_NASM_X64_AVX2
-
 /* nasm can also build the isa-l:avx512 */
 #cmakedefine HAVE_NASM_X64_AVX512
 
-/* Define if isa-l is compiled for arm64 */
-#cmakedefine HAVE_ARMV8_SIMD
+/* Define if the erasure code isa-l plugin is compiled */
+#cmakedefine WITH_EC_ISA_PLUGIN
 
 /* Define to 1 if strerror_r returns char *. */
 #cmakedefine STRERROR_R_CHAR_P 1
index ff3ba4dc012573fcea4f0f75aea317ec0b33d8a1..ab7328eae0ebb2c4a7a0c50f022eae1ca69ba6a9 100644 (file)
@@ -74,7 +74,7 @@ target_link_libraries(unittest_erasure_code_plugin_jerasure
 add_dependencies(unittest_erasure_code_plugin_jerasure
   ec_jerasure)
 
-if(HAVE_NASM_X64_AVX2 OR HAVE_ARMV8_SIMD)
+if(WITH_EC_ISA_PLUGIN)
 
 #unittest_erasure_code_isa
 add_executable(unittest_erasure_code_isa
@@ -105,7 +105,7 @@ target_link_libraries(unittest_erasure_code_plugin_isa
   )
 add_dependencies(unittest_erasure_code_plugin_isa
   ec_isa)
-endif(HAVE_NASM_X64_AVX2 OR HAVE_ARMV8_SIMD)
+endif(WITH_EC_ISA_PLUGIN)
 
 # unittest_erasure_code_lrc
 add_executable(unittest_erasure_code_lrc
index 3469d027281955bc138e81736468c2d75b097e9b..c9297a49fc8ed64e0462bf9523315fc8a96131a8 100644 (file)
@@ -58,7 +58,7 @@ TEST(ErasureCodePlugin, factory)
       EXPECT_TRUE(erasure_code.get());
     }
   }
-#ifdef HAVE_NASM_X64_AVX2
+#ifdef WITH_EC_ISA_PLUGIN
   //check clay plugin with scalar_mds=isa
   {
     const char *techniques[] = {