zanmato1984 commented on issue #44448:
URL: https://github.com/apache/arrow/issues/44448#issuecomment-2418649378

   OK. By looking at the log more carefully I seem to get to the root cause.
   
   From the log, there is a preset `CMAKE_ARGS`:
   ```
   2024-10-17T00:53:32.7864890Z +CMAKE_ARGS= ... -DCMAKE_SYSTEM_PROCESSOR=arm64 
...
   ```
   This is well expected for a cross-compiling config.
   
   Then from the output of Arrow CMake:
   ```
   2024-10-17T00:53:45.7948650Z -- System processor: x86_64
   ```
   This is printed by:
   
https://github.com/apache/arrow/blob/b17546322a57f67b2adf1fcdb212685ac89210f6/cpp/cmake_modules/SetupCxxFlags.cmake#L24
   And it's not surprising that the subsequent SIMD options are set for x86 
platform and eventually lead to the erroring header.
   
   With a little googling there are 
[discussions](https://stackoverflow.com/a/76632595/4485168) seemed to be 
related:
   > I had a similar issue. The answer is that when CMAKE_SYSTEM_NAME is not 
set, CMake overwrites CMAKE_SYSTEM_PROCESSOR ([source 
code](https://github.com/Kitware/CMake/blob/fbea5d9f9945363f35aa16c3edcf0924e3dc4686/Modules/CMakeDetermineSystem.cmake#L178)).
 This is arguably a bug but regardless is how CMake behaves.
   
   I can locally reproduce the questioning CMake behavior on my M1 Mac CMake 
version 3.25.2:
   ```
   cmake -DCMAKE_SYSTEM_PROCESSOR=x86_64 ..
   -- Building using CMake version: 3.25.2
   ...
   -- System processor: arm64
   ```
   ```
   cmake -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=x86_64 ..
   -- Building using CMake version: 3.25.2
   ...
   -- System processor: x86_64
   ```
   
   Worth a try and hope this solves your issue, @h-vetinari . Thanks.


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

Reply via email to