Compile error on osx-arm64
Opened this issue · 4 comments
Hello.
When I built the UDA conda package in #51 on an osx-arm64 M3 Mac laptop, I encountered C++ compile errors like:
error: cast from 'int (*)(XDR *, float *)' (aka 'int (*)(__rpc_xdr *, float *)') to 'xdrproc_t' (aka 'int (*)(__rpc_xdr *, void *, unsigned int)') converts to incompatible function type [-Werror,-Wcast-function-type-mismatch]
The whole build log is shared by the URL link: https://app.warp.dev/block/Y9zBIX0aRzIpHZ6lkBwts3
I could avoid the above error by adding the compile option -Wno-cast-function-type
into line 23 in source/CMakeLists.txt
file:
add_definitions( -Wall -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-cast-function-type )
I would greatly appreciate it if you could address this issue.
We regularly compile UDA with clang-19 on arm64 (including in the CI) and have not seen this issue before. It seems from the log you are defined a bunch of extra CXXFLAGS and CPPFLAGS - it's possible that some of these flags are causing the compiler to throw this error.
Would you be able to add this "-Wno-cast-function-type" to your CXXFLAGS? I would rather avoid turning off this warning for all code.
Thank you for your response.
I tried to add it to CXXFLAGS
, but the errors did not disappear somehow even though it can be seen in the log:https://app.warp.dev/block/shDp2SrcZvW2MmjIYhTnsL
Is there any dependency on the order of compiler args?
Perhaps the required flag is -Wno-cast-function-type-mismatch
?
That caused the same issue, unfortunately.