ukaea / UDA

Universal Data Access library to provide data over the network in a unified data object.
https://ukaea.github.io/UDA/
Apache License 2.0
11 stars 4 forks source link

Compile error on osx-arm64 #52

Open munechika-koyo opened 1 week ago

munechika-koyo commented 1 week ago

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.

jholloc commented 1 week ago

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.

munechika-koyo commented 1 week ago

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?

jholloc commented 1 week ago

Perhaps the required flag is -Wno-cast-function-type-mismatch ?

munechika-koyo commented 1 week ago

That caused the same issue, unfortunately.