kou commented on code in PR #14342:
URL: https://github.com/apache/arrow/pull/14342#discussion_r992741530
##########
cpp/src/parquet/CMakeLists.txt:
##########
@@ -180,17 +180,28 @@ set(PARQUET_SRCS
if(ARROW_HAVE_RUNTIME_AVX2)
# AVX2 is used as a proxy for BMI2.
list(APPEND PARQUET_SRCS level_comparison_avx2.cc level_conversion_bmi2.cc)
+ # We need CXX_FLAGS_RELEASE here to prevent the one-definition-rule
+ # violation with -DCMAKE_BUILD_TYPE=MinSizeRel. CXX_FLAGS_RELEASE
+ # will force inlining as much as possible.
+ # See also: ARROW-15664 and ARROW-15678
set_source_files_properties(level_comparison_avx2.cc
- PROPERTIES SKIP_PRECOMPILE_HEADERS ON
COMPILE_FLAGS
-
"${ARROW_AVX2_FLAG}")
+ PROPERTIES SKIP_PRECOMPILE_HEADERS ON
+ COMPILE_FLAGS
+ "${ARROW_AVX2_FLAG}
${CXX_FLAGS_RELEASE}")
# WARNING: DO NOT BLINDLY COPY THIS CODE FOR OTHER BMI2 USE CASES.
# This code is always guarded by runtime dispatch which verifies
# BMI2 is present. For a very small number of CPUs AVX2 does not
# imply BMI2.
+ #
+ # We need CXX_FLAGS_RELEASE here to prevent the one-definition-rule
+ # violation with -DCMAKE_BUILD_TYPE=MinSizeRel. CXX_FLAGS_RELEASE
+ # will force inlining as much as possible.
+ # See also: ARROW-15664 and ARROW-15678
set_source_files_properties(level_conversion_bmi2.cc
PROPERTIES SKIP_PRECOMPILE_HEADERS ON
COMPILE_FLAGS
- "${ARROW_AVX2_FLAG} -DARROW_HAVE_BMI2
-mbmi2")
+ "${ARROW_AVX2_FLAG} -DARROW_HAVE_BMI2
${CXX_FLAGS_RELEASE}"
Review Comment:
Oh... I removed `-mbmi2` accidentally...
It caused a build failure on macOS High Sierra:
https://github.com/ursacomputing/crossbow/actions/runs/3225397138/jobs/5278904264#step:13:7034
```text
/Users/voltrondata/tmp/hbtmp/apache-arrow-20221011-35535-3alkwv/cpp/src/parquet/level_conversion_inc.h:278:10:
error: always_inline function '_pext_u64' requires target feature 'bmi2', but
would be inlined into function 'ExtractBits' that is compiled without support
for 'bmi2'
return _pext_u64(bitmap, select_bitmap);
^
```
I'll restore the flag.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]