-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prov/verbs: Replace __BITS_PER_LONG with LONG_WIDTH #10223
Conversation
The header is included in |
It does compile if I comment out that header, but gives this warning about a missing define. --- prov/verbs/src/src_libfabric_la-verbs_ep.lo ---
prov/verbs/src/verbs_ep.c: In function 'vrb_query_atomic':
prov/verbs/src/verbs_ep.c:2002:5: warning: "__BITS_PER_LONG" is not defined, evaluates to 0 [-Wundef]
2002 | #if __BITS_PER_LONG == 64 |
Something like this should work:
where |
OK. I will work on it later this week. |
BTW, it looks like C23 adds |
@raffenet I think that's something worth experimenting with (looks like it's already supported by gcc). Just need to keep the logic simple. |
What do you think about this? Looks like #include <limits.h>
#if !defined(LONG_WIDTH)
#ifdef LONG_BIT
#define LONG_WIDTH LONG_BIT
#elif defined(HAVE_ASM_TYPES_H)
#include <asm/types.h>
#define LONG_WIDTH __BITS_PER_LONG
#elif defined(__x86_64__) || defined(__aarch64__)
#ifdef !defined(__ILP32__)
#define LONG_WIDTH 64
#else
#define LONG_WIDTH 32
#endif
#endif
#endif |
@raffenet Thanks! This looks good to me. Let's keep it in the verbs provider for now since it's only used here. |
The verbs provider uses asm/types.h for __BITS_PER_LONG, but that header is limited to Linux systems. LONG_WIDTH is defined in C23 in limits.h. Use it instead, and add logic to define it if not available. This will allow the verbs provider to compile on FreeBSD systems. Signed-off-by: Ken Raffenetti <[email protected]>
Is the AWS CI failure real or no? |
@raffenet Likely noise. I'm restarting it. |
bot:aws:retest |
Include ofiwg/libfabric#10223. Fixes verbs provider compilation on FreeBSD systems.
Include ofiwg/libfabric#10223. Fixes verbs provider compilation on FreeBSD systems.
Include ofiwg/libfabric#10223. Fixes verbs provider compilation on FreeBSD systems.
Include ofiwg/libfabric#10223. Fixes verbs provider compilation on FreeBSD systems.
The checks for the verbs provider can pass on a FreeBSD system, but will fail to compile because asm/types.h is not available.Updated description: 2024-08-01
The verbs provider uses asm/types.h for __BITS_PER_LONG, but that header
is limited to Linux systems. LONG_WIDTH is defined in C23 in
limits.h. Use it instead, and add logic to define it if not
available. This will allow the verbs provider to compile on FreeBSD
systems.