Tangruilin commented on issue #240:
URL: https://github.com/apache/iceberg-cpp/issues/240#issuecomment-3315889872

   > > > > > > It seems pointless to run these tests and benchmarks within 
iceberg-cpp. I disable them in 
[#241](https://github.com/apache/iceberg-cpp/pull/241), can you give it a try?
   > > > > > 
   > > > > > 
   > > > > > cpu_set_t is not support on MacOS, it is only supported on Linux. 
Then I found the flag `HAVE_PTHREAD_AFFINITY=off` is not useful, you can 
manually comment out the CPU affinity settings to solve this problem. like 
below:
   > > > > > # pthread affinity, if available
   > > > > > if(HAVE_PTHREAD_AFFINITY)
   > > > > > #target_compile_definitions(benchmark PRIVATE 
-DBENCHMARK_HAS_PTHREAD_AFFINITY)
   > > > > > endif()
   > > > > 
   > > > > 
   > > > > I digged into this a little bit, when you set HAVE_PTHREAD_AFFINITY 
either to on or off, google benchmark will define HAVE_PTHREAD_AFFINITY, see 
[1]. Then I tried `cmake -S . -B build -DENABLE_ROARING_MICROBENCHMARKS=ON` to 
build CRoaring, it passed. You can observe some message like:
   > > > > ```
   > > > > -- Compiling and running to test HAVE_PTHREAD_AFFINITY
   > > > > -- Performing Test HAVE_PTHREAD_AFFINITY -- failed to compile
   > > > > ```
   > > > > 
   > > > > 
   > > > >     
   > > > >       
   > > > >     
   > > > > 
   > > > >       
   > > > >     
   > > > > 
   > > > >     
   > > > >   
   > > > > I think HAVE_PTHREAD_AFFINITY is supposed to be automatically 
detected and set by the google benchmark building system, may I ask why you 
specify it manually?
   > > > > [1] 
https://github.com/google/benchmark/blob/main/cmake/CXXFeatureCheck.cmake#L26-L29
   > > > 
   > > > 
   > > > ..., MacOS do not have `cpu_set_t `, so benchmark's PTHREAD_AFFINITY 
can not open on Mac
   > > 
   > > 
   > > After checking your reply again, I confirm that the error triggered by 
`-DCXXFEATURECHECK_DEBUG=on` is not an actual issue, it's intentionally used by 
the build system to probe OS capabilities during feature detection, I'll close 
this issue if no further comments.
   > 
   > I think this is a Google Benchmark's bug where CPU affinity is enabled, 
and it doesn't seem to be compatible with macOS. However, since Iceberg depends 
on Google Benchmark, it should at least inform macOS developers how to handle 
this error, rather than casually assuming that CPU affinity detection is 
expected behavior and therefore not treating it as a bug
   
   it seems https://github.com/apache/iceberg-cpp/pull/241 can slove this, if 
set `-DENABLE_ROARING_MICROBENCHMARKS=OFF` this can be ok. ths!


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to